obs4MIPs/obs4MIPs_process.py
def createTime(Handler, rc):
    '''
    InputtimeUnits: specified from resource file or from first file
    in a list of file.
    
    return relative time and time bounds using OutputTimeUnits from
    resource file.
    '''
    # ----------------------------------------------------
    # Retrieve time units from file if not provided in the
    # resource file.
    # ----------------------------------------------------
    InputTimeUnits = Handler.getTimeUnits(rc['InputTimeUnits'])
    
    #  --------------------------------------------------------
    #  Create time relative to January 1st 1900 to facilitate
    #  Threds software file handling.
    #  -------------------------------------------------------

    cur_time = Handler.getTime(InputTimeUnits)
    
    rel_time     =[cur_time[i].torel(rc['OutputTimeUnits']).value  
                   for i in range(len(cur_time))]
    
    if( len(rel_time) == 1 ) :
	deltarel = 1
    else:
       deltarel = rel_time[2] - rel_time[1]

    rel_time_bnds = rel_time[:]
    rel_time_bnds.append(rel_time[-1]+deltarel)
    return rel_time, rel_time_bnds

    InputtimeUnits: specified from resource file or from first file
    in a list of file.
    
    return relative time and time bounds using OutputTimeUnits from
    resource file.
    
specified from resource file or from first file
in a list of file.

return relative time and time bounds using OutputTimeUnits from
resource file.
specified from resource file or from first file in a list of file . return relative time and time bounds using OutputTimeUnits from resource file .
def createTime(Handler, rc):
    InputTimeUnits = Handler.getTimeUnits(rc['InputTimeUnits'])
    cur_time = Handler.getTime(InputTimeUnits)
    rel_time     =[cur_time[i].torel(rc['OutputTimeUnits']).value  
                   for i in range(len(cur_time))]
    if( len(rel_time) == 1 ) :
	deltarel = 1
    else:
       deltarel = rel_time[2] - rel_time[1]
    rel_time_bnds = rel_time[:]
    rel_time_bnds.append(rel_time[-1]+deltarel)
    return rel_time, rel_time_bnds
def createTime ( Handler , rc ) : InputTimeUnits = Handler . getTimeUnits ( rc [ 'InputTimeUnits' ] ) cur_time = Handler . getTime ( InputTimeUnits ) rel_time = [ cur_time [ i ] . torel ( rc [ 'OutputTimeUnits' ] ) . value for i in range ( len ( cur_time ) ) ] if ( len ( rel_time ) == 1 ) : deltarel = 1 else : deltarel = rel_time [ 2 ] - rel_time [ 1 ] rel_time_bnds = rel_time [ : ] rel_time_bnds . append ( rel_time [ - 1 ] + deltarel ) return rel_time , rel_time_bnds
InputtimeUnits: specified from resource file or from first file
in a list of file.
InputtimeUnits : specified from resource file or from first file in a list of file .
'''
    InputtimeUnits: specified from resource file or from first file
    in a list of file.
    
    return relative time and time bounds using OutputTimeUnits from
    resource file.
    ''' # ---------------------------------------------------- # Retrieve time units from file if not provided in the # resource file. # ---------------------------------------------------- #  -------------------------------------------------------- #  Create time relative to January 1st 1900 to facilitate #  Threds software file handling. #  -------------------------------------------------------
Handler
rc