[ncl-talk] cd_calendar

Dennis Shea shea at ucar.edu
Fri Sep 14 13:03:07 MDT 2018


Cloud-Sat files are HDF4 using the HDF-EOS [*E*arth *O*bserving *S*ystem]
file extension.
Specifically:  *HDFEOSVersion : HDFEOS_V2.5*

*https://www.loc.gov/preservation/digital/formats/fdd/fdd000297.shtml
<https://www.loc.gov/preservation/digital/formats/fdd/fdd000297.shtml>*

It is recommended to use the *.he2 *file extension for all HDF-EOS files.
Why? ... Because NCL recognizes aspects of HDF-EOS formated files and may
add additional 'value-added' information.

It is **user responsibility* *to examine the file for information.

%> *ncl_filedump*  your_CS_file.hdf*.he2*   |  less

========================================================
Cloud-Sat file names start with:

   file_name = "YYYYDDDHHMMSS_*NNNNN*_CS......."

   YYYY => year
   DDD   => day of year
   HH      => hour
   MM     => minute
   SS      => second

   NNNNN => Orbit number
   CS      => CloudSat

You can use a string function (
*http://www.ncl.ucar.edu/Document/Functions/string.shtml*
<http://www.ncl.ucar.edu/Document/Functions/string.shtml> )
to extract YYYY and DDD [eg: *str_get_cols* ]. Use *toint* to convert to
integer.
Then use a date function *(
http://www.ncl.ucar.edu/Document/Functions/date.shtml*
<http://www.ncl.ucar.edu/Document/Functions/date.shtml> )
*http://www.ncl.ucar.edu/Document/Functions/Built-in/monthday.shtml*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/monthday.shtml>

to get the month and day of the month.

or, a file attribute


*start_time_2B_GEOPROF* : 20100508055615
                                               yyyymmddhhmnss

And parse out the desired information.





On Fri, Sep 14, 2018 at 10:56 AM, Adam Phillips <asphilli at ucar.edu> wrote:

> Hi Elham,
> Before posting to ncl-talk about a function please review the
> documentation. As noted in the cd_calendar documentation here:
> https://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml
>
> "Must have a "units" attribute string in the format "units since
> basetime", for example, "days since 1971-1-1" (see examples below)."
>
> Again, please review the documentation page about the function. If you
> have any further questions let the ncl-talk email list know.
> Adam
>
> On Fri, Sep 14, 2018 at 10:51 AM Elham Ghasemifar <
> elham.ghasemifar at modares.ac.ir> wrote:
>
>> Dear colleges
>>
>> can any one help me about cd_calendar, my data is 2b-geoprof (cloudsat)
>> product , i don't know what can i do for plot them:
>>
>>
>>
>> ncl 27>  alt40   = f->Height_2B_GEOPROF
>> ncl 28>  kalt    = dimsizes(alt40)
>> ncl 29>  time    = f->Profile_time_2B_GEOPROF
>> ncl 30>  ntime   = dimsizes(time)
>> ncl 31> yyyymm  = cd_calendar(time,-1)
>> fatal:cd_calendar: no 'units' attribute provided
>> fatal:["Execute.c":8638]:Execute: Error occurred at or near line 31
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> --
> Adam Phillips
> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/   303-497-1726
>
> <http://www.cgd.ucar.edu/staff/asphilli>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180914/25042929/attachment.html>


More information about the ncl-talk mailing list