polaris.mpas.time_index_from_xtime
- polaris.mpas.time_index_from_xtime(xtime, dt_target, start_xtime=None)[source]
Determine the time index closest to the target time
- Parameters:
xtime (numpy.ndarray of numpy.char) – Times in the dataset
dt_target (float) – Time in seconds since the first time in the list of
xtime
valuesstart_xtime (str, optional) – The start time, the first entry in
xtime
by default
- Returns:
time_index (int) – Index in xtime that is closest to dt_target