Return to LAS FAQ


Configuring variables with invalid names.


Question:



How can I configure LAS to recognize variables with invalid names?

Explanation:

In some netCDF files the variable names are not consistent with Ferret's rules for variable naming. They may be case-sensitive (for example, variables "v" and "V" defined in the same file), may be restricted names such as the Ferret pseudo-variable names I, J, K, L, X, Y, Z, T, XBOX, YBOX, ZBOX, or TBOX, or they may include "illegal" characters such as "+", "-", "%", blanks, etc. Ferret can access these variables names by enclosing the offending name in single quotes.

Solution:

To access such variable names in LAS, change the variable element tag in the XML file to a compliant name and add a custom init_script which includes the command: let goodname = 'badname'.


   <s-s-t name="SEA SURFACE TEMPERATURE" units="Deg C">
    <link match="/lasdata/grids/dataset_grid"/>
   </SST>

BECOMES:

   <sst name="SEA SURFACE TEMPERATURE" units="Deg C">
    <link match="/lasdata/grids/dataset_grid"/>
    <properties>
     <ferret>
      <init_script>Dataset_sst_init</init_script>
     </ferret>
    </properties>
   </SST>

THEN copy jnls/std_initialize.jnl to jnls/Dataset_sst_init.jnl

AND  add the line:     let SST = SST

     after the line:   set data ($dset)



Jonathan Callahan: Jonathan.S.Callahan@noaa.gov
Last modified: May 23, 2002