[ncl-talk] Issue with cd_calendar

Dennis Shea shea at ucar.edu
Tue May 22 12:31:11 MDT 2018


Glad issue is fixed:


re:

Variable: time (subsection)

Type: double

Dimensions and sizes: [time | 11]

Coordinates:

            time: [525573024.6776075..525573214.5466383]

Number Of Attributes: 4
...

*  comment : seconds since 2000-01-01 00:00:00.0*

*  units : seconds*


============


It looks like the file has the 'units' and 'comment' attributes mixed.
Kinda confusing, really.


   time at units = time at comment   ; assign correct units


==============

D



On Tue, May 22, 2018 at 12:21 PM, Andrew Kren - NOAA Affiliate <
andrew.kren at noaa.gov> wrote:

> Dennis,
> I fixed the issue.  Apparently I had to add units to the time variable
> after reading it in. I was surprised though because the printVarSummary had
> units in it. But when I did the time at units and set it, it worked fine.
>
> Thanks for your help,
>
> On Tue, May 22, 2018 at 11:56 AM, Dennis Shea <shea at ucar.edu> wrote:
>
>> Hi Andrew
>>
>> offline
>>
>> Can u pls send the file? Really, all we need is the 'time' variable.
>>
>> %> ncks -v time Input_File.nc Output_time.nc
>>
>> Likely, you can just attach the 'Output_time.nc' to an email.
>>
>> THX
>> D
>>
>> On Mon, May 21, 2018 at 2:27 PM, Andrew Kren - NOAA Affiliate <
>> andrew.kren at noaa.gov> wrote:
>>
>>> Dear ncl-talk,
>>>
>>> I'm using cd_calendar to convert seconds since 2000 values to UTC dates.
>>> The issue I'm getting is that it is saying the year is 1995, when in
>>> reality it should be 2016. I attached my code. Below shows the
>>> printVarSummary of the time variable in the netcdf files. I can't seem to
>>> find out what is going wrong.
>>>
>>> Variable: time (subsection)
>>>
>>> Type: double
>>>
>>> Total Size: 88 bytes
>>>
>>>             11 values
>>>
>>> Number of Dimensions: 1
>>>
>>> Dimensions and sizes: [time | 11]
>>>
>>> Coordinates:
>>>
>>>             time: [525573024.6776075..525573214.5466383]
>>>
>>> Number Of Attributes: 4
>>>
>>>   long_name : Measurement time
>>>
>>>   scale_factor :   1
>>>
>>>   comment : seconds since 2000-01-01 00:00:00.0
>>>
>>>   units : seconds
>>>
>>> (0) 525573024.6776075
>>>
>>> (1) 525573020.6182248
>>>
>>> (2) 525573013.0496269
>>>
>>> (3) 525573022.4901956
>>>
>>> (4) 525573015.4521056
>>>
>>> (5) 525573007.5407001
>>>
>>> (6) 525572992.1642393
>>>
>>> (7) 525572979.8349053
>>>
>>> (8) 525573218.4769071
>>>
>>> (9) 525573216.6511251
>>>
>>> (10) 525573214.5466383
>>>
>>>
>>> Thanks,
>>>
>>> --
>>> Andrew Kren
>>> Assistant Scientist
>>> CIMAS & NOAA/AOML
>>> 325 Broadway, Boulder, CO 80305
>>> <https://maps.google.com/?q=325+Broadway,+Boulder,+CO+80305&entry=gmail&source=g>
>>> (303) 497-5418
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>
>
> --
> Andrew Kren
> Assistant Scientist
> CIMAS & NOAA/AOML
> 325 Broadway, Boulder, CO 80305
> <https://maps.google.com/?q=325+Broadway,+Boulder,+CO+80305&entry=gmail&source=g>
> (303) 497-5418
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180522/7a71ad21/attachment.html>


More information about the ncl-talk mailing list