oceanmodeling / StormEvents

Python interfaces for observational data surrounding named storm events, born from @jreniel's ADCIRCpy
https://stormevents.readthedocs.io
GNU General Public License v3.0
24 stars 8 forks source link

Forecast data for active storm is filtered by `end_date` #57

Open SorooshMani-NOAA opened 2 years ago

SorooshMani-NOAA commented 2 years ago

While one can still use unfiltered_data instead of data this issue results in not being able to get forecast windswath and isotacks for an active storm

SorooshMani-NOAA commented 2 years ago

The data returns

https://github.com/oceanmodeling/StormEvents/blob/c4220ad55cdda2d37ef65709dd4a0a890b950989/stormevents/nhc/track.py#L477-L479

The issue is when creating a StormEvent object, the end_date (which is not available for active storms) is taken from VortexTrack object created ad-hoc by VortexTrack.from_storm_name(...); this track object is based b-deck and doesn't have the latest forecast advisory date. So in the VortexTrack.end_date the unfiltered_data.iloc[-1] returns the latest advisory up to now (best track).

Also it might be better to use

data_start = min(self.unfiltered_data['datetime'].values)
data_end = max(self.unfiltered_data['datetime'].values)

instead of calling iloc with -1 and 0

SorooshMani-NOAA commented 2 years ago

As a workaround (at least in my specific use case) one can start from the VortexTrack object. This is what I was trying to do that failed:

storm = StormEvent('fiona', 2022)
track = storm.track(file_deck='a')
track.wind_swaths(wind_speed=34)

which resulted in up-to-now wind swath only. Instead I can replace it with:

track = VortexTrack.from_storm_name('fiona', 2022, file_deck='a', advisories=['OFCL'])
track.wind_swaths(wind_speed=34)