Return to LAS FAQ


Yearly averaged data sets


Question:

I have a dataset with yearly averages and LAS returns an "Illegal region"
error when I request data?  

Explanation:

If you have a dataset with yearly averages, addXml.pl will create xml that looks something like this:

  <data_nc_TYEARS type="t" units="YEARS">
<arange start="1980" step="1" size="21"/>
</data_nc_TYEARS>
You might also have a single yearly average with an addXml.pl generated time axis like this:
  <Vave_y1980_time type="t" units="years">
   <v>1980-Jan-1 00:00:00
   </v>
  </Vave_y1980_time>

In the first case, LAS will generate an error message when you request data. In the second case you will have an ugly time axis selection widget. Ideally you'd like to use something like this:

  <Vave_y1980_time type="t" units="years">
   <v>1980</v>
   <v>1981</v>
   <v>1982</v>
   ...
  </Vave_y1980_time>

Unfortunately, this will cause LAS to return the following error:

Illegal region

You specified a time or depth value that is outside the region contained by this dataset.

This error results from how time values are passed from the LAS user interface (UI) to Ferret. The following rules apply

  1. If the time string is of the form "YYYY-MM-DD" it is assumed to be a valid time string and is passed as a time string.
  2. If the time string is numeric only (e.g. "1980") it is assumed to be a valid index value and is used to address the underlying time axis index values. (This is useful for modellers who wish to refer to their time axis indices directly).
  3. If the time string is neither a valid time string, nor a numeric value, the index value associated with the string in the selection widget in the LAS UI is passed. (This would potentially allow someone to have the values "today", "tomorrow" and "the next day" be associated with 1,2 and 3.)

Solution:

The problem can be solved by utilizing 3. above. If you create the following time axis in the xml configuration file:

  <Vave_y1980_time type="t" units="years">
   <v>1980 (av.)</v>
   <v>1981 (av.)</v>
   <v>1982 (av.)</v>
   ...
  </Vave_y1980_time>

the time strings will not be recognized and the index values 1,2,3,... will be used instead. For a yearly dataset beginning in 1980 this should be an adequate solution.


Jonathan Callahan: Jonathan.S.Callahan@noaa.gov
Last modified: December 03, 2001