[ncl-talk] Problem with "cd_calendar"

Amadou Coulibaly mpapin24 at gmail.com
Thu Nov 12 05:39:52 MST 2015


Hi Mary,

After persing into my time array, I got year, month, day, hour, minute. But
what about second since it is not appearing in my timestamp, which is in
format mm/dd/yyyy hh:MM? And how to write time at units since my timestamp
starts on 10/05/2014 06:00:00? And after persing my time I converted year,
day, month, hour, minute into interger as:

  month   = str_get_field(time,1,"/")
  day     = str_get_field(time,2,"/")
  year    = str_get_field(time,3,"/ ")
  hour    = str_get_field(time,2," :")
  minute  = str_get_field(time,3," :")
  second  = str_get_field(time,3," :") ????????

  yyyy = stringtointeger(year)
  mm   = stringtointeger(month)
  dd   = stringtointeger(day)
  hh   = stringtointeger(hour)
  MM   = stringtointeger(minute)
  ss   = stringtointeger(second)???????

  time at units = "hour since 2014-10-05 06:00:00" ????????

  date = cd_inv_calendar(yyyy, mm, dd, hh, MM, ss, time at units, 0)

After this, my variable "date" is just printing out missing values. What's
wrong with that?

Best regards


On 11 November 2015 at 17:01, Mary Haley <haley at ucar.edu> wrote:

> You need to use cd_inv_calendar:
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/cd_inv_calendar.shtml
>
> Some of the examples on the above page should help you.
>
> To get the required year, month, day, hour, minutes, and seconds arrays,
> you will need to parse the "time" array in the same fashion that you parsed
> the CSV file.
>
> For example:
>
>   month = str_get_field(time,1,"/")
>   day   = str_get_field(time,2,"/")
>   year  = str_get_field(time,3,"/ ")  ; note the use of both '/' and ' '
> as delimiters
>
> --Mary
>
> On Wed, Nov 11, 2015 at 8:25 AM, Amadou Coulibaly <mpapin24 at gmail.com>
> wrote:
>
>> Dear NCL users,
>>
>> I am trying to use cd_calendar for my dataset to be able to plot daily
>> timeseries. But I have a problem converting my Timstamp, which is in the
>> format 10/05/2014 06:00:00, mm/dd/yyyy hh:MM:ss. I want to use it in the
>> format time at units = "minuts since 2014-10-05 06:00:00" with dates =
>> cd_calendar(Time, 0) as specifying in my script (readcsv.ncl). Please,
>> find attached a sample of my data and script.
>>
>>
>> How to solve this issue?
>>
>> Best regards
>>
>> --
>> * COULIBALY   AMADOU   *
>> PhD  Student  on  West  African  Climate  System (WACS)
>> FUTA - Federal  University  of  Technology of Akure, Nigeria
>>
>> *Visiting Student - *
>> *University of Cologne, Germany**Institute of Geophysics and Meteorology*
>> Pohligstr. 3 / Office 3.102
>> D-50969 Köln
>>
>> *Project*: WASCAL (West African Science Service Centre on Climate Change
>> and Adapted Land Use)
>> Phone:(+234) 810 795 2836 /(+223) 65 67 27 57 /(+226) 64 57 37 27 /+49
>> 15218352574
>>
>> E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com
>>
>> "*The time is always right to do right": Nelson Mandela*
>>
>> *"Character is like a tree and reputation like a shadow.  The shadow is
>> what we think of it; the tree is the real thing" : Abraham Lincoln*
>>
>> *"Do what you can, with what you have, where you are" Theodore Roosevelt*
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
* COULIBALY   AMADOU   *
PhD  Student  on  West  African  Climate  System (WACS)
FUTA - Federal  University  of  Technology of Akure, Nigeria

*Visiting Student - *
*University of Cologne, Germany**Institute of Geophysics and Meteorology*
Pohligstr. 3 / Office 3.102
D-50969 Köln

*Project*: WASCAL (West African Science Service Centre on Climate Change
and Adapted Land Use)
Phone:(+234) 810 795 2836 /(+223) 65 67 27 57 /(+226) 64 57 37 27 /+49
15218352574

E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com

"*The time is always right to do right": Nelson Mandela*

*"Character is like a tree and reputation like a shadow.  The shadow is
what we think of it; the tree is the real thing" : Abraham Lincoln*

*"Do what you can, with what you have, where you are" Theodore Roosevelt*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151112/54d8e359/attachment.html 


More information about the ncl-talk mailing list