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

`datetime` attribute of the advisory track in the written file is different from the retrieved dataframe! #80

Closed FariborzDaneshvar-NOAA closed 1 year ago

FariborzDaneshvar-NOAA commented 1 year ago

I noticed that for a retrieved advisory track (i.e. OFCL) the datetime attribute in the dataframe for a given forecast is equal to the summation datetime for forecast_hours=0, and the forecast_hours. BUT the .to_file() function only writes the first part as the datetime. As a result, several rows will have the same datetime values, but different forecast_hours values (see the screenshots below for florence, 2018). Q#1: Is there any reason for writing the datetime attribute in the file different from how it's been retrieved? Q#2: @pvelissariou1 which format is suitable for PaHM (the actual datetime, OR repeated datetime of forecast_hours=0)?

image

image

pvelissariou1 commented 1 year ago

@Fariborz Daneshvar - NOAA Affiliate @.***> , Fariborz could you please email me the forecast data file? Thanks Takis

Panagiotis Velissariou, Ph.D., P.E. UCAR Scientist National Ocean and Atmospheric Administration National Ocean Service Office of Coast Survey CSDL/CMMB Physical Scientist - Project Lead cell: (205) 227-9141 email: @.***

On Mon, Jun 12, 2023 at 12:04 PM Fariborz Daneshvar < @.***> wrote:

I noticed that for a retrieved advisory track (i.e. OFCL) the datetime attribute in the dataframe for a given forecast is equal to the summation datetime for forecast_hours=0, and the forecast_hours. BUT the .to_file() function only writes the first part as the datetime. As a result, several rows will have the same datetime values, but different forecast_hours values (see the screenshots below for florence, 2018). Is there any reason for writing the datetime attribute in the file different from how it's been retrieved? @pvelissariou1 https://github.com/pvelissariou1 which format is suitable for PaHM (the actual datetime, OR repeated datetime of forecast_hours=0)?

[image: image] https://user-images.githubusercontent.com/132295102/245214235-aa7ddd9b-b078-4ab9-97ba-0e3a1afb8bd5.png

[image: image] https://user-images.githubusercontent.com/132295102/245214529-888f125f-9186-4d32-9b70-1ed5ed013a1b.png

— Reply to this email directly, view it on GitHub https://github.com/oceanmodeling/StormEvents/issues/80, or unsubscribe https://github.com/notifications/unsubscribe-auth/APC7TP2K4TWXQJMJYS2KYMTXK5D3DANCNFSM6AAAAAAZDVK5X4 . You are receiving this because you were mentioned.Message ID: @.***>

FariborzDaneshvar-NOAA commented 1 year ago

Per conversation with @pvelissariou1, here is the response to the second question in the first message.

Q#2: Takis, which format is suitable for PaHM (the actual datetime, OR repeated datetime of forecast_hours=0)?

Response: For the forecast mode, it's been recommended to only use values for forecast_hours=0 and disregard the next forecast_hours (i.e. 3, 12, 24, ...) for a given datetime.

Is there a way to write only the values at the time of zero (something like the following lines) into a file?

AL, 06, 2018083012, 03, OFCL,   0, ... 
AL, 06, 2018083018, 03, OFCL,   0, ... 
AL, 06, 2018083100, 03, OFCL,   0, ...
SorooshMani-NOAA commented 1 year ago

You can get the track dataframe from the track (as you know by track.data) and then filter rows based on forecast hour and advisory, then pass the filtered dataset as storm to create a new VortexTrack. Then using the new one you can call to_file and it should work fine.

SorooshMani-NOAA commented 1 year ago

@FariborzDaneshvar-NOAA can we close this as a duplicate ticket since we're discussing everything related to datetime and formatting on #84 ?

FariborzDaneshvar-NOAA commented 1 year ago

Sure!

FariborzDaneshvar-NOAA commented 1 year ago

The second question was answered (see the note from Takis). See https://github.com/oceanmodeling/StormEvents/issues/84 for the response to the first question.