[gradsusr] Uncorrect time value in sdfwrite

Cathy Smith cathy.smith at noaa.gov
Mon May 21 16:14:47 EDT 2018


Hi

The time unit "months since" is not udunits complaint as months vary in 
length. While GrADS is able to handle it, it is not the best idea for 
files that might be read by pretty much all other software.

If you want time steps as months, there are other ways to do this 
(though they do not use udunits).

https://github.com/Unidata/netcdf4-python/issues/434

Cathy Smith


On 5/21/18 1:52 PM, Boyin Huang - NOAA Federal wrote:
> Thanks a lot. It works.
>
> On Mon, May 21, 2018 at 1:42 PM, Andrew Friedman <andfried at gmail.com 
> <mailto:andfried at gmail.com>> wrote:
>
>     Hi Boyin,
>
>     One option is to use the NCO utilities
>     (http://nco.sourceforge.net/nco.html
>     <http://nco.sourceforge.net/nco.html>) to change the starting time
>     and time units.
>
>     Here’s an example of changing time from seconds to minutes, and
>     the starting time to 1979:
>     ncap2 -O -s "time=time/(60)" -s "time at units=\"minutes since
>     1979-01-01 00:00:00\"" $infile $infile
>     [I imagine that for changing from minutes to months you’ll need to
>     use a loop for different lengths of month].
>
>     -Andrew
>
>     > On May 21, 2018, at 4:31 PM, Boyin Huang - NOAA Federal
>     <boyin.huang at noaa.gov <mailto:boyin.huang at noaa.gov>> wrote:
>     >
>     > Hi Jennifer and Andrew,
>     >
>     > Thanks a lot. Indeed, if I write necdf by "set t 1 last", I got
>     the right time values (first value is zero) in unit of minute. The
>     question is whether I can change the unit into "month" instead of
>     minute.
>     >
>     > ​By "set t num", the​ time value is always zero. I hope that I
>     can change the starting time by the attribute setting like this:
>     > 'set sdfattr time char units months since 1854-01-15 00:00:00'
>     > -- 
>     > Boyin Huang, Room-468
>     > NOAA/NCEI/CCOG
>     > Asheville, NC.
>     > 828-271-4851
>
>
>
>
> -- 
> Boyin Huang, Room-468
> NOAA/NCEI/CCOG
> Asheville, NC.
> 828-271-4851
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-- 
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
http://www.esrl.noaa.gov/psd/people/cathy.smith/

Emails about data/webpages may get quicker responses from emailing
esrl.psd.data at noaa.gov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180521/5c7485e1/attachment.html>


More information about the gradsusr mailing list