From e1b33a2a9dc46937c9d00c80620928b4bfa6883d Mon Sep 17 00:00:00 2001 From: Zachary Burnett Date: Mon, 19 Apr 2021 18:34:19 -0400 Subject: [PATCH] read `fort.22` from file (#78) * construct `fort.22` with `.join()` * read `fort.22` * add class method as boilerplate for inherited implementations --- adcircpy/forcing/winds/base.py | 6 + adcircpy/forcing/winds/best_track.py | 211 ++++++++++++++---- .../input/test_besttrack/irma2017_fort.22 | 82 +++++++ .../reference/test_besttrack/irma2017_fort.22 | 82 +++++++ tests/test_besttrack.py | 33 +++ 5 files changed, 373 insertions(+), 41 deletions(-) create mode 100644 tests/data/input/test_besttrack/irma2017_fort.22 create mode 100644 tests/data/reference/test_besttrack/irma2017_fort.22 create mode 100644 tests/test_besttrack.py diff --git a/adcircpy/forcing/winds/base.py b/adcircpy/forcing/winds/base.py index 518a94e6..816bf1f4 100644 --- a/adcircpy/forcing/winds/base.py +++ b/adcircpy/forcing/winds/base.py @@ -12,3 +12,9 @@ def __init__(self, nws: int, interval_seconds: int): @abstractmethod def write(self, directory: PathLike, overwrite: bool = False): raise NotImplementedError + + @classmethod + def from_fort22(cls, fort22: PathLike, nws: int = None) -> 'WindForcing': + raise NotImplementedError( + f'reading `fort.22` is not implemented for {cls}' + ) diff --git a/adcircpy/forcing/winds/best_track.py b/adcircpy/forcing/winds/best_track.py index 1c378850..ed7917b4 100644 --- a/adcircpy/forcing/winds/best_track.py +++ b/adcircpy/forcing/winds/best_track.py @@ -1,3 +1,4 @@ +from collections import Collection from datetime import datetime, timedelta from functools import wraps import gzip @@ -7,14 +8,16 @@ from os import PathLike import pathlib import time +from typing import Any import urllib.request from haversine import haversine import matplotlib.pyplot as plt from matplotlib.transforms import Bbox import numpy as np +import pandas from pandas import DataFrame, read_csv -from pyproj import Proj, CRS, Transformer +from pyproj import CRS, Proj, Transformer from shapely import ops from shapely.geometry import Point, Polygon import utm @@ -35,61 +38,82 @@ def __init__(self, storm_id, nws: int = 20, def __str__(self): record_number = self._generate_record_numbers() - fort22 = '' + fort22 = [] for i, (_, row) in enumerate(self.df.iterrows()): - fort22 += f'{row["basin"]:<2},{row["storm_number"]:>3},' \ - f' {row["datetime"]:%Y%m%d%H},' \ - f'{"":3},{row["record_type"]:>5},' \ - f'{int((row["datetime"] - self.start_date) / timedelta(hours=1)):>4},' + line = [] + + line.extend([ + f'{row["basin"]:<2}', + f'{row["storm_number"]:>3}', + f'{row["datetime"]:%Y%m%d%H}', + f'{"":3}', + f'{row["record_type"]:>5}', + f'{convert_value((row["datetime"] - self.start_date) / timedelta(hours=1), int):>4}', + ]) + if row["latitude"] >= 0: - fort22 += f'{int(row["latitude"] / .1):>4}N,' + line.append(f'{convert_value(row["latitude"] / .1, int):>4}N') else: - fort22 += f'{int(row["latitude"] / -.1):>4}S,' + line.append(f'{convert_value(row["latitude"] / -.1, int):>4}S') if row["longitude"] >= 0: - fort22 += f'{int(row["longitude"] / .1):>5}E,' + line.append(f'{convert_value(row["longitude"] / .1, int):>5}E') else: - fort22 += f'{int(row["longitude"] / -.1):>5}W,' - fort22 += f'{int(row["max_sustained_wind_speed"]):>4},' \ - f'{int(row["central_pressure"]):>5},' \ - f'{row["development_level"]:>3},' \ - f'{int(row["isotach"]):>4},' \ - f'{row["quadrant"]:>4},' \ - f'{int(row["radius_for_NEQ"]):>5},' \ - f'{int(row["radius_for_SEQ"]):>5},' \ - f'{int(row["radius_for_SWQ"]):>5},' \ - f'{int(row["radius_for_NWQ"]):>5},' + line.append( + f'{convert_value(row["longitude"] / -.1, int):>5}W') + + line.extend([ + f'{convert_value(row["max_sustained_wind_speed"], int):>4}', + f'{convert_value(row["central_pressure"], int):>5}', + f'{row["development_level"]:>3}', + f'{convert_value(row["isotach"], int):>4}', + f'{row["quadrant"]:>4}', + f'{convert_value(row["radius_for_NEQ"], int):>5}', + f'{convert_value(row["radius_for_SEQ"], int):>5}', + f'{convert_value(row["radius_for_SWQ"], int):>5}', + f'{convert_value(row["radius_for_NWQ"], int):>5}', + ]) + if row["background_pressure"] is None: row["background_pressure"] = \ self.df["background_pressure"].iloc[i - 1] if (row["background_pressure"] <= row["central_pressure"] and 1013 > row["central_pressure"]): - fort22 += f'{1013:>5},' + background_pressure = 1013 elif (row["background_pressure"] <= row["central_pressure"] and 1013 <= row["central_pressure"]): - fort22 += f'{int(row["central_pressure"] + 1):>5},' + background_pressure = convert_value( + row["central_pressure"] + 1, int) else: - fort22 += f'{int(row["background_pressure"]):>5},' - fort22 += f'{int(row["radius_of_last_closed_isobar"]):>5},' \ - f'{int(row["radius_of_maximum_winds"]):>4},' - fort22 += f'{"":>5},' # gust - fort22 += f'{"":>4},' # eye - fort22 += f'{"":>4},' # subregion - fort22 += f'{"":>4},' # maxseas - fort22 += f'{"":>4},' # initials - fort22 += f'{row["direction"]:>3},' \ - f'{row["speed"]:>4},' \ - f'{row["name"]:^12},' + background_pressure = convert_value(row["background_pressure"], + int) + line.append(f'{background_pressure:>5}') + + line.extend([ + f'{convert_value(row["radius_of_last_closed_isobar"], int):>5}', + f'{convert_value(row["radius_of_maximum_winds"], int):>4}', + f'{"":>5}', # gust + f'{"":>4}', # eye + f'{"":>4}', # subregion + f'{"":>4}', # maxseas + f'{"":>4}', # initials + f'{row["direction"]:>3}', + f'{row["speed"]:>4}', + f'{row["name"]:^12}', + ]) + # from this point forwards it's all aswip - fort22 += f'{record_number[i]:>4},' \ - f'\n' - return fort22 + line.append(f'{record_number[i]:>4}') + + fort22.append(','.join(line)) + + return '\n'.join(fort22) def write(self, path: PathLike, overwrite: bool = False): if not isinstance(path, pathlib.Path): path = pathlib.Path(path) if path.exists() and overwrite is False: raise Exception( - 'File exist, set overwrite=True to allow overwrite.') + 'File exist, set overwrite=True to allow overwrite.') with open(path, 'w') as f: f.write(str(self)) @@ -404,14 +428,14 @@ def clip_to_bbox(self, bbox, bbox_crs): ellps={ 'GRS 1980': 'GRS80', 'WGS 84': 'WGS84' - }[df_crs.ellipsoid.name] - ) + }[df_crs.ellipsoid.name] + ) transformer = Transformer.from_crs( - df_crs, utm_crs, always_xy=True) + df_crs, utm_crs, always_xy=True) p = Point(*transformer.transform(lon, lat)) pol = p.buffer(radii) transformer = Transformer.from_crs( - utm_crs, bbox_crs, always_xy=True) + utm_crs, bbox_crs, always_xy=True) pol = ops.transform(transformer.transform, pol) if _switch is True: if not pol.intersects(bbox_pol): @@ -431,7 +455,7 @@ def clip_to_bbox(self, bbox, bbox_crs): if _found_start_date is False: raise Exception( - f'No data within mesh bounding box for storm {self.storm_id}.') + f'No data within mesh bounding box for storm {self.storm_id}.') def plot_track(self, axes=None, show=False, color='k', **kwargs): kwargs.update({'color': color}) @@ -536,6 +560,111 @@ def _compute_velocity(data): int(np.around(bearing, 0))) return data + @classmethod + def from_fort22( + cls, + fort22: PathLike, + nws: int = None, + ) -> 'BestTrackForcing': + if nws is None: + nws = 20 + + try: + with open(fort22) as fort22_file: + fort22 = fort22_file.readlines() + except: + fort22 = str(fort22).splitlines() + + data = { + 'basin': [], + 'storm_number': [], + 'datetime': [], + 'record_type': [], + 'latitude': [], + 'longitude': [], + 'max_sustained_wind_speed': [], + 'central_pressure': [], + 'development_level': [], + 'isotach': [], + 'quadrant': [], + 'radius_for_NEQ': [], + 'radius_for_SEQ': [], + 'radius_for_SWQ': [], + 'radius_for_NWQ': [], + 'background_pressure': [], + 'radius_of_last_closed_isobar': [], + 'radius_of_maximum_winds': [], + 'name': [], + 'direction': [], + 'speed': [], + } + + for index, row in enumerate(fort22): + row = [value.strip() for value in row.split(',')] + + row_data = {key: None for key in data} + + row_data['basin'] = row[0] + row_data['storm_number'] = row[1] + row_data['datetime'] = datetime.strptime(row[2], '%Y%m%d%H') + row_data['record_type'] = row[4] + + latitude = row[6] + if 'N' in latitude: + latitude = float(latitude[:-1]) * 0.1 + elif 'S' in latitude: + latitude = float(latitude[:-1]) * -0.1 + row_data['latitude'] = latitude + + longitude = row[7] + if 'E' in longitude: + longitude = float(longitude[:-1]) * 0.1 + elif 'W' in longitude: + longitude = float(longitude[:-1]) * -0.1 + row_data['longitude'] = longitude + + row_data['max_sustained_wind_speed'] = convert_value(row[8], int) + row_data['central_pressure'] = convert_value(row[9], int) + row_data['development_level'] = row[10] + row_data['isotach'] = convert_value(row[11], int) + row_data['quadrant'] = row[12] + row_data['radius_for_NEQ'] = convert_value(row[13], int) + row_data['radius_for_SEQ'] = convert_value(row[14], int) + row_data['radius_for_SWQ'] = convert_value(row[15], int) + row_data['radius_for_NWQ'] = convert_value(row[16], int) + row_data['background_pressure'] = convert_value(row[17], int) + row_data['radius_of_last_closed_isobar'] = convert_value(row[18], + int) + row_data['radius_of_maximum_winds'] = convert_value(row[19], int) + row_data['direction'] = row[25] + row_data['speed'] = row[26] + row_data['name'] = row[27] + + for key, value in row_data.items(): + if isinstance(data[key], Collection): + data[key].append(value) + elif data[key] is None: + data[key] = value + + storm_id = f'{data["name"][0]}{data["datetime"][0]:%Y}' + + instance = cls( + storm_id=storm_id, + nws=nws, + start_date=min(data['datetime']), + end_date=max(data['datetime']), + ) + + instance.__df = pandas.DataFrame(data=data) + + return instance + + +def convert_value(value: Any, to_type: type) -> Any: + if value is not None and value != '': + value = to_type(value) + return value + def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None): """Retry calling the decorated function using an exponential backoff. diff --git a/tests/data/input/test_besttrack/irma2017_fort.22 b/tests/data/input/test_besttrack/irma2017_fort.22 new file mode 100644 index 00000000..ce9a4e2f --- /dev/null +++ b/tests/data/input/test_besttrack/irma2017_fort.22 @@ -0,0 +1,82 @@ +AL, 11, 2017090500, , BEST, 0, 167N, 551W, 120, 943, , 34, NEQ, 120, 100, 80, 110, 1013, , 15, , , , , ,265, 13, IRMA , 1, 3, 1, 1, 1, 1, 23.5, 20.5, 16.4, 21.8, 1.8509, 1.9037, 1.8969, 1.8876, 1.8998, 125.1433, 125.1433, 125.1433, 125.1433 +AL, 11, 2017090500, , BEST, 0, 167N, 551W, 120, 943, , 50, NEQ, 70, 60, 50, 60, 1013, , 15, , , , , ,265, 13, IRMA , 1, 3, 1, 1, 1, 1, 18.6, 17.2, 14.7, 16.2, 1.8509, 1.8925, 1.8894, 1.8837, 1.8872, 125.1433, 125.1433, 125.1433, 125.1433 +AL, 11, 2017090500, , BEST, 0, 167N, 551W, 120, 943, , 64, NEQ, 40, 35, 30, 35, 1013, , 15, , , , , ,265, 13, IRMA , 1, 3, 1, 1, 1, 1, 13.4, 12.9, 11.5, 12.1, 1.8509, 1.8809, 1.8797, 1.8765, 1.8779, 125.1433, 125.1433, 125.1433, 125.1433 +AL, 11, 2017090506, , BEST, 6, 166N, 564W, 135, 929, , 34, NEQ, 120, 100, 80, 120, 1013, , 15, , , , , ,265, 13, IRMA , 2, 3, 1, 1, 1, 1, 23.1, 19.9, 15.8, 23.6, 1.9806, 2.0291, 2.0224, 2.0139, 2.0303, 141.8100, 141.8100, 141.8100, 141.8100 +AL, 11, 2017090506, , BEST, 6, 166N, 564W, 135, 929, , 50, NEQ, 70, 60, 50, 60, 1013, , 15, , , , , ,265, 13, IRMA , 2, 3, 1, 1, 1, 1, 17.8, 16.2, 13.8, 15.5, 1.9806, 2.0181, 2.0147, 2.0095, 2.0131, 141.8100, 141.8100, 141.8100, 141.8100 +AL, 11, 2017090506, , BEST, 6, 166N, 564W, 135, 929, , 64, NEQ, 40, 35, 30, 35, 1013, , 15, , , , , ,265, 13, IRMA , 2, 3, 1, 1, 1, 1, 12.6, 11.9, 10.5, 11.3, 1.9806, 2.0071, 2.0055, 2.0026, 2.0043, 141.8100, 141.8100, 141.8100, 141.8100 +AL, 11, 2017090512, , BEST, 12, 167N, 578W, 155, 929, , 34, NEQ, 140, 110, 80, 130, 1013, , 15, , , , , ,274, 13, IRMA , 3, 3, 1, 1, 1, 1, 37.6, 29.6, 21.3, 35.2, 2.6375, 2.7290, 2.7096, 2.6892, 2.7233, 163.6431, 163.6431, 163.6431, 163.6431 +AL, 11, 2017090512, , BEST, 12, 167N, 578W, 155, 929, , 50, NEQ, 80, 70, 50, 70, 1013, , 15, , , , , ,274, 13, IRMA , 3, 3, 1, 1, 1, 1, 26.0, 23.5, 16.9, 23.0, 2.6375, 2.7007, 2.6947, 2.6786, 2.6936, 163.6431, 163.6431, 163.6431, 163.6431 +AL, 11, 2017090512, , BEST, 12, 167N, 578W, 155, 929, , 64, NEQ, 50, 40, 30, 40, 1013, , 15, , , , , ,274, 13, IRMA , 3, 3, 1, 1, 1, 1, 18.9, 15.7, 12.1, 15.4, 2.6375, 2.6835, 2.6757, 2.6668, 2.6749, 163.6431, 163.6431, 163.6431, 163.6431 +AL, 11, 2017090518, , BEST, 18, 169N, 592W, 160, 926, , 34, NEQ, 150, 110, 100, 140, 1013, , 15, , , , , ,278, 14, IRMA , 4, 3, 1, 1, 1, 1, 41.5, 30.0, 27.7, 39.1, 2.7211, 2.8231, 2.7950, 2.7892, 2.8173, 169.1583, 169.1583, 169.1583, 169.1583 +AL, 11, 2017090518, , BEST, 18, 169N, 592W, 160, 926, , 50, NEQ, 90, 70, 50, 80, 1013, , 15, , , , , ,278, 14, IRMA , 4, 3, 1, 1, 1, 1, 29.8, 23.7, 17.1, 26.9, 2.7211, 2.7944, 2.7792, 2.7630, 2.7873, 169.1583, 169.1583, 169.1583, 169.1583 +AL, 11, 2017090518, , BEST, 18, 169N, 592W, 160, 926, , 64, NEQ, 50, 45, 35, 50, 1013, , 15, , , , , ,278, 14, IRMA , 4, 3, 1, 1, 1, 1, 19.0, 17.8, 14.1, 19.5, 2.7211, 2.7677, 2.7647, 2.7558, 2.7691, 169.1583, 169.1583, 169.1583, 169.1583 +AL, 11, 2017090600, , BEST, 24, 172N, 604W, 160, 915, , 34, NEQ, 150, 110, 90, 150, 1013, , 15, , , , , ,285, 12, IRMA , 5, 3, 1, 1, 1, 1, 35.5, 25.6, 21.0, 36.5, 2.4355, 2.5148, 2.4926, 2.4824, 2.5170, 169.8532, 169.8532, 169.8532, 169.8532 +AL, 11, 2017090600, , BEST, 24, 172N, 604W, 160, 915, , 50, NEQ, 80, 60, 40, 70, 1013, , 15, , , , , ,285, 12, IRMA , 5, 3, 1, 1, 1, 1, 23.0, 17.5, 11.8, 20.5, 2.4355, 2.4868, 2.4745, 2.4618, 2.4813, 169.8532, 169.8532, 169.8532, 169.8532 +AL, 11, 2017090600, , BEST, 24, 172N, 604W, 160, 915, , 64, NEQ, 45, 40, 30, 45, 1013, , 15, , , , , ,285, 12, IRMA , 5, 3, 1, 1, 1, 1, 15.2, 14.0, 10.8, 15.7, 2.4355, 2.4693, 2.4667, 2.4595, 2.4705, 169.8532, 169.8532, 169.8532, 169.8532 +AL, 11, 2017090606, , BEST, 30, 177N, 619W, 160, 914, , 34, NEQ, 150, 110, 90, 150, 1013, , 15, , , , , ,289, 15, IRMA , 6, 3, 1, 1, 1, 1, 34.4, 24.8, 20.6, 35.7, 2.3734, 2.4510, 2.4293, 2.4198, 2.4539, 168.5277, 168.5277, 168.5277, 168.5277 +AL, 11, 2017090606, , BEST, 30, 177N, 619W, 160, 914, , 50, NEQ, 80, 60, 50, 70, 1013, , 15, , , , , ,289, 15, IRMA , 6, 3, 1, 1, 1, 1, 22.3, 17.0, 14.7, 20.1, 2.3734, 2.4237, 2.4118, 2.4065, 2.4187, 168.5277, 168.5277, 168.5277, 168.5277 +AL, 11, 2017090606, , BEST, 30, 177N, 619W, 160, 914, , 64, NEQ, 45, 40, 30, 45, 1013, , 15, , , , , ,289, 15, IRMA , 6, 3, 1, 1, 1, 1, 14.8, 13.7, 10.7, 15.4, 2.3734, 2.4067, 2.4042, 2.3974, 2.4082, 168.5277, 168.5277, 168.5277, 168.5277 +AL, 11, 2017090612, , BEST, 36, 181N, 633W, 160, 918, , 34, NEQ, 160, 110, 90, 150, 1013, , 15, , , , , ,287, 14, IRMA , 7, 3, 1, 1, 1, 1, 40.0, 26.7, 22.0, 38.2, 2.4877, 2.5841, 2.5519, 2.5406, 2.5796, 169.0151, 169.0151, 169.0151, 169.0151 +AL, 11, 2017090612, , BEST, 36, 181N, 633W, 160, 918, , 50, NEQ, 80, 60, 50, 70, 1013, , 15, , , , , ,287, 14, IRMA , 7, 3, 1, 1, 1, 1, 23.7, 18.1, 15.5, 21.3, 2.4877, 2.5448, 2.5312, 2.5249, 2.5388, 169.0151, 169.0151, 169.0151, 169.0151 +AL, 11, 2017090612, , BEST, 36, 181N, 633W, 160, 918, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,287, 14, IRMA , 7, 3, 1, 1, 1, 1, 15.6, 16.2, 11.1, 16.2, 2.4877, 2.5251, 2.5267, 2.5144, 2.5265, 169.0151, 169.0151, 169.0151, 169.0151 +AL, 11, 2017090618, , BEST, 42, 185N, 647W, 160, 918, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,287, 14, IRMA , 8, 3, 1, 1, 1, 1, 40.2, 29.6, 19.3, 38.4, 2.4880, 2.5869, 2.5608, 2.5355, 2.5824, 169.0267, 169.0267, 169.0267, 169.0267 +AL, 11, 2017090618, , BEST, 42, 185N, 647W, 160, 918, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,287, 14, IRMA , 8, 3, 1, 1, 1, 1, 30.5, 21.4, 15.5, 21.3, 2.4880, 2.5629, 2.5406, 2.5261, 2.5403, 169.0267, 169.0267, 169.0267, 169.0267 +AL, 11, 2017090618, , BEST, 42, 185N, 647W, 160, 918, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,287, 14, IRMA , 8, 3, 1, 1, 1, 1, 15.6, 16.3, 11.1, 16.2, 2.4880, 2.5263, 2.5280, 2.5154, 2.5278, 169.0267, 169.0267, 169.0267, 169.0267 +AL, 11, 2017090700, , BEST, 48, 191N, 660W, 160, 916, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,296, 14, IRMA , 9, 3, 1, 1, 1, 1, 39.3, 28.7, 18.8, 37.7, 2.4389, 2.5366, 2.5103, 2.4856, 2.5326, 169.1022, 169.1022, 169.1022, 169.1022 +AL, 11, 2017090700, , BEST, 48, 191N, 660W, 160, 916, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,296, 14, IRMA , 9, 3, 1, 1, 1, 1, 29.8, 20.8, 15.2, 21.0, 2.4389, 2.5130, 2.4905, 2.4765, 2.4910, 169.1022, 169.1022, 169.1022, 169.1022 +AL, 11, 2017090700, , BEST, 48, 191N, 660W, 160, 916, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,296, 14, IRMA , 9, 3, 1, 1, 1, 1, 15.3, 15.8, 10.9, 16.0, 2.4389, 2.4768, 2.4782, 2.4660, 2.4785, 169.1022, 169.1022, 169.1022, 169.1022 +AL, 11, 2017090706, , BEST, 54, 197N, 677W, 155, 921, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,291, 17, IRMA , 10, 3, 1, 1, 1, 1, 39.0, 28.8, 18.9, 37.6, 2.3668, 2.4680, 2.4413, 2.4157, 2.4641, 162.2347, 162.2347, 162.2347, 162.2347 +AL, 11, 2017090706, , BEST, 54, 197N, 677W, 155, 921, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,291, 17, IRMA , 10, 3, 1, 1, 1, 1, 29.7, 20.9, 15.3, 20.9, 2.3668, 2.4437, 2.4209, 2.4065, 2.4210, 162.2347, 162.2347, 162.2347, 162.2347 +AL, 11, 2017090706, , BEST, 54, 197N, 677W, 155, 921, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,291, 17, IRMA , 10, 3, 1, 1, 1, 1, 15.2, 16.0, 11.1, 16.0, 2.3668, 2.4062, 2.4082, 2.3956, 2.4083, 162.2347, 162.2347, 162.2347, 162.2347 +AL, 11, 2017090712, , BEST, 60, 201N, 690W, 150, 921, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,288, 13, IRMA , 11, 3, 1, 1, 1, 1, 37.5, 27.5, 17.9, 35.9, 2.2542, 2.3509, 2.3250, 2.3002, 2.3467, 158.3261, 158.3261, 158.3261, 158.3261 +AL, 11, 2017090712, , BEST, 60, 201N, 690W, 150, 921, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,288, 13, IRMA , 11, 3, 1, 1, 1, 1, 28.8, 20.2, 14.7, 20.2, 2.2542, 2.3285, 2.3062, 2.2920, 2.3060, 158.3261, 158.3261, 158.3261, 158.3261 +AL, 11, 2017090712, , BEST, 60, 201N, 690W, 150, 921, , 64, NEQ, 50, 50, 30, 50, 1013, , 15, , , , , ,288, 13, IRMA , 11, 3, 1, 1, 1, 1, 16.7, 17.5, 10.7, 17.4, 2.2542, 2.2970, 2.2991, 2.2818, 2.2990, 158.3261, 158.3261, 158.3261, 158.3261 +AL, 11, 2017090718, , BEST, 66, 207N, 704W, 150, 922, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,295, 14, IRMA , 12, 3, 1, 1, 1, 1, 38.0, 27.7, 18.2, 36.6, 2.2609, 2.3624, 2.3350, 2.3093, 2.3586, 157.6996, 157.6996, 157.6996, 157.6996 +AL, 11, 2017090718, , BEST, 66, 207N, 704W, 150, 922, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,295, 14, IRMA , 12, 3, 1, 1, 1, 1, 29.1, 20.3, 14.9, 20.5, 2.2609, 2.3385, 2.3151, 2.3006, 2.3155, 157.6996, 157.6996, 157.6996, 157.6996 +AL, 11, 2017090718, , BEST, 66, 207N, 704W, 150, 922, , 64, NEQ, 60, 40, 30, 50, 1013, , 15, , , , , ,295, 14, IRMA , 12, 3, 1, 1, 1, 1, 20.4, 13.8, 10.9, 17.7, 2.2609, 2.3152, 2.2978, 2.2899, 2.3080, 157.6996, 157.6996, 157.6996, 157.6996 +AL, 11, 2017090800, , BEST, 72, 211N, 718W, 150, 919, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,287, 14, IRMA , 13, 3, 1, 1, 1, 1, 36.5, 26.7, 17.4, 34.9, 2.1970, 2.2934, 2.2675, 2.2428, 2.2892, 157.9968, 157.9968, 157.9968, 157.9968 +AL, 11, 2017090800, , BEST, 72, 211N, 718W, 150, 919, , 50, NEQ, 100, 70, 50, 80, 1013, , 15, , , , , ,287, 14, IRMA , 13, 3, 1, 1, 1, 1, 28.1, 19.7, 14.3, 22.8, 2.1970, 2.2711, 2.2490, 2.2348, 2.2570, 157.9968, 157.9968, 157.9968, 157.9968 +AL, 11, 2017090800, , BEST, 72, 211N, 718W, 150, 919, , 64, NEQ, 60, 45, 30, 55, 1013, , 15, , , , , ,287, 14, IRMA , 13, 3, 1, 1, 1, 1, 19.7, 15.3, 10.5, 18.8, 2.1970, 2.2491, 2.2373, 2.2247, 2.2466, 157.9968, 157.9968, 157.9968, 157.9968 +AL, 11, 2017090806, , BEST, 78, 215N, 732W, 140, 925, , 34, NEQ, 160, 120, 80, 150, 1013, , 30, , , , , ,287, 14, IRMA , 14, 3, 1, 1, 1, 1, 34.7, 25.5, 16.6, 33.4, 2.0287, 2.1215, 2.0967, 2.0728, 2.1179, 146.8991, 146.8991, 146.8991, 146.8991 +AL, 11, 2017090806, , BEST, 78, 215N, 732W, 140, 925, , 50, NEQ, 100, 70, 50, 80, 1013, , 30, , , , , ,287, 14, IRMA , 14, 3, 1, 1, 1, 1, 27.2, 19.2, 14.0, 22.1, 2.0287, 2.1013, 2.0798, 2.0661, 2.0877, 146.8991, 146.8991, 146.8991, 146.8991 +AL, 11, 2017090806, , BEST, 78, 215N, 732W, 140, 925, , 64, NEQ, 60, 45, 35, 55, 1013, , 30, , , , , ,287, 14, IRMA , 14, 3, 1, 1, 1, 1, 19.4, 15.1, 12.3, 18.6, 2.0287, 2.0805, 2.0690, 2.0616, 2.0784, 146.8991, 146.8991, 146.8991, 146.8991 +AL, 11, 2017090812, , BEST, 84, 218N, 747W, 130, 927, , 34, NEQ, 160, 120, 80, 150, 1013, , 30, , , , , ,282, 14, IRMA , 15, 3, 1, 1, 1, 1, 30.2, 22.4, 14.5, 29.2, 1.7674, 1.8447, 1.8245, 1.8044, 1.8420, 135.5431, 135.5431, 135.5431, 135.5431 +AL, 11, 2017090812, , BEST, 84, 218N, 747W, 130, 927, , 50, NEQ, 100, 90, 50, 80, 1013, , 30, , , , , ,282, 14, IRMA , 15, 3, 1, 1, 1, 1, 24.6, 23.4, 12.9, 20.0, 1.7674, 1.8301, 1.8271, 1.8003, 1.8185, 135.5431, 135.5431, 135.5431, 135.5431 +AL, 11, 2017090812, , BEST, 84, 218N, 747W, 130, 927, , 64, NEQ, 60, 45, 35, 55, 1013, , 30, , , , , ,282, 14, IRMA , 15, 3, 1, 1, 1, 1, 18.0, 14.3, 11.8, 17.4, 1.7674, 1.8134, 1.8039, 1.7975, 1.8118, 135.5431, 135.5431, 135.5431, 135.5431 +AL, 11, 2017090818, , BEST, 90, 220N, 760W, 135, 925, , 34, NEQ, 160, 120, 80, 150, 1013, , 30, , , , , ,279, 12, IRMA , 16, 3, 1, 1, 1, 1, 32.5, 23.9, 15.4, 31.1, 1.8936, 1.9794, 1.9566, 1.9340, 1.9755, 141.9213, 141.9213, 141.9213, 141.9213 +AL, 11, 2017090818, , BEST, 90, 220N, 760W, 135, 925, , 50, NEQ, 100, 90, 50, 80, 1013, , 30, , , , , ,279, 12, IRMA , 16, 3, 1, 1, 1, 1, 25.9, 24.4, 13.3, 20.9, 1.8936, 1.9618, 1.9579, 1.9285, 1.9486, 141.9213, 141.9213, 141.9213, 141.9213 +AL, 11, 2017090818, , BEST, 90, 220N, 760W, 135, 925, , 64, NEQ, 60, 60, 30, 60, 1013, , 30, , , , , ,279, 12, IRMA , 16, 3, 1, 1, 1, 1, 18.7, 20.0, 10.1, 19.6, 1.8936, 1.9428, 1.9464, 1.9202, 1.9452, 141.9213, 141.9213, 141.9213, 141.9213 +AL, 11, 2017090900, , BEST, 96, 221N, 772W, 140, 924, , 34, NEQ, 160, 120, 80, 150, 1013, , 20, , , , , ,275, 11, IRMA , 17, 3, 1, 1, 1, 1, 35.1, 25.8, 16.4, 33.3, 2.0341, 2.1299, 2.1043, 2.0788, 2.1248, 147.9252, 147.9252, 147.9252, 147.9252 +AL, 11, 2017090900, , BEST, 96, 221N, 772W, 140, 924, , 50, NEQ, 100, 90, 50, 80, 1013, , 20, , , , , ,275, 11, IRMA , 17, 3, 1, 1, 1, 1, 27.4, 25.7, 13.9, 21.9, 2.0341, 2.1089, 2.1041, 2.0718, 2.0938, 147.9252, 147.9252, 147.9252, 147.9252 +AL, 11, 2017090900, , BEST, 96, 221N, 772W, 140, 924, , 64, NEQ, 60, 60, 30, 60, 1013, , 20, , , , , ,275, 11, IRMA , 17, 3, 1, 1, 1, 1, 19.5, 20.8, 10.3, 20.2, 2.0341, 2.0873, 2.0906, 2.0622, 2.0891, 147.9252, 147.9252, 147.9252, 147.9252 +AL, 11, 2017090906, , BEST, 102, 223N, 783W, 140, 930, , 34, NEQ, 160, 160, 120, 170, 1013, , 15, , , , , ,281, 10, IRMA , 18, 3, 1, 1, 1, 1, 39.4, 40.9, 29.7, 43.7, 2.1912, 2.3077, 2.3123, 2.2790, 2.3205, 148.2690, 148.2690, 148.2690, 148.2690 +AL, 11, 2017090906, , BEST, 102, 223N, 783W, 140, 930, , 50, NEQ, 100, 90, 50, 80, 1013, , 15, , , , , ,281, 10, IRMA , 18, 3, 1, 1, 1, 1, 30.2, 28.0, 15.2, 24.2, 2.1912, 2.2804, 2.2739, 2.2360, 2.2627, 148.2690, 148.2690, 148.2690, 148.2690 +AL, 11, 2017090906, , BEST, 102, 223N, 783W, 140, 930, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,281, 10, IRMA , 18, 3, 1, 1, 1, 1, 21.2, 22.3, 11.1, 22.0, 2.1912, 2.2538, 2.2570, 2.2241, 2.2561, 148.2690, 148.2690, 148.2690, 148.2690 +AL, 11, 2017090912, , BEST, 108, 227N, 793W, 115, 941, , 34, NEQ, 160, 160, 120, 170, 1013, , 15, , , , , ,293, 10, IRMA , 19, 3, 1, 1, 1, 1, 32.4, 34.0, 25.1, 37.1, 1.6720, 1.7637, 1.7685, 1.7429, 1.7773, 120.6298, 120.6298, 120.6298, 120.6298 +AL, 11, 2017090912, , BEST, 108, 227N, 793W, 115, 941, , 50, NEQ, 100, 90, 50, 80, 1013, , 15, , , , , ,293, 10, IRMA , 19, 3, 1, 1, 1, 1, 26.7, 25.0, 13.9, 22.0, 1.6720, 1.7475, 1.7427, 1.7111, 1.7341, 120.6298, 120.6298, 120.6298, 120.6298 +AL, 11, 2017090912, , BEST, 108, 227N, 793W, 115, 941, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,293, 10, IRMA , 19, 3, 1, 1, 1, 1, 19.9, 21.3, 11.0, 21.5, 1.6720, 1.7282, 1.7322, 1.7031, 1.7327, 120.6298, 120.6298, 120.6298, 120.6298 +AL, 11, 2017090918, , BEST, 114, 231N, 802W, 110, 938, , 34, NEQ, 160, 160, 120, 170, 1013, , 15, , , , , ,296, 9, IRMA , 20, 3, 1, 1, 1, 1, 27.7, 29.2, 21.5, 32.1, 1.4707, 1.5440, 1.5481, 1.5276, 1.5560, 115.4663, 115.4663, 115.4663, 115.4663 +AL, 11, 2017090918, , BEST, 114, 231N, 802W, 110, 938, , 50, NEQ, 100, 90, 50, 80, 1013, , 15, , , , , ,296, 9, IRMA , 20, 3, 1, 1, 1, 1, 23.8, 22.3, 12.4, 19.7, 1.4707, 1.5336, 1.5297, 1.5034, 1.5228, 115.4663, 115.4663, 115.4663, 115.4663 +AL, 11, 2017090918, , BEST, 114, 231N, 802W, 110, 938, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,296, 9, IRMA , 20, 3, 1, 1, 1, 1, 18.4, 19.8, 10.3, 20.1, 1.4707, 1.5192, 1.5229, 1.4979, 1.5238, 115.4663, 115.4663, 115.4663, 115.4663 +AL, 11, 2017091000, , BEST, 120, 234N, 809W, 105, 932, , 34, NEQ, 170, 170, 120, 180, 1013, , 15, , , , , ,295, 7, IRMA , 21, 3, 1, 1, 1, 1, 24.0, 25.5, 17.0, 28.0, 1.2569, 1.3144, 1.3178, 1.2973, 1.3239, 110.9320, 110.9320, 110.9320, 110.9320 +AL, 11, 2017091000, , BEST, 120, 234N, 809W, 105, 932, , 50, NEQ, 100, 100, 50, 80, 1013, , 15, , , , , ,295, 7, IRMA , 21, 3, 1, 1, 1, 1, 20.2, 21.6, 10.4, 16.6, 1.2569, 1.3050, 1.3084, 1.2816, 1.2965, 110.9320, 110.9320, 110.9320, 110.9320 +AL, 11, 2017091000, , BEST, 120, 234N, 809W, 105, 932, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,295, 7, IRMA , 21, 3, 1, 1, 1, 1, 16.4, 17.7, 9.2, 18.0, 1.2569, 1.2959, 1.2991, 1.2788, 1.2998, 110.9320, 110.9320, 110.9320, 110.9320 +AL, 11, 2017091006, , BEST, 126, 237N, 813W, 115, 930, , 34, NEQ, 190, 170, 140, 190, 1013, , 10, , , , , ,309, 5, IRMA , 22, 3, 1, 1, 1, 1, 34.9, 30.6, 24.7, 36.5, 1.5162, 1.6076, 1.5962, 1.5809, 1.6119, 123.3320, 123.3320, 123.3320, 123.3320 +AL, 11, 2017091006, , BEST, 126, 237N, 813W, 115, 930, , 50, NEQ, 110, 110, 70, 100, 1013, , 10, , , , , ,309, 5, IRMA , 22, 3, 1, 1, 1, 1, 26.3, 26.9, 16.7, 24.7, 1.5162, 1.5848, 1.5866, 1.5597, 1.5808, 123.3320, 123.3320, 123.3320, 123.3320 +AL, 11, 2017091006, , BEST, 126, 237N, 813W, 115, 930, , 64, NEQ, 70, 50, 30, 50, 1013, , 10, , , , , ,309, 5, IRMA , 22, 3, 1, 1, 1, 1, 21.2, 15.0, 9.3, 15.5, 1.5162, 1.5716, 1.5553, 1.5403, 1.5567, 123.3320, 123.3320, 123.3320, 123.3320 +AL, 11, 2017091012, , BEST, 132, 245N, 815W, 115, 931, , 34, NEQ, 190, 170, 140, 190, 1013, , 10, , , , , ,347, 8, IRMA , 23, 3, 1, 1, 1, 1, 35.1, 29.6, 24.5, 37.9, 1.4892, 1.5841, 1.5691, 1.5553, 1.5916, 121.4938, 121.4938, 121.4938, 121.4938 +AL, 11, 2017091012, , BEST, 132, 245N, 815W, 115, 931, , 50, NEQ, 110, 110, 70, 100, 1013, , 10, , , , , ,347, 8, IRMA , 23, 3, 1, 1, 1, 1, 26.5, 26.0, 16.6, 25.8, 1.4892, 1.5606, 1.5593, 1.5337, 1.5588, 121.4938, 121.4938, 121.4938, 121.4938 +AL, 11, 2017091012, , BEST, 132, 245N, 815W, 115, 931, , 64, NEQ, 70, 50, 30, 50, 1013, , 10, , , , , ,347, 8, IRMA , 23, 3, 1, 1, 1, 1, 21.5, 14.4, 9.2, 16.4, 1.4892, 1.5470, 1.5279, 1.5139, 1.5332, 121.4938, 121.4938, 121.4938, 121.4938 +AL, 11, 2017091018, , BEST, 138, 256N, 817W, 100, 936, , 34, NEQ, 190, 170, 140, 190, 1013, , 15, , , , , ,351, 11, IRMA , 24, 3, 1, 1, 1, 1, 28.6, 23.3, 20.1, 32.9, 1.1507, 1.2241, 1.2104, 1.2022, 1.2354, 103.4889, 103.4889, 103.4889, 103.4889 +AL, 11, 2017091018, , BEST, 138, 256N, 817W, 100, 936, , 50, NEQ, 100, 100, 70, 100, 1013, , 15, , , , , ,351, 11, IRMA , 24, 3, 1, 1, 1, 1, 20.8, 19.9, 15.1, 24.8, 1.1507, 1.2039, 1.2017, 1.1892, 1.2143, 103.4889, 103.4889, 103.4889, 103.4889 +AL, 11, 2017091018, , BEST, 138, 256N, 817W, 100, 936, , 64, NEQ, 70, 60, 30, 50, 1013, , 15, , , , , ,351, 11, IRMA , 24, 3, 1, 1, 1, 1, 20.9, 16.6, 9.3, 17.5, 1.1507, 1.2042, 1.1931, 1.1744, 1.1954, 103.4889, 103.4889, 103.4889, 103.4889 +AL, 11, 2017091100, , BEST, 144, 268N, 817W, 90, 942, , 34, NEQ, 360, 200, 150, 240, 1013, , 15, , , , , , 0, 12, IRMA , 25, 3, 1, 1, 1, 1, 81.6, 27.9, 21.0, 48.8, 0.9866, 1.2051, 1.0594, 1.0412, 1.1158, 92.0159, 92.0159, 92.0159, 92.0159 +AL, 11, 2017091100, , BEST, 144, 268N, 817W, 90, 942, , 50, NEQ, 140, 140, 90, 120, 1013, , 15, , , , , , 0, 12, IRMA , 25, 3, 1, 1, 1, 1, 34.1, 31.2, 21.1, 34.8, 0.9866, 1.0761, 1.0684, 1.0415, 1.0779, 92.0159, 92.0159, 92.0159, 92.0159 +AL, 11, 2017091100, , BEST, 144, 268N, 817W, 90, 942, , 64, NEQ, 70, 60, 30, 50, 1013, , 15, , , , , , 0, 12, IRMA , 25, 3, 1, 1, 1, 1, 23.6, 17.5, 10.5, 21.8, 0.9866, 1.0480, 1.0319, 1.0135, 1.0431, 92.0159, 92.0159, 92.0159, 92.0159 +AL, 11, 2017091106, , BEST, 150, 282N, 822W, 75, 961, , 34, NEQ, 360, 230, 150, 240, 1013, , 20, , , , , ,342, 15, IRMA , 26, 3, 1, 1, 1, 1, 106.0, 47.4, 31.7, 70.4, 0.8775, 1.2126, 1.0248, 0.9748, 1.0986, 74.2659, 74.2659, 74.2659, 74.2659 +AL, 11, 2017091106, , BEST, 150, 282N, 822W, 75, 961, , 50, NEQ, 140, 140, 90, 120, 1013, , 20, , , , , ,342, 15, IRMA , 26, 3, 1, 1, 1, 1, 46.6, 44.7, 36.8, 56.9, 0.8775, 1.0221, 1.0161, 0.9911, 1.0552, 74.2659, 74.2659, 74.2659, 74.2659 +AL, 11, 2017091106, , BEST, 150, 282N, 822W, 75, 961, , 64, NEQ, 30, 30, 20, 50, 1013, , 20, , , , , ,342, 15, IRMA , 26, 3, 1, 1, 1, 1, 13.9, 12.9, 20.0, 50.0, 0.8775, 0.9193, 0.9164, 1.0337, 1.0839, 74.2659, 74.2659, 78.0985, 76.2557 +AL, 11, 2017091112, , BEST, 156, 296N, 827W, 60, 970, , 34, NEQ, 360, 230, 150, 240, 1013, , 40, , , , , ,343, 15, IRMA , 27, 2, 1, 1, 1, 1, 130.6, 57.6, 46.9, 104.5, 0.6385, 1.0651, 0.8257, 0.7897, 0.9809, 57.6060, 57.6060, 57.6060, 57.6060 +AL, 11, 2017091112, , BEST, 156, 296N, 827W, 60, 970, , 50, NEQ, 140, 140, 90, 120, 1013, , 40, , , , , ,343, 15, IRMA , 27, 2, 1, 1, 1, 1, 73.8, 68.5, 90.0, 120.0, 0.6385, 0.8800, 0.8622, 1.0601, 1.1129, 57.6060, 57.6060, 62.4439, 60.6426 +AL, 11, 2017091118, , BEST, 162, 309N, 835W, 45, 980, , 34, NEQ, 360, 230, 150, 240, 1013, , 60, , , , , ,332, 15, IRMA , 28, 1, 1, 1, 1, 1, 196.4, 105.7, 150.0, 240.0, 0.4197, 1.0686, 0.7884, 1.0628, 1.1997, 40.9182, 40.9182, 45.6436, 41.0333 +AL, 11, 2017091200, , BEST, 168, 319N, 844W, 40, 986, , 34, NEQ, 360, 300, 0, 0, 1013, , 60, , , , , ,322, 13, IRMA , 29, 1, 1, 1, 1, 1, 244.8, 218.0, 72.3, 72.3, 0.4017, 1.2747, 1.1898, 0.6899, 0.6899, 36.2070, 36.2070, 36.2070, 36.2070 diff --git a/tests/data/reference/test_besttrack/irma2017_fort.22 b/tests/data/reference/test_besttrack/irma2017_fort.22 new file mode 100644 index 00000000..f6f6f9ef --- /dev/null +++ b/tests/data/reference/test_besttrack/irma2017_fort.22 @@ -0,0 +1,82 @@ +AL, 11,2017090500, , BEST, 0, 166N, 551W, 120, 943, , 34, NEQ, 120, 100, 80, 110, 1013, , 15, , , , , ,265, 13, IRMA , 1 +AL, 11,2017090500, , BEST, 0, 166N, 551W, 120, 943, , 50, NEQ, 70, 60, 50, 60, 1013, , 15, , , , , ,265, 13, IRMA , 1 +AL, 11,2017090500, , BEST, 0, 166N, 551W, 120, 943, , 64, NEQ, 40, 35, 30, 35, 1013, , 15, , , , , ,265, 13, IRMA , 1 +AL, 11,2017090506, , BEST, 6, 166N, 564W, 135, 929, , 34, NEQ, 120, 100, 80, 120, 1013, , 15, , , , , ,265, 13, IRMA , 2 +AL, 11,2017090506, , BEST, 6, 166N, 564W, 135, 929, , 50, NEQ, 70, 60, 50, 60, 1013, , 15, , , , , ,265, 13, IRMA , 2 +AL, 11,2017090506, , BEST, 6, 166N, 564W, 135, 929, , 64, NEQ, 40, 35, 30, 35, 1013, , 15, , , , , ,265, 13, IRMA , 2 +AL, 11,2017090512, , BEST, 12, 166N, 578W, 155, 929, , 34, NEQ, 140, 110, 80, 130, 1013, , 15, , , , , ,274, 13, IRMA , 3 +AL, 11,2017090512, , BEST, 12, 166N, 578W, 155, 929, , 50, NEQ, 80, 70, 50, 70, 1013, , 15, , , , , ,274, 13, IRMA , 3 +AL, 11,2017090512, , BEST, 12, 166N, 578W, 155, 929, , 64, NEQ, 50, 40, 30, 40, 1013, , 15, , , , , ,274, 13, IRMA , 3 +AL, 11,2017090518, , BEST, 18, 169N, 592W, 160, 926, , 34, NEQ, 150, 110, 100, 140, 1013, , 15, , , , , ,278, 14, IRMA , 4 +AL, 11,2017090518, , BEST, 18, 169N, 592W, 160, 926, , 50, NEQ, 90, 70, 50, 80, 1013, , 15, , , , , ,278, 14, IRMA , 4 +AL, 11,2017090518, , BEST, 18, 169N, 592W, 160, 926, , 64, NEQ, 50, 45, 35, 50, 1013, , 15, , , , , ,278, 14, IRMA , 4 +AL, 11,2017090600, , BEST, 24, 171N, 604W, 160, 915, , 34, NEQ, 150, 110, 90, 150, 1013, , 15, , , , , ,285, 12, IRMA , 5 +AL, 11,2017090600, , BEST, 24, 171N, 604W, 160, 915, , 50, NEQ, 80, 60, 40, 70, 1013, , 15, , , , , ,285, 12, IRMA , 5 +AL, 11,2017090600, , BEST, 24, 171N, 604W, 160, 915, , 64, NEQ, 45, 40, 30, 45, 1013, , 15, , , , , ,285, 12, IRMA , 5 +AL, 11,2017090606, , BEST, 30, 176N, 619W, 160, 914, , 34, NEQ, 150, 110, 90, 150, 1013, , 15, , , , , ,289, 15, IRMA , 6 +AL, 11,2017090606, , BEST, 30, 176N, 619W, 160, 914, , 50, NEQ, 80, 60, 50, 70, 1013, , 15, , , , , ,289, 15, IRMA , 6 +AL, 11,2017090606, , BEST, 30, 176N, 619W, 160, 914, , 64, NEQ, 45, 40, 30, 45, 1013, , 15, , , , , ,289, 15, IRMA , 6 +AL, 11,2017090612, , BEST, 36, 181N, 633W, 160, 918, , 34, NEQ, 160, 110, 90, 150, 1013, , 15, , , , , ,287, 14, IRMA , 7 +AL, 11,2017090612, , BEST, 36, 181N, 633W, 160, 918, , 50, NEQ, 80, 60, 50, 70, 1013, , 15, , , , , ,287, 14, IRMA , 7 +AL, 11,2017090612, , BEST, 36, 181N, 633W, 160, 918, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,287, 14, IRMA , 7 +AL, 11,2017090618, , BEST, 42, 185N, 647W, 160, 918, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,287, 14, IRMA , 8 +AL, 11,2017090618, , BEST, 42, 185N, 647W, 160, 918, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,287, 14, IRMA , 8 +AL, 11,2017090618, , BEST, 42, 185N, 647W, 160, 918, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,287, 14, IRMA , 8 +AL, 11,2017090700, , BEST, 48, 191N, 660W, 160, 916, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,296, 14, IRMA , 9 +AL, 11,2017090700, , BEST, 48, 191N, 660W, 160, 916, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,296, 14, IRMA , 9 +AL, 11,2017090700, , BEST, 48, 191N, 660W, 160, 916, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,296, 14, IRMA , 9 +AL, 11,2017090706, , BEST, 54, 197N, 677W, 155, 921, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,291, 17, IRMA , 10 +AL, 11,2017090706, , BEST, 54, 197N, 677W, 155, 921, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,291, 17, IRMA , 10 +AL, 11,2017090706, , BEST, 54, 197N, 677W, 155, 921, , 64, NEQ, 45, 45, 30, 45, 1013, , 15, , , , , ,291, 17, IRMA , 10 +AL, 11,2017090712, , BEST, 60, 201N, 690W, 150, 921, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,288, 13, IRMA , 11 +AL, 11,2017090712, , BEST, 60, 201N, 690W, 150, 921, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,288, 13, IRMA , 11 +AL, 11,2017090712, , BEST, 60, 201N, 690W, 150, 921, , 64, NEQ, 50, 50, 30, 50, 1013, , 15, , , , , ,288, 13, IRMA , 11 +AL, 11,2017090718, , BEST, 66, 207N, 704W, 150, 922, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,295, 14, IRMA , 12 +AL, 11,2017090718, , BEST, 66, 207N, 704W, 150, 922, , 50, NEQ, 100, 70, 50, 70, 1013, , 15, , , , , ,295, 14, IRMA , 12 +AL, 11,2017090718, , BEST, 66, 207N, 704W, 150, 922, , 64, NEQ, 60, 40, 30, 50, 1013, , 15, , , , , ,295, 14, IRMA , 12 +AL, 11,2017090800, , BEST, 72, 211N, 717W, 150, 919, , 34, NEQ, 160, 120, 80, 150, 1013, , 15, , , , , ,287, 14, IRMA , 13 +AL, 11,2017090800, , BEST, 72, 211N, 717W, 150, 919, , 50, NEQ, 100, 70, 50, 80, 1013, , 15, , , , , ,287, 14, IRMA , 13 +AL, 11,2017090800, , BEST, 72, 211N, 717W, 150, 919, , 64, NEQ, 60, 45, 30, 55, 1013, , 15, , , , , ,287, 14, IRMA , 13 +AL, 11,2017090806, , BEST, 78, 215N, 732W, 140, 925, , 34, NEQ, 160, 120, 80, 150, 1013, , 30, , , , , ,287, 14, IRMA , 14 +AL, 11,2017090806, , BEST, 78, 215N, 732W, 140, 925, , 50, NEQ, 100, 70, 50, 80, 1013, , 30, , , , , ,287, 14, IRMA , 14 +AL, 11,2017090806, , BEST, 78, 215N, 732W, 140, 925, , 64, NEQ, 60, 45, 35, 55, 1013, , 30, , , , , ,287, 14, IRMA , 14 +AL, 11,2017090812, , BEST, 84, 218N, 747W, 130, 927, , 34, NEQ, 160, 120, 80, 150, 1013, , 30, , , , , ,282, 14, IRMA , 15 +AL, 11,2017090812, , BEST, 84, 218N, 747W, 130, 927, , 50, NEQ, 100, 90, 50, 80, 1013, , 30, , , , , ,282, 14, IRMA , 15 +AL, 11,2017090812, , BEST, 84, 218N, 747W, 130, 927, , 64, NEQ, 60, 45, 35, 55, 1013, , 30, , , , , ,282, 14, IRMA , 15 +AL, 11,2017090818, , BEST, 90, 220N, 760W, 135, 925, , 34, NEQ, 160, 120, 80, 150, 1013, , 30, , , , , ,279, 12, IRMA , 16 +AL, 11,2017090818, , BEST, 90, 220N, 760W, 135, 925, , 50, NEQ, 100, 90, 50, 80, 1013, , 30, , , , , ,279, 12, IRMA , 16 +AL, 11,2017090818, , BEST, 90, 220N, 760W, 135, 925, , 64, NEQ, 60, 60, 30, 60, 1013, , 30, , , , , ,279, 12, IRMA , 16 +AL, 11,2017090900, , BEST, 96, 221N, 772W, 140, 924, , 34, NEQ, 160, 120, 80, 150, 1013, , 20, , , , , ,275, 11, IRMA , 17 +AL, 11,2017090900, , BEST, 96, 221N, 772W, 140, 924, , 50, NEQ, 100, 90, 50, 80, 1013, , 20, , , , , ,275, 11, IRMA , 17 +AL, 11,2017090900, , BEST, 96, 221N, 772W, 140, 924, , 64, NEQ, 60, 60, 30, 60, 1013, , 20, , , , , ,275, 11, IRMA , 17 +AL, 11,2017090906, , BEST, 102, 223N, 783W, 140, 930, , 34, NEQ, 160, 160, 120, 170, 1013, , 15, , , , , ,281, 10, IRMA , 18 +AL, 11,2017090906, , BEST, 102, 223N, 783W, 140, 930, , 50, NEQ, 100, 90, 50, 80, 1013, , 15, , , , , ,281, 10, IRMA , 18 +AL, 11,2017090906, , BEST, 102, 223N, 783W, 140, 930, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,281, 10, IRMA , 18 +AL, 11,2017090912, , BEST, 108, 227N, 793W, 115, 941, , 34, NEQ, 160, 160, 120, 170, 1013, , 15, , , , , ,293, 10, IRMA , 19 +AL, 11,2017090912, , BEST, 108, 227N, 793W, 115, 941, , 50, NEQ, 100, 90, 50, 80, 1013, , 15, , , , , ,293, 10, IRMA , 19 +AL, 11,2017090912, , BEST, 108, 227N, 793W, 115, 941, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,293, 10, IRMA , 19 +AL, 11,2017090918, , BEST, 114, 231N, 802W, 110, 938, , 34, NEQ, 160, 160, 120, 170, 1013, , 15, , , , , ,296, 9, IRMA , 20 +AL, 11,2017090918, , BEST, 114, 231N, 802W, 110, 938, , 50, NEQ, 100, 90, 50, 80, 1013, , 15, , , , , ,296, 9, IRMA , 20 +AL, 11,2017090918, , BEST, 114, 231N, 802W, 110, 938, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,296, 9, IRMA , 20 +AL, 11,2017091000, , BEST, 120, 234N, 809W, 105, 932, , 34, NEQ, 170, 170, 120, 180, 1013, , 15, , , , , ,295, 7, IRMA , 21 +AL, 11,2017091000, , BEST, 120, 234N, 809W, 105, 932, , 50, NEQ, 100, 100, 50, 80, 1013, , 15, , , , , ,295, 7, IRMA , 21 +AL, 11,2017091000, , BEST, 120, 234N, 809W, 105, 932, , 64, NEQ, 60, 60, 30, 60, 1013, , 15, , , , , ,295, 7, IRMA , 21 +AL, 11,2017091006, , BEST, 126, 237N, 813W, 115, 930, , 34, NEQ, 190, 170, 140, 190, 1013, , 10, , , , , ,309, 5, IRMA , 22 +AL, 11,2017091006, , BEST, 126, 237N, 813W, 115, 930, , 50, NEQ, 110, 110, 70, 100, 1013, , 10, , , , , ,309, 5, IRMA , 22 +AL, 11,2017091006, , BEST, 126, 237N, 813W, 115, 930, , 64, NEQ, 70, 50, 30, 50, 1013, , 10, , , , , ,309, 5, IRMA , 22 +AL, 11,2017091012, , BEST, 132, 245N, 815W, 115, 931, , 34, NEQ, 190, 170, 140, 190, 1013, , 10, , , , , ,347, 8, IRMA , 23 +AL, 11,2017091012, , BEST, 132, 245N, 815W, 115, 931, , 50, NEQ, 110, 110, 70, 100, 1013, , 10, , , , , ,347, 8, IRMA , 23 +AL, 11,2017091012, , BEST, 132, 245N, 815W, 115, 931, , 64, NEQ, 70, 50, 30, 50, 1013, , 10, , , , , ,347, 8, IRMA , 23 +AL, 11,2017091018, , BEST, 138, 256N, 817W, 100, 936, , 34, NEQ, 190, 170, 140, 190, 1013, , 15, , , , , ,351, 11, IRMA , 24 +AL, 11,2017091018, , BEST, 138, 256N, 817W, 100, 936, , 50, NEQ, 100, 100, 70, 100, 1013, , 15, , , , , ,351, 11, IRMA , 24 +AL, 11,2017091018, , BEST, 138, 256N, 817W, 100, 936, , 64, NEQ, 70, 60, 30, 50, 1013, , 15, , , , , ,351, 11, IRMA , 24 +AL, 11,2017091100, , BEST, 144, 268N, 817W, 90, 942, , 34, NEQ, 360, 200, 150, 240, 1013, , 15, , , , , , 0, 12, IRMA , 25 +AL, 11,2017091100, , BEST, 144, 268N, 817W, 90, 942, , 50, NEQ, 140, 140, 90, 120, 1013, , 15, , , , , , 0, 12, IRMA , 25 +AL, 11,2017091100, , BEST, 144, 268N, 817W, 90, 942, , 64, NEQ, 70, 60, 30, 50, 1013, , 15, , , , , , 0, 12, IRMA , 25 +AL, 11,2017091106, , BEST, 150, 282N, 822W, 75, 961, , 34, NEQ, 360, 230, 150, 240, 1013, , 20, , , , , ,342, 15, IRMA , 26 +AL, 11,2017091106, , BEST, 150, 282N, 822W, 75, 961, , 50, NEQ, 140, 140, 90, 120, 1013, , 20, , , , , ,342, 15, IRMA , 26 +AL, 11,2017091106, , BEST, 150, 282N, 822W, 75, 961, , 64, NEQ, 30, 30, 20, 50, 1013, , 20, , , , , ,342, 15, IRMA , 26 +AL, 11,2017091112, , BEST, 156, 296N, 827W, 60, 970, , 34, NEQ, 360, 230, 150, 240, 1013, , 40, , , , , ,343, 15, IRMA , 27 +AL, 11,2017091112, , BEST, 156, 296N, 827W, 60, 970, , 50, NEQ, 140, 140, 90, 120, 1013, , 40, , , , , ,343, 15, IRMA , 27 +AL, 11,2017091118, , BEST, 162, 309N, 835W, 45, 980, , 34, NEQ, 360, 230, 150, 240, 1013, , 60, , , , , ,332, 15, IRMA , 28 +AL, 11,2017091200, , BEST, 168, 319N, 844W, 40, 986, , 34, NEQ, 360, 300, 0, 0, 1013, , 60, , , , , ,322, 13, IRMA , 29 \ No newline at end of file diff --git a/tests/test_besttrack.py b/tests/test_besttrack.py new file mode 100644 index 00000000..5ebd3cf3 --- /dev/null +++ b/tests/test_besttrack.py @@ -0,0 +1,33 @@ +from pathlib import Path +import unittest + +from adcircpy.forcing.winds import BestTrackForcing + +DATA_DIRECTORY = Path(__file__).parent / 'data' +INPUT_DIRECTORY = DATA_DIRECTORY / 'input' +OUTPUT_DIRECTORY = DATA_DIRECTORY / 'output' +REFERENCE_DIRECTORY = DATA_DIRECTORY / 'reference' + + +class TestBestTrack(unittest.TestCase): + def test_from_fort22(self): + input_filename = INPUT_DIRECTORY / 'test_besttrack' / 'irma2017_fort.22' + output_filename = OUTPUT_DIRECTORY / 'test_besttrack' / 'irma2017_fort.22' + reference_filename = REFERENCE_DIRECTORY / 'test_besttrack' / 'irma2017_fort.22' + + if not output_filename.parent.exists(): + output_filename.parent.mkdir(parents=True, exist_ok=True) + + best_track = BestTrackForcing.from_fort22( + fort22=input_filename, + nws=20, + ) + + assert best_track.storm_id == 'AL112017' + assert best_track.name == 'IRMA' + + best_track.write(output_filename, overwrite=True) + + with open(output_filename) as test_file: + with open(reference_filename) as reference_file: + assert test_file.read() == reference_file.read()