├── .ipynb_checkpoints └── HURDAT2_processor-checkpoint.ipynb ├── HURDAT2_processor.ipynb ├── HURDAT2_processor.py ├── README.md ├── TM_WORLD_BORDERS-0.3.dbf ├── TM_WORLD_BORDERS-0.3.prj ├── TM_WORLD_BORDERS-0.3.shp ├── TM_WORLD_BORDERS-0.3.shx ├── hur.csv ├── hurdat2-1851-2018-051019.txt ├── hurdat2-format-atlantic.pdf └── plt.png /HURDAT2_processor.py: -------------------------------------------------------------------------------- 1 | """ 2 | 3 | # Best Track Data (HURDAT2) 4 | 5 | Atlantic hurricane database (HURDAT2) 1851-2018 (5.9MB download) 6 | This dataset was provided on 10 May 2019 to include the 2018 update to the best tracks. 7 | 8 | This dataset (known as Atlantic HURDAT2) has a comma-delimited, text format with six-hourly information on the location, maximum winds, central pressure, and (beginning in 2004) size of all known tropical cyclones and subtropical cyclones. The original HURDAT database has been retired. 9 | 10 | Detailed information regarding the Atlantic Hurricane Database Re-analysis Project is available from the Hurricane Research Division. 11 | 12 | ref:https://www.nhc.noaa.gov/data/ 13 | 14 | #https://www.nhc.noaa.gov/data/hurdat/hurdat2-format-atlantic.pdf 15 | # HURDAT2 Processor 16 | 17 | This is a python script that convert your HURDAT to a dataframe and generate a CSV file for you to eaily process this data. This work is part of trajectory segmentation research[1]. We use this dataset for evaluation purposes. If you are going to apply this script please cite to our work. 18 | Thanks. 19 | [1]: Etemad, Mohammad, et al. "A Trajectory Segmentation Algorithm Based on Interpolation-based Change Detection Strategies." EDBT/ICDT Workshops. 2019. 20 | 21 | """ 22 | import pandas as pd 23 | Record_identifier_dic={'C':"Closest approach to a coast, not followed by a landfall" 24 | ,'G':"Genesis" 25 | ,'I':"An intensity peak in terms of both pressure and wind" 26 | ,'L':"Landfall (center of system crossing a coastline)" 27 | ,'P':"Minimum in central pressure" 28 | ,'R':"Provides additional detail on the intensity of the cyclone when rapid changes are underway" 29 | ,'S':"Change of status of the system" 30 | ,'T':"Provides additional detail on the track (position) of the cyclone" 31 | ,'W':"Maximum sustained wind speed"} 32 | Status_of_system_dic={ 33 | 'TD':"Tropical cyclone of tropical depression intensity (< 34 knots)" 34 | ,'TS':"Tropical cyclone of tropical storm intensity (34-63 knots)" 35 | ,'HU':"Tropical cyclone of hurricane intensity (> 64 knots)" 36 | ,'EX':"Extratropical cyclone (of any intensity)" 37 | ,'SD':"Subtropical cyclone of subtropical depression intensity (< 34 knots)" 38 | ,'SS':"Subtropical cyclone of subtropical storm intensity (> 34 knots)" 39 | ,'LO':"A low that is neither a tropical cyclone, a subtropical cyclone, nor an extratropical cyclone (of any intensity)" 40 | ,'WV':"Tropical Wave (of any intensity)" 41 | ,'DB':"Disturbance (of any intensity)"} 42 | 43 | def process_details(data): 44 | data=data.split(',') 45 | Year=int(data[0][0:4]) 46 | Month=int(data[0][4:6]) 47 | Day=int(data[0][6:8]) 48 | Hours_in_UTC=int(data[1][0:2]) 49 | Minutes_in_UTC=int(data[1][2:4]) 50 | Record_identifier=data[2].strip() 51 | try: 52 | Record_identifier_desc=Record_identifier_dic[data[2].strip()] 53 | except: 54 | Record_identifier_desc=None 55 | 56 | Status_of_system=data[3].strip() 57 | try: 58 | Status_of_system_desc=Status_of_system_dic[Status_of_system] 59 | except: 60 | Status_of_system_desc=None 61 | 62 | if data[4].strip()[-1:] in ('N','S'): 63 | if data[4].strip()[-1:]=='N': 64 | Latitude=float(data[4].strip()[:-1]) 65 | else: 66 | Latitude=-1.0*float(data[4].strip()[:-1]) 67 | else: 68 | Latitude=-999 69 | 70 | if data[5].strip()[-1:] in ('E','W'): 71 | if data[5].strip()[-1:]=='E': 72 | Longitude=float(data[5].strip()[:-1]) 73 | else: 74 | Longitude=-1.0*float(data[5].strip()[:-1]) 75 | else: 76 | Longitude=-999 77 | Maximum_sustained_wind_in_knots=float(data[6].strip()) 78 | Minimum_Pressure_in_millibars=float(data[7].strip()) 79 | i=8 80 | F34_kt_wind_radii_maximum_northeastern=float(data[i].strip()) 81 | i+=1 82 | F34_kt_wind_radii_maximum_southeastern=float(data[i].strip()) 83 | i+=1 84 | F34_kt_wind_radii_maximum_southwestern=float(data[i].strip()) 85 | i+=1 86 | F34_kt_wind_radii_maximum_northwestern=float(data[i].strip()) 87 | 88 | 89 | i+=1 90 | F50_kt_wind_radii_maximum_northeastern=float(data[i].strip()) 91 | i+=1 92 | F50_kt_wind_radii_maximum_southeastern=float(data[i].strip()) 93 | i+=1 94 | F50_kt_wind_radii_maximum_southwestern=float(data[i].strip()) 95 | i+=1 96 | F50_kt_wind_radii_maximum_northwestern=float(data[i].strip()) 97 | 98 | i+=1 99 | F64_kt_wind_radii_maximum_northeastern=float(data[i].strip()) 100 | i+=1 101 | F64_kt_wind_radii_maximum_southeastern=float(data[i].strip()) 102 | i+=1 103 | F64_kt_wind_radii_maximum_southwestern=float(data[i].strip()) 104 | i+=1 105 | F64_kt_wind_radii_maximum_northwestern=float(data[i].strip()) 106 | 107 | 108 | 109 | res=Year,Month,Day,Hours_in_UTC,Minutes_in_UTC,Record_identifier,Record_identifier_desc,Status_of_system,Status_of_system_desc,Latitude,Longitude,Maximum_sustained_wind_in_knots,Minimum_Pressure_in_millibars,F34_kt_wind_radii_maximum_northeastern,F34_kt_wind_radii_maximum_southeastern,F34_kt_wind_radii_maximum_southwestern,F34_kt_wind_radii_maximum_northwestern,F50_kt_wind_radii_maximum_northeastern,F50_kt_wind_radii_maximum_southeastern,F50_kt_wind_radii_maximum_southwestern,F50_kt_wind_radii_maximum_northwestern,F64_kt_wind_radii_maximum_northeastern,F64_kt_wind_radii_maximum_southeastern,F64_kt_wind_radii_maximum_southwestern,F64_kt_wind_radii_maximum_northwestern 110 | return res 111 | 112 | def process_header(data): 113 | data=data.split(',') 114 | Basin,ATCF_cyclone_number_for_that_year,Year,Name,Number_of_best_track_entries=data[0][0:2],data[0][2:4],data[0][4:8],data[1].strip(),data[2].strip() 115 | res=Basin,ATCF_cyclone_number_for_that_year,Year,Name,Number_of_best_track_entries 116 | return res 117 | 118 | 119 | def identify_line_type(data): 120 | print(data.split(',')) 121 | if len(data.split(','))>4: 122 | return 2 123 | else: 124 | return 1 125 | def columns_name(): 126 | res=['Basin','ATCF_cyclone_number_for_that_year','Year_','Name', 127 | #'Number_of_best_track_entries', 128 | 'Year','Month','Day','Hours_in_UTC','Minutes_in_UTC', 129 | 'Record_identifier','Record_identifier_desc','Status_of_system','Status_of_system_desc','Latitude','Longitude' 130 | ,'Maximum_sustained_wind_in_knots','Minimum_Pressure_in_millibars','F34_kt_wind_radii_maximum_northeastern', 131 | 'F34_kt_wind_radii_maximum_southeastern','F34_kt_wind_radii_maximum_southwestern', 132 | 'F34_kt_wind_radii_maximum_northwestern','F50_kt_wind_radii_maximum_northeastern', 133 | 'F50_kt_wind_radii_maximum_southeastern','F50_kt_wind_radii_maximum_southwestern', 134 | 'F50_kt_wind_radii_maximum_northwestern','F64_kt_wind_radii_maximum_northeastern', 135 | 'F64_kt_wind_radii_maximum_southeastern','F64_kt_wind_radii_maximum_southwestern', 136 | 'F64_kt_wind_radii_maximum_northwestern'] 137 | return res 138 | 139 | pf=[] 140 | header_fields=[] 141 | filepath = 'hurdat2-1851-2018-051019.txt' 142 | with open(filepath) as fp: 143 | ln = fp.readline() 144 | while ln: 145 | 146 | lt=identify_line_type(ln) 147 | 148 | details=[] 149 | if (lt==1): 150 | header_fields=process_header(ln) 151 | details=[] 152 | else: 153 | details=process_details(ln) 154 | if (details!=[]): 155 | n=list(header_fields[:-1])+list(details) 156 | 157 | pf.append(n) 158 | ln=fp.readline() 159 | 160 | df=pd.DataFrame(pf) 161 | df.columns=columns_name() 162 | df.to_csv('hur.csv') 163 | print(df.shape) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HURDAT2_processor 2 | # Best Track Data (HURDAT2) 3 | 4 | Atlantic hurricane database (HURDAT2) 1851-2018 (5.9MB download) 5 | This dataset was provided on 10 May 2019 to include the 2018 update to the best tracks. 6 | 7 | This dataset (known as Atlantic HURDAT2) has a comma-delimited, text format with six-hourly information on the location, maximum winds, central pressure, and (beginning in 2004) size of all known tropical cyclones and subtropical cyclones. The original HURDAT database has been retired. 8 | 9 | Detailed information regarding the Atlantic Hurricane Database Re-analysis Project is available from the Hurricane Research Division. 10 | 11 | ref:https://www.nhc.noaa.gov/data/ 12 | 13 | #https://www.nhc.noaa.gov/data/hurdat/hurdat2-format-atlantic.pdf 14 | # HURDAT2 Processor 15 | 16 | This is a python script that convert your HURDAT to a dataframe and generate a CSV file for you to eaily process this data. This work is part of trajectory segmentation research[1]. We use this dataset for evaluation purposes. If you are going to apply this script please cite to our work. 17 | Thanks. 18 | 19 | [1]: Etemad, M., Júnior, A. S., Hoseyni, A., Rose, J., & Matwin, S. (2019). A Trajectory Segmentation Algorithm Based on Interpolation-based Change Detection Strategies. In EDBT/ICDT Workshops. 20 | 21 | # visualization of HURDAT2 22 | ![HURDAT2](plt.png) 23 | -------------------------------------------------------------------------------- /TM_WORLD_BORDERS-0.3.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metemaad/HURDAT2_processor/0d0daf857c3adf77f4b523489e7a396c3eee0b5d/TM_WORLD_BORDERS-0.3.dbf -------------------------------------------------------------------------------- /TM_WORLD_BORDERS-0.3.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] -------------------------------------------------------------------------------- /TM_WORLD_BORDERS-0.3.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metemaad/HURDAT2_processor/0d0daf857c3adf77f4b523489e7a396c3eee0b5d/TM_WORLD_BORDERS-0.3.shp -------------------------------------------------------------------------------- /TM_WORLD_BORDERS-0.3.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metemaad/HURDAT2_processor/0d0daf857c3adf77f4b523489e7a396c3eee0b5d/TM_WORLD_BORDERS-0.3.shx -------------------------------------------------------------------------------- /hurdat2-format-atlantic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metemaad/HURDAT2_processor/0d0daf857c3adf77f4b523489e7a396c3eee0b5d/hurdat2-format-atlantic.pdf -------------------------------------------------------------------------------- /plt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metemaad/HURDAT2_processor/0d0daf857c3adf77f4b523489e7a396c3eee0b5d/plt.png --------------------------------------------------------------------------------