[Thread Prev][Thread Next][Index]

Re: [ferret_users] sample_dimension in ferret



Hi Ansley,

thanks - including the station ID and 'cf_role' attribute did shift the variables that are a function of 'station' to the E axis; updated simple files in the attachment.



FYI: The other thing that had been unclear to me: On the ferret and cfconventions.org website mentioned below, 'temp' is only a function of 'obs':

yes? show grid temp
     GRID GQA2
  name       axis              # pts   start                end
  OBS       X                20787 r   1                    20787
  normal    Y
  normal    Z
  normal    T
  normal    E
  normal    F

So I assume that all measurements from all stations are concatenated in temp (to save space and dimensions as opposed to having temp be a function of 'obs' AND 'station'), and can be assigned to the respective stations by means of the 'rowsize' variable.



The SEPARATE function works well as described on the ferret website:

yes? let/units="`temp,return=units`"/title="`temp,return=title`" separate_temp = SEPARATE(temp, rowsize, 0)
yes? list separate_temp
             VARIABLE : temperature (Celsius)
             FILENAME : ragged.nc
             SUBSET   : 13 points (X)
 1    /  1:   1.00
 2    /  2:   2.00
 3    /  3:   3.00
 4    /  4:   4.00
 5    /  5:   ....
 6    /  6:   5.00
 7    /  7:   6.00
 8    /  8:   7.00
 9    /  9:   8.00
 10   / 10:   9.00
 11   / 11:   ....
 12   / 12:  10.00
 13   / 13:  11.00


... and expanding the variable into 2-D also works well as described by ferret, e.g.,

yes? let longest = `rowsize[m=@max]`
yes? let temp2d = EXPNDI_BY_M_COUNTS(temp, rowsize, longest)
yes? shade temp2d


Nice!


Best wishes,
Hella







On 08/03/17 21:13, Ansley C. Manke wrote:
Hi Hella,

The other attribute that's needed is "cf_role", as an attribute on a
variable which will identify the station (or trajectory, or whatever the
feature type is, in general). Your file doesn't seem to have a variable
that is a station id. This is described in the CF conventions but it
looks like we need to add this information to the Ferret documentation
about Discrete Sampling Geometries files.

-Ansley


On 3/8/2017 8:07 AM, Hella Riede wrote:
Hello ferreters,


I checked out the ferret documentation website about discrete
geometries
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/data-set-basics/2-8-discrete-geometries-datasets-1,
especially about the attribute 'sample_dimension'.

Based on
http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#_contiguous_ragged_array_representation_of_time_series,
I made a simple dataset, see attachments, containing the
'sample_dimension' attribute.

When I load this simple example into ferret, I don't get the
observations on the X axis and the instance axis ('station') in E
direction as described on the ferret website above, but rather two X
grids instead, see output below.

Any idea why? Is the 'dsg_file.nc' dataset used in the ferret example
available somewhere to better understand the structure?

I am not sure if 'obs' should be the sum of all observations of all
stations which 'rowsize' will then divide up per station, or if 'obs'
should be the maximum length per 'station'.

Thanks in advance!

Best wishes,
Hella
on FERRET v7.022 (beta/debug)




yes? use ragged.nc
yes? sh da
      currently SET data sets:
     1> ./ragged.nc  (default)
  name     title                             I         J K         L
  LON      station longitude                1:3       ... ...       ...
  LAT      station latitude                 1:3       ... ...       ...
  ROWSIZE  number of observations for this  1:3       ... ...       ...
  TEMP     temperature                      1:11      ... ...       ...
  yes? sh grid temp
     GRID GNN2
  name       axis              # pts   start end                 subset
  OBS       X                   11 r   1 11                  full
  normal    Y
  normal    Z
  normal    T
yes? sh grid rowsize
     GRID GNN1
  name       axis              # pts   start end                 subset
  STATION   X                    3 r   1 3                   full
  normal    Y
  normal    Z
  normal    T


Attachment: ragged.nc
Description: Cdf file

netcdf ragged {
dimensions:
      station = 3 ;
      obs = 11 ;
      name_strlen = 4 ;

   variables:
      float lon(station) ;
          lon:long_name = "station longitude";
          lon:units = "degrees_east";
      float lat(station) ;
          lat:long_name = "station latitude" ;
          lat:units = "degrees_north" ;
      int rowsize(station) ;
          rowsize:long_name = "number of observations for this station" ;
          rowsize:sample_dimension = "obs" ;
      char station_name(station,name_strlen) ;
          station_name:long_name = "station name" ;
          station_name:cf_role = "timeseries_id";
      float temp(obs) ;
          temp:long_name = "temperature" ;
          temp:units = "Celsius" ;
          temp:coordinates = "lat lon" ;
          temp:_FillValue = -999.9;

data:

 lon = 10., 20., 30. ;

 lat = 40., 50., 60. ;

 rowsize = 4, 5, 2 ;

 station_name = "A", "B", "C" ;

 temp = 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11. ;
}

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement