Commit 63b4fa3f authored by Jared Rennie's avatar Jared Rennie
Browse files

initial commit

parents
ibtracs.py
Written By Jared Rennie, North Carolina Institute for Climate Studies
Plays with NOAA NCEI's IBTRACS dataset, which includes HURDAT2
Requires the following:
- Python 3.8.x
- Pandas 1.1.4
I would suggest using conda to acquire these packages:
- https://docs.conda.io/en/latest/miniconda.html
Command to Run (after installation)
python ibtracs.py
Uses IBTRACS version 4
- Data Source: https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/csv/ibtracs.NA.list.v04r00.csv
- IBTRACS website: https://www.ncdc.noaa.gov/ibtracs/
- Documentation for 163 Headers: https://www.ncdc.noaa.gov/ibtracs/pdf/IBTrACS_v04_column_documentation.pdf
LAT,LON,USA_WIND
25.6000,-74.3000,25
25.6476,-74.6074,25
25.7000,-74.9000,25
25.7700,-75.1651,27
25.9000,-75.4000,30
26.1124,-75.6076,32
26.4000,-75.8000,35
26.7350,-76.0075,37
27.1000,-76.2000,40
27.4574,-76.3502,42
27.8000,-76.5000,45
28.1076,-76.7075,50
28.4000,-76.9000,55
28.6925,-77.0375,60
29.0000,-77.1000,65
29.3350,-77.0727,67
29.7000,-77.0000,70
30.0775,-76.9647,72
30.5000,-76.9000,75
30.9475,-76.7796,77
31.5000,-76.6000,80
32.2049,-76.3870,82
33.0000,-76.1000,85
33.7701,-75.7221,90
34.6000,-75.3000,95
35.4893,-74.9489,97
36.5000,-74.5000,100
37.6485,-73.8076,97
38.9000,-73.0000,95
40.2900,-72.2457,92
41.2000,-71.6000,90
41.4000,-71.4000,85
42.6462,-70.5227,72
43.8000,-69.6000,60
44.1000,-69.1000,60
44.5411,-68.6036,56
45.6000,-67.6000,50
46.3476,-66.6579,47
47.0000,-65.5000,45
47.7019,-63.8118,42
48.4000,-61.9000,40
49.1203,-60.0831,40
49.8000,-58.3000,40
50.3989,-56.5888,40
50.9000,-54.9000,40
51.3055,-53.1994,37
51.6000,-51.4000,35
51.7994,-49.4231,32
51.9000,-47.3000,30
51.9497,-45.0812,30
51.9000,-42.8000,30
51.7568,-40.5290,32
51.5000,-38.3000,35
51.1714,-36.1524,37
50.7000,-34.1000,40
50.0567,-32.1415,40
49.3000,-30.3000,40
48.4975,-28.5426,40
47.7000,-26.9000,40
46.9534,-25.3357,40
46.3000,-23.9000,40
45.7770,-22.5417,37
45.3000,-21.4000,35
44.7563,-20.5012,32
44.2000,-19.9000,30
43.6192,-19.5619,27
43.1000,-19.4000,25
42.6824,-19.2506,25
42.4000,-19.1000,25
42.2550,-18.8652,25
42.2000,-18.6000,25
42.1501,-18.3276,25
42.1000,-18.1000,25
42.0074,-17.9700,25
41.9000,-17.9000,25
41.8150,-17.8501,25
41.7000,-17.8000,25
41.5150,-17.7150,25
41.3000,-17.6000,25
41.0999,-17.4727,25
40.9000,-17.3000,25
40.6923,-17.0876,25
40.5000,-16.8000,25
40.3351,-16.4225,25
40.2000,-16.0000,25
40.0849,-15.6001,22
40.0000,-15.2000,20
39.9350,-14.7851,20
39.9000,-14.4000,20
39.8847,-14.0925,20
39.9000,-13.8000,20
39.9500,-13.4577,20
40.0000,-13.1000,20
40.0075,-12.7424,20
40.0000,-12.4000,20
39.9999,-12.0850,20
40.0000,-11.8000,20
39.9999,-11.5350,17
40.0000,-11.3000,15
39.9999,-11.0925,15
40.0000,-10.9000,15
40.0000,-10.7000,15
40.0000,-10.5000,15
40.0000,-10.2850,12
40.0000,-10.1000,10
40.0000,-9.98000,10
40.0000,-9.90000,10
This source diff could not be displayed because it is too large. You can view the blob instead.
################################################################################
# Written By Jared Rennie, North Carolina Institute for Climate Studies
# Plays with NOAA NCEI's IBTRACS dataset, which includes HURDAT2
#
# Requires the following:
# - Python 3.8.x
# - Pandas 1.1.4
#
# I would suggest using conda to acquire these packages:
# - https://docs.conda.io/en/latest/miniconda.html
#
# Command to Run (after installation)
# python ibtracs.py
#
# Uses IBTRACS version 4
# - From Here: https://www.ncei.noaa.gov/data/international-best-track-archive-for-climate-stewardship-ibtracs/v04r00/access/csv/ibtracs.NA.list.v04r00.csv
################################################################################
########################################
# Import Packages
import pandas as pd
########################################
# Read In IBTRACS File
input_grid='ibtracs.NA.list.v04r00.csv'
print("\n####################\nREAD IN FILE: ",input_grid)
ibtracs_all = pd.read_table(input_grid,delimiter=',',dtype='str',skiprows = [1])
########################################
# Example searches, using headers
# Header definition found in Documentation: https://www.ncdc.noaa.gov/ibtracs/pdf/IBTrACS_v04_column_documentation.pdf
# Get 2020 Data
print("\n####################\nGet 2020 Data")
ibtracs_2020 = ibtracs_all[ibtracs_all['SEASON'] == '2020']
print(ibtracs_2020)
# Get All Hurricanes Names Alpha
print("\n####################\nGet All Hurricanes Names Alpha")
ibtracs_alpha = ibtracs_all[ibtracs_all['NAME'] == 'ALPHA']
print(ibtracs_alpha)
# Get Times Wind Speed > 137 kts (Category 5)
# Need to clean up wind speed first
print("\n####################\nGet Times Wind Speed > 137 kts (Category 5)")
ibtracs_all['USA_WIND']= ibtracs_all['USA_WIND'].replace(' ','-9999').astype('int64')
ibtracs_cat5 = ibtracs_all[ibtracs_all['USA_WIND'] >= 137]
print(ibtracs_cat5)
# Get the names of cat 5 storms
print("\n####################\nGet the names of cat 5 storms")
print(ibtracs_cat5['NAME'].unique())
# Get Data From Hurricane Bob in 1991
print("\n####################\nGet Data From Hurricane Bob in 1991")
ibtracs_bob = ibtracs_all[(ibtracs_all['NAME'] == 'BOB') & (ibtracs_all['SEASON']=='1991')]
print(ibtracs_bob)
# Only Grab Lat/Lon and Wind Speed From Bob (1991)
print("\n####################\nOnly Grab Lat/Lon and Wind Speed From Bob (1991)")
ibtracts_bob_subset=pd.DataFrame([ibtracs_bob.LAT, ibtracs_bob.LON, ibtracs_bob.USA_WIND]).transpose()
print(ibtracts_bob_subset)
# Ouput results to csv
print("\n####################\nOuput results to csv")
outfile='bob_wind.csv'
ibtracts_bob_subset.to_csv(outfile,index=False)
########################################
# Done, End Program
print("\nDONE! results in: "+outfile)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment