Changeset 1673 in lmdz_wrf for trunk/tools/nc_var_tools.py
- Timestamp:
- Dec 4, 2017, 12:02:14 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r1672 r1673 46 46 # compute_tevolboxtraj: Function to compute tevolboxtraj: temporal evolution at a given point along a box following a trajectory 47 47 # compute_tevolboxtraj_radialsec: Function to compute tevolboxtraj_radialsec: temporal evolution at a given point along a number of radii at a given frequency following a trajectory 48 # compute_WRFtime: unction to copmute CFtimes from WRFtime variable 48 49 # curve_section: Function to provide a section of a file following a given curve 49 50 # DataSetSection: Function to get a section (values along a dimension) of a given data-set … … 20662 20663 return 20663 20664 20665 def compute_WRFtime(timewrfv, refdate='19491201000000', tunitsval='minutes'): 20666 """ Function to copmute CFtimes from WRFtime variable 20667 refdate= [YYYYMMDDMIHHSS] format of reference date 20668 tunitsval= CF time units 20669 timewrfv= matrix string values of WRF 'Times' variable 20670 """ 20671 fname = 'compute_WRFtime' 20672 20673 yrref=refdate[0:4] 20674 monref=refdate[4:6] 20675 dayref=refdate[6:8] 20676 horref=refdate[8:10] 20677 minref=refdate[10:12] 20678 secref=refdate[12:14] 20679 20680 refdateS = yrref + '-' + monref + '-' + dayref + ' ' + horref + ':' + minref + \ 20681 ':' + secref 20682 20683 dt = timewrfv.shape[0] 20684 WRFtime = np.zeros((dt), dtype=np.float) 20685 20686 for it in range(dt): 20687 wrfdates = gen.datetimeStr_conversion(timewrfv[it,:],'WRFdatetime', 'matYmdHMS') 20688 WRFtime[it] = gen.realdatetime1_CFcompilant(wrfdates, refdate, tunitsval) 20689 20690 tunits = tunitsval + ' since ' + refdateS 20691 20692 return WRFtime, tunits 20693 20664 20694 #quit()
Note: See TracChangeset
for help on using the changeset viewer.