[Thread Prev][Thread Next][Index]

[ferret_users] Re: whether it is bug in TDS or in Ferret ?



Hi,
The data in the file is of type SHORT, with scale_factor and add_offset attributes to be applied when the data is loaded.  Ferret does that.

When writing data, by default we write a variable using the same data type it had in the file where it originated, and Ferret SHOULD re-pack the data using the scale attributes. That re-packing step is not being done, and yes this is a bug.

If you explicitly ask for the scale attributes to be written,
yes? set r/x=80E:95E/y=10N:20N/l=11354:11535
yes? set attribute/output sst.scale_factor
yes? set attribute/output sst.add_offst
yes? list/file=sst_new.nc/format=cdf/clobber sst
Now file has been written correctly:
yes? cancel data/all
yes? use sst_new
yes? list/L=1 sst
             VARIABLE : Daily Sea Surface Temperature (degC)
             FILENAME : sst_new.nc
             SUBSET   : 60 by 40 points (LONGITUDE-LATITUDE)
             TIME     : 01-OCT-2012 00:00
      ... listing every   4th point
               80.13E 81.13E 82.13E 83.13E 84.13E 85.13E 86.13E 87.13E 88.13E 89.13E 90.13E 91.13E 92.13E 93.13E 94.13E
                 1      5      9     13     17     21     25     29     33     37     41     45     49     53     57
 19.88N / 40:   ....   ....   ....   ....   ....   ....  29.58  29.11  28.76  29.08  29.25  29.25  29.14  29.28   ....
 19.63N / 39:   ....   ....   ....   ....   ....   ....  29.22  28.86  28.76  29.02  29.20  29.15  29.19  29.26   ....
 19.38N / 38:   ....   ....   ....   ....   ....  29.60  28.93  28.60  28.74  28.89  29.12  29.07  29.18  29.22   ....
 19.13N / 37:   ....   ....   ....   ....   ....  29.45  28.74  28.46  28.71  28.79  29.06  29.04  29.13  29.18   ....
 18.88N / 36:   ....   ....   ....   ....   ....  29.24  28.70  28.46  28.68  28.72  29.02  29.00  29.02  29.17   ....
...
Another workaround would be to ask for the data type to be /FLOAT. 

yes? use "http://www.esrl.noaa.gov/psd/thredds/dodsC/Aggregations/OISSThires/sst.mean.nc"
yes? set r/x=80E:95E/y=10N:20N/l=11354:11535
yes? save/file=sst_2.nc/outtype=float/clobber sst


On 8/22/2013 3:50 AM, Akshay Hegde wrote:
I would be very curious to know why after download all data points are integer,  developers kindly explain the issue

    NOAA/PMEL TMAP
     FERRET v6.842 
     Linux 2.6.18-348.el5PAE 32-bit - 02/01/13
     22-Aug-13 12:26    

listing data without downloading

yes? set data "http://www.esrl.noaa.gov/psd/thredds/dodsC/Aggregations/OISSThires/"
yes? set r/l=11535
yes? list sst
             VARIABLE : Daily Sea Surface Temperature (degC)
             DATA SET : NOAA High-resolution Blended Analysis: Daily Values using AVHRR only
             FILENAME : sst.mean.nc
             FILEPATH : http://www.esrl.noaa.gov/psd/thredds/dodsC/Aggregations/OISSThires/
             SUBSET   : 60 by 40 points (LONGITUDE-LATITUDE)
             TIME     : 31-MAR-2013 00:00
      ... listing every   4th point
                80.13E 81.13E 82.13E 83.13E 84.13E 85.13E 86.13E 87.13E 88.13E 89.13E 90.13E 91.13E 92.13E 93.13E 94.13E
                321    325    329    333    337    341    345    349    353    357    361    365    369    373    377
 19.88N / 440:   ....   ....   ....   ....   ....   ....  27.71  28.01  28.44  28.48  28.35  28.63  28.83  28.77   ....
 19.63N / 439:   ....   ....   ....   ....   ....   ....  28.06  28.22  28.50  28.67  28.54  28.71  28.89  28.74   ....
 19.38N / 438:   ....   ....   ....   ....   ....  27.56  28.32  28.32  28.48  28.77  28.67  28.76  28.86  28.63   ....
 19.13N / 437:   ....   ....   ....   ....   ....  27.93  28.32  28.29  28.39  28.78  28.70  28.77  28.82  28.55   ....
 18.88N / 436:   ....   ....   ....   ....   ....  28.26  28.12  28.17  28.35  28.76  28.64  28.70  28.77  28.53   ....
 18.63N / 435:   ....   ....   ....   ....   ....  28.38  27.90  27.99  28.35  28.67  28.57  28.57  28.68  28.52  29.22
 18.38N / 434:   ....   ....   ....   ....  28.15  28.34  27.86  27.87  28.35  28.59  28.53  28.48  28.59  28.53  29.11
 18.13N / 433:   ....   ....   ....   ....  28.38  28.22  27.93  27.88  28.36  28.55  28.54  28.47  28.56  28.59  28.87


yes? set r/x=80E:95E/y=10N:20N/l=11354:11535
yes? list/file=sst_new.nc/format=cdf sst
LISTing to file sst_new.nc

after download of dataset all data points are integer there is no even single decimal point

listing data after download

yes? set r/l=182
yes? list sst
             VARIABLE : Daily Sea Surface Temperature (degC)
             FILENAME : sst_new.nc
             SUBSET   : 60 by 40 points (LONGITUDE-LATITUDE)
             TIME     : 31-MAR-2013 00:00
      ... listing every   4th point
               80.13E 81.13E 82.13E 83.13E 84.13E 85.13E 86.13E 87.13E 88.13E 89.13E 90.13E 91.13E 92.13E 93.13E 94.13E
                 1      5      9     13     17     21     25     29     33     37     41     45     49     53     57
 19.88N / 40:   ....   ....   ....   ....   ....   ....  27.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00   ....
 19.63N / 39:   ....   ....   ....   ....   ....   ....  28.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00   ....
 19.38N / 38:   ....   ....   ....   ....   ....  27.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00   ....
 19.13N / 37:   ....   ....   ....   ....   ....  27.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00   ....
 18.88N / 36:   ....   ....   ....   ....   ....  28.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00   ....
 18.63N / 35:   ....   ....   ....   ....   ....  28.00  27.00  27.00  28.00  28.00  28.00  28.00  28.00  28.00  29.00
 18.38N / 34:   ....   ....   ....   ....  28.00  28.00  27.00  27.00  28.00  28.00  28.00  28.00  28.00  28.00  29.00
 18.13N / 33:   ....   ....   ....   ....  28.00  28.00  27.00  27.00  28.00  28.00  28.00  28.00  28.00  28.00  28.00


ncdump -h sst_new.nc
netcdf sst_new {
dimensions:
    LON321_380 = 60 ;
    LAT401_440 = 40 ;
    TIME = UNLIMITED ; // (182 currently)
variables:
    float LON321_380(LON321_380) ;
        LON321_380:long_name = "Longitude" ;
        LON321_380:units = "degrees_east" ;
        LON321_380:axis = "X" ;
        LON321_380:modulo = 360.f ;
        LON321_380:point_spacing = "even" ;
        LON321_380:standard_name = "longitude" ;
    float LAT401_440(LAT401_440) ;
        LAT401_440:long_name = "Latitude" ;
        LAT401_440:units = "degrees_north" ;
        LAT401_440:axis = "Y" ;
        LAT401_440:point_spacing = "even" ;
        LAT401_440:standard_name = "latitude" ;
    double TIME(TIME) ;
        TIME:long_name = "Time" ;
        TIME:units = "days since 1800-01-01 00:00:00" ;
        TIME:axis = "T" ;
        TIME:time_origin = "01-JAN-1800 00:00:00" ;
        TIME:standard_name = "time" ;
    short SST(TIME, LAT401_440, LON321_380) ;
        SST:missing_value = 327s ;
        SST:_FillValue = 327s ;
        SST:long_name = "Daily Sea Surface Temperature" ;
        SST:units = "degC" ;
        SST:history = "From sst.mean" ;

// global attributes:
        :history = "FERRET V6.842   20-Aug-13" ;
        :Conventions = "CF-1.0" ;
}


TDS Version: 4.3.17


Regards,

Akshay Hegde,

National Institute of Oceanography,

Dona Paula, Goa







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

Privacy Policy | Disclaimer | Accessibility Statement