NOAA-PMEL / PyFerret

The PyFerret program and Python module from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
58 stars 22 forks source link

Give some info when opening datasets having curvilinear coordinates #135

Closed ACManke closed 1 year ago

ACManke commented 1 year ago

See issue https://github.com/NOAA-PMEL/Ferret/issues/1996 The user is able to open the dataset but does not know how to work with it.

This is something that has been asked occasionally for a long time. When a dataset has "coordinates" attributes, they often point to curvilinear coordinate variables, or possibly other auxiliary variables like a sigma coordinate variable for a vertical coordinate.

PyFerret doesn't do anything to automatically implement operations for auxiliary coordinate variables but has some options when the user knows that's what they're dealing with. To point the user who is just exploring a dataset in the right direction, I suggest it should issue a NOTE on opening the dataset, and on SHOW DATA output. So for instance in the benchmark data directory there's a file my_subset_sivol_SImon_CAMS.nc with a variable with a coordinates attribute

    float sivol(time, j, i) ;
        sivol:standard_name = "sea_ice_thickness" ;
        sivol:units = "m" ;
        sivol:missing_value = 1.e+20f ;
        sivol:_FillValue = 1.e+20f ;
        sivol:coordinates = "latitude longitude" ;

We would see would some notes on opening the dataset and on SHOW DATA:

yes? use data/my_subset_sivol_SImon_CAMS.nc
          *** NOTE:  Dataset variables have Auxiliary or Curvilinear Coordinates. Examine "coordinates" attributes.

yes? show data my_subset_sivol_SImon_CAMS
     currently SET data sets:
    1> data/my_subset_sivol_SImon_CAMS.nc  (default)
 name     title                             I         J         K         L
 LATITUDE latitude                         1:3       1:2       ...       ...
 LONGITUDE
          longitude                        1:3       1:2       ...       ...
 SIVOL    Sea-Ice Volume per Area          1:3       1:2       ...       1:1

--- Dataset variables have Auxiliary or Curvilinear Coordinates. Examine "coordinates" attributes.
ACManke commented 1 year ago

This small addition is finished and is checked into my fork of the code