[ncl-talk] Converting to Python -- sorry for being disloyal

Barry Lynn barry.h.lynn at gmail.com
Tue Feb 27 06:29:34 MST 2024


Hi:

I have a student who must use python.

I've been trying to find out how to extract WRF times in a way that can
be used in python. In the end, we need to format the dates like I already
did (and did for years) in NCL.

times  = wrf_user_getvar(a,"times",-1)


 new_time_units = "hours since 1800-01-01 00:00"

  new_time_units = new_time_units

  new_time_array = cd_inv_calendar( year(it_val),  month(it_val),
day(it_val), \

  hour(it_val), minute(it_val), 0, new_time_units,0)


; print("new_time_array = " + new_time_array)

; format = "" ;; defaults to "%H%M IST %d %c %Y"

  format = "%H%M UTC %d %c %Y"

; format = "%d %c %Y"

  new_time_array = new_time_array  + 0.01

  time_var=cd_string(new_time_array,format)

-- 

Barry H. Lynn, Ph.D
Senior Scientist, Lecturer,
The Institute of Earth Sciences,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

Weather It Is, LTD
Weather and Climate Focus
https://weather-it-is.com <http://weather-it-is.com>
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240227/888585d7/attachment.htm>


More information about the ncl-talk mailing list