Skip to content

akram-syed/geomhurricane

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppVeyor build status Travis build status lifecycle

Geom for Hurricanes

The purpose of this exercise is to build a new geom using grid and ggplot2 packages to facilitate in visualizing hurricane winds on a map.

Hurricanes

Hurricanes can have asymmetrical wind fields, with much higher winds on one side of a storm compared to the other. Hurricane wind radii report how far winds of a certain intensity (e.g., 34, 50, or 64 knots) extended from a hurricane’s center, with separate values given for the northeast, northwest, southeast, and southwest quadrants of the storm. The 34 knot radius in the northeast quadrant, for example, reports the furthest distance from the center of the storm of any location that experienced 34-knot winds in that quadrant.

This wind radii data provide a clearer picture of the storm structure than the simpler measurements of a storm’s position and maximum winds. For example, if a storm was moving very quickly, the forward motion of the storm might have contributed significantly to wind speeds to the right of the storm’s direction of forward motion, and wind radii might be much larger for the northeast quadrant of the storm than the northwest quadrant.

Data

The aforementioned wind radii are available for Atlantic basin tropical storms since 1988 through the Extended Best Tract dataset maintained by Colorodo State University.

Load Data

One of the functions in this package allow us to import raw Extended Best Track (EBTRK) data. The example data has 29 variables and 11,824 rows. The first few rows of the raw data are displayed below.

storm_id

storm_name

month

day

hour

year

latitude

longitude

max_wind

min_pressure

rad_max_wind

eye_diameter

pressure_1

pressure_2

radius_34_ne

radius_34_se

radius_34_sw

radius_34_nw

radius_50_ne

radius_50_se

radius_50_sw

radius_50_nw

radius_64_ne

radius_64_se

radius_64_sw

radius_64_nw

storm_type

distance_to_land

final

AL0188

ALBERTO

08

05

18

1988

32.0

77.5

20

1015

NA

NA

NA

NA

0

0

0

0

0

0

0

0

0

0

0

0

218

.

AL0188

ALBERTO

08

06

00

1988

32.8

76.2

20

1014

NA

NA

NA

NA

0

0

0

0

0

0

0

0

0

0

0

0

213

.

AL0188

ALBERTO

08

06

06

1988

34.0

75.2

20

1013

NA

NA

NA

NA

0

0

0

0

0

0

0

0

0

0

0

0

149

.

AL0188

ALBERTO

08

06

12

1988

35.2

74.6

25

1012

NA

NA

NA

NA

0

0

0

0

0

0

0

0

0

0

0

0

126

.

AL0188

ALBERTO

08

06

18

1988

37.0

73.5

25

1011

NA

NA

NA

NA

0

0

0

0

0

0

0

0

0

0

0

0

197

.

AL0188

ALBERTO

08

07

00

1988

38.7

72.4

25

1009

NA

NA

NA

NA

0

0

0

0

0

0

0

0

0

0

0

0

193

.

Tidy Data

We also need to “tidy” the data and format it to be used with geom_hurricane. As such, the data_tidy function allows the user to do so. The first few rows of the tidy data are presented below.

storm_id

date

latitude

longitude

wind_speed

ne

se

sw

nw

Alberto-1988

1988-08-05 18:00:00

32.0

-77.5

34

0

0

0

0

Alberto-1988

1988-08-05 18:00:00

32.0

-77.5

50

0

0

0

0

Alberto-1988

1988-08-05 18:00:00

32.0

-77.5

64

0

0

0

0

Alberto-1988

1988-08-06 00:00:00

32.8

-76.2

34

0

0

0

0

Alberto-1988

1988-08-06 00:00:00

32.8

-76.2

50

0

0

0

0

Alberto-1988

1988-08-06 00:00:00

32.8

-76.2

64

0

0

0

0

Select Hurricane

Finally, the data_filter_hurricane function allows the user to select the hurricane that needs to be plotted.

Hurricane names are recycled. Therefore, the user needs to specify the year of the hurricane.

The example below shows the filtered and formatted tidy data for the

storm_id

date

latitude

longitude

wind_speed

ne

se

sw

nw

Katrina-2005

2005-08-25 12:00:00

26.2

-79.0

34

60

60

30

50

Katrina-2005

2005-08-25 18:00:00

26.2

-79.6

34

70

70

50

60

Katrina-2005

2005-08-25 18:00:00

26.2

-79.6

50

25

25

20

20

Katrina-2005

2005-08-26 00:00:00

25.9

-80.3

34

70

70

50

40

Katrina-2005

2005-08-26 00:00:00

25.9

-80.3

50

20

20

20

20

Katrina-2005

2005-08-26 00:00:00

25.9

-80.3

64

10

10

10

10

Examples

Landfall

Hurricane Katrina appeared to make landfall on October 29, 2005 around 6 AM CDT. We will filter the data highlited above and plot the hurricane geom to visualize the wind speeds as it made landfall in Louisiana.

library(ggmap)
get_map("Louisiana", zoom = 6, maptype = "toner-background") %>%
  ggmap(extent = "device") +
  geom_hurricane(data = katrina_lf,
                 aes(x = longitude, y = latitude, 
                     r_ne = ne, r_se = se, r_nw = nw, r_sw = sw,
                     fill = wind_speed, color = wind_speed),
                 alpha = 0.5) + 
  scale_color_manual(name = "Wind speed (kts)", 
                     values = c("red", "orange", "yellow")) + 
  scale_fill_manual(name = "Wind speed (kts)", 
                    values = c("red", "orange", "yellow"))

Hurricane Path

The path of the hurricane can be seen in the animation below.

library(gganimate)
library(gifski)
library(magick)

hurricane_path <- 
    get_map("Jacksonville", zoom = 5, maptype = "hybrid") %>%
    ggmap(extent = "device") +
    geom_hurricane(data = katrina,
                   aes(x = longitude, y = latitude, 
                     r_ne = ne, r_se = se, r_nw = nw, r_sw = sw,
                     fill = wind_speed, color = wind_speed),
                 alpha = 0.5) + 
  scale_color_manual(name = "Wind speed (kts)", 
                     values = c("red", "orange", "yellow")) + 
  scale_fill_manual(name = "Wind speed (kts)", 
                    values = c("red", "orange", "yellow")) +
  transition_time(date) +
  ease_aes('linear')

animate(hurricane_path, renderer = magick_renderer())

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages