MCPcopy Create free account
hub / github.com/NCAR/wrf-python / _find_max_time_size

Function _find_max_time_size

src/wrf/util.py:1103–1128  ·  view source on GitHub ↗

Return the maximum number of times found in a sequence of WRF files. Args: wrfseq (sequence): A sequence of WRF NetCDF file objects. Returns: :obj:`int`: The maximum number of times found in a file.

(wrfseq)

Source from the content-addressed store, hash-verified

1101
1102
1103def _find_max_time_size(wrfseq):
1104 """Return the maximum number of times found in a sequence of
1105 WRF files.
1106
1107 Args:
1108
1109 wrfseq (sequence): A sequence of WRF NetCDF file objects.
1110
1111 Returns:
1112
1113 :obj:`int`: The maximum number of times found in a file.
1114
1115 """
1116 wrf_iter = iter(wrfseq)
1117
1118 max_times = 0
1119 while True:
1120 try:
1121 wrfnc = next(wrf_iter)
1122 except StopIteration:
1123 break
1124 else:
1125 t = extract_dim(wrfnc, "Time")
1126 max_times = t if t >= max_times else max_times
1127
1128 return max_times
1129
1130
1131def _get_coord_names(wrfin, varname):

Callers 1

_join_filesFunction · 0.85

Calls 1

extract_dimFunction · 0.85

Tested by

no test coverage detected