[Thread Prev][Thread Next][Index]

Re: [ferret_users] Error when subsetting NetCDF file



Hi ,

Nancy and I looked at this and it turns out that the file uses an INT64 data type to store the time coordinates.  That's very slightly non-standard, as INT64 is a type not listed in the CF standard. We will be able to add it to the types that PyFerret (and Ferret) recognizes.  That will be in a future PyFerret release.

Meanwhile, we can redefine the time axis within the PyFerret session, so PyFerret will write it out ok, and without changing any of the time information. DEFINE AXIS/LIKE= gets the time origin and units from the original axis and t[gt=time] will use the same coordinates.  It just makes it a Ferret-defined axis rather than an axis from the file.

yes? define axis/t/like=time time = t[gt=time]
Replacing definition of axis TIME
           *** NOTE: grid GON1 used by data set bsose_i001_2013to2017_monthly_Salt
           *** NOTE: Redefinition may alter apparent contents of data set
...

There may be more lines of ***NOTE  as the definition of the axis "time" from the file is being changed for all of the grids in the file.  Again this is happening just in the session, making new definition of what PyFerret is going to use for the time axis of the variable.

-Ansley


On 11/28/2018 9:47 AM, Nancy Williams - NOAA Affiliate wrote:
Hello All,

I am trying to subset a large NetCDF file to sample only monthly surface salinity values for 2013-2017 using the following code but am getting a NetCDF error.  Please let me know if you have any suggestions.

Thanks,
Nancy Williams

williams% pyferret

  NOAA/PMEL TMAP

  PyFerret v7.42 (optimized)

  Darwin 14.5.0 - 08/01/18

  27-Nov-18 15:35     


yes? set memory/size=1000

yes? use bsose_i001_2013to2017_monthly_Salt.nc

           *** NOTE: Internal err: unknown data type

           *** NOTE: Axis coordinates are decreasing-ordered. Reversing ordering for axis Z

yes? show data

     currently SET data sets:

    1> ./bsose_i001_2013to2017_monthly_Salt.nc  (default)

 name     title                                                     L

 ITER     model timestep number            ...       ...       ...       1:60

 DEPTH    ocean depth                      1:2160    1:586     ...       ...

 RA       cell area                        1:2160    1:586     ...       ...

 DRF      cell z size                      ...       ...       1:52      ...

 HFACC    vertical fraction of open cell   1:2160    1:586     1:52      ...

 SALT     Salinity                         1:2160    1:586     1:52      1:60

 

yes? let S=SALT[k=52]

yes? show var

 Created by DEFINE VARIABLE:

 >>> Definitions that replace any file variable of same name:

     S = SALT[K=52]

yes? save/clobber/file="BSOSE20132017.nc" S

 LISTing to file BSOSE20132017.nc

NetCDF: Not a valid data type or _FillValue type mismatch (OPeNDAP/netCDF Error code -45)

 Failed creating coord variable TIME

yes? 


--
Nancy L. Williams
NRC Postdoctoral Fellow
NOAA Pacific Marine Environmental Laboratory
nancy.williams@xxxxxxxx

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

Privacy Policy | Disclaimer | Accessibility Statement