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)
| 1101 | |
| 1102 | |
| 1103 | def _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 | |
| 1131 | def _get_coord_names(wrfin, varname): |
no test coverage detected