NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 20 forks source link

SAVE omits _FillValue attribute flagged for output #792

Closed karlmsmith closed 6 years ago

karlmsmith commented 6 years ago

Reported by @AndrewWittenberg on 19 Jul 2007 00:14 UTC SAVE omits the _FillValue attribute from an output variable, despite SHOW DATA/FULL and SHOW ATTRIBUTE/ALL/OUTPUT indicating that this attribute is present, flagged for output, and assigned to be the missing_value. (Note that the original DODS dataset does not have a missing_value attribute.)

As a result, the original variable shows missing values over land when plotted directly from the DODS dataset, while the file copy shows large non-missing scalar values over land.

    NOAA/PMEL TMAP
    FERRET v6.03  
    Linux(g77) 2.4.21-32 - 05/25/07
    18-Jul-07 19:58     

yes? use "http://opendap.aviso.oceanobs.com/thredds/dodsC/hh_msla_oer_merged_h" NOTE: Units on axis "LatLon" are not recognized: count NOTE: They will not be convertible: yes? sho dat/full currently SET data sets: 1> http://opendap.aviso.oceanobs.com/thredds/dodsC/hh_msla_oer_merged_h (default) CALVAL - HH MSLA - T/P-ERS Product - (OER) name title I J K L LATLONMIN Latitude/Longitude of south/oue 1:2 ... ... 1:639 degree on grid GFQ1 with 1.844674E+19 for missing data X=-0.5:1.5
LATLONSTEP latitude/longitude steps 1:2 ... ... 1:639 degree on grid GFQ1 with 1.844674E+19 for missing data X=-0.5:1.5
GRID_0001 H 1:1080 1:915 ... 1:639 cm on grid GFQ2 with 1.844674E+19 for missing data X=0.2W(-0.2):0.2W(359.8) Y=82S:82N

time range: 14-OCT-1992 00:00 to 05-JAN-2005 00:00

yes? save/l=1/file=a.nc grid_0001 LISTing to file a.nc yes? sho att/all/out grid_0001 attributes for dataset: http://opendap.aviso.oceanobs.com/thredds/dodsC/hh_msla_oer _merged_h Grid_0001._FillValue = 1.844674E+19 1 Grid_0001.long_name = H 1 Grid_0001.units = cm 1 yes? sp ncdump -h a.nc netcdf a { dimensions: NBLONGITUDES = 1080 ; NBLATITUDES = 915 ; bnds = 2 ; TIME = UNLIMITED ; // (1 currently) variables: double NBLONGITUDES(NBLONGITUDES) ; NBLONGITUDES:_FillValue = 1.844674407370955e+19 ; NBLONGITUDES:long_name = "Longitudes" ; NBLONGITUDES:units = "degrees_east" ; NBLONGITUDES:modulo = 360. ; NBLONGITUDES:point_spacing = "even" ; NBLONGITUDES:axis = "X" ; double NBLATITUDES(NBLATITUDES) ; NBLATITUDES:_FillValue = 1.844674407370955e+19 ; NBLATITUDES:long_name = "Latitudes" ; NBLATITUDES:units = "degrees_north" ; NBLATITUDES:point_spacing = "uneven" ; NBLATITUDES:axis = "Y" ; NBLATITUDES:bounds = "NBLATITUDES_bnds" ; double NBLATITUDES_bnds(NBLATITUDES, bnds) ; double TIME(TIME) ; TIME:units = "days since 1950-01-01 00:00:00" ; TIME:time_origin = "01-JAN-1950 00:00:00" ; TIME:axis = "T" ; float GRID_0001(TIME, NBLATITUDES, NBLONGITUDES) ; GRID_0001:long_name = "H" ; GRID_0001:units = "cm" ; GRID_0001:history = "From hh_msla_oer_merged_h" ;

// global attributes: :history = "FERRET V6.03 18-Jul-07" ; }

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/1520

karlmsmith commented 6 years ago

Comment by @AnsleyManke on 19 Jul 2007 19:44 UTC This happens when there is a _FillValue attribute but no missing_value attribute for the variable.

The old behavior is restored in v6.04 where both _FillValue and missing_value are written for the variable. Here is first the v5.81 behavior (before attribute-handling changes to Ferret), followed by v6.04 behavior:

-------------- ferret_v581 -------------- NOAA/PMEL TMAP FERRET v5.81
Linux(g77) 2.4.21-32 - 07/13/05 19-Jul-07 12:13

yes? use "http://opendap.aviso.oceanobs.com/thredds/dodsC/hh_msla_oer_merged_h" NOTE: Units on axis "LatLon" are not recognized: count NOTE: They will not be convertible: yes? save/clobber/L=1/i=1:100/file=a.nc grid_0001

LISTing to file a.nc

yes? sp ncdump -h a.nc netcdf a { dimensions: NBLONGITUDES1_100 = 100 ; NBLATITUDES = 915 ; bnds = 2 ; TIME = UNLIMITED ; // (1 currently) variables: double NBLONGITUDES1_100(NBLONGITUDES1_100) ; NBLONGITUDES1_100:units = "degrees_east" ; NBLONGITUDES1_100:modulo = 360. ; NBLONGITUDES1_100:point_spacing = "even" ; NBLONGITUDES1_100:axis = "X" ; double NBLATITUDES(NBLATITUDES) ; NBLATITUDES:units = "degrees_north" ; NBLATITUDES:point_spacing = "uneven" ; NBLATITUDES:axis = "Y" ; NBLATITUDES:bounds = "NBLATITUDES_bnds" ; double NBLATITUDES_bnds(NBLATITUDES, bnds) ; double TIME(TIME) ; TIME:units = "days since 1950-01-01 00:00:00" ; TIME:time_origin = "01-JAN-1950 00:00:00" ; TIME:axis = "T" ; float GRID_0001(TIME, NBLATITUDES, NBLONGITUDES1_100) ; GRID_0001:missing_value = 1.844674e+19f ; GRID_0001:_FillValue = 1.844674e+19f ; GRID_0001:long_name = "H" ; GRID_0001:history = "From hh_msla_oer_merged_h" ; GRID_0001:units = "cm" ;

// global attributes: :history = "FERRET V5.81 19-Jul-07" ; }

-------------- ferret_v604 --------------

    NOAA/PMEL TMAP
    FERRET v6.04  
    Linux(g77) 2.4.21-32 - 07/19/07
    19-Jul-07 12:24     

yes? use "http://opendap.aviso.oceanobs.com/thredds/dodsC/hh_msla_oer_merged_h" NOTE: Units on axis "LatLon" are not recognized: count NOTE: They will not be convertible:
yes? save/clobber/L=1/i=1:100/file=a.nc grid_0001 LISTing to file a.nc yes? sp ncdump -h a.nc netcdf a { dimensions: NBLONGITUDES1_100 = 100 ; NBLATITUDES = 915 ; bnds = 2 ; TIME = UNLIMITED ; // (1 currently) variables: double NBLONGITUDES1_100(NBLONGITUDES1_100) ; NBLONGITUDES1_100:_FillValue = 1.84467440737096e+19 ; NBLONGITUDES1_100:long_name = "Longitudes" ; NBLONGITUDES1_100:units = "degrees_east" ; NBLONGITUDES1_100:modulo = 360. ; NBLONGITUDES1_100:point_spacing = "even" ; NBLONGITUDES1_100:axis = "X" ; double NBLATITUDES(NBLATITUDES) ; NBLATITUDES:_FillValue = 1.84467440737096e+19 ; NBLATITUDES:long_name = "Latitudes" ; NBLATITUDES:units = "degrees_north" ; NBLATITUDES:point_spacing = "uneven" ; NBLATITUDES:axis = "Y" ; NBLATITUDES:bounds = "NBLATITUDES_bnds" ; double NBLATITUDES_bnds(NBLATITUDES, bnds) ; double TIME(TIME) ; TIME:units = "days since 1950-01-01 00:00:00" ; TIME:time_origin = "01-JAN-1950 00:00:00" ; TIME:axis = "T" ; float GRID_0001(TIME, NBLATITUDES, NBLONGITUDES1_100) ; GRID_0001:missing_value = 1.844674e+19f ; GRID_0001:_FillValue = 1.844674e+19f ; GRID_0001:long_name = "H" ; GRID_0001:units = "cm" ; GRID_0001:history = "From hh_msla_oer_merged_h" ;

// global attributes: :history = "FERRET V6.04 19-Jul-07" ; }