Unidata / siphon

Siphon - A collection of Python utilities for retrieving atmospheric and oceanic data from remote sources, focusing on being able to retrieve data from Unidata data technologies, such as the THREDDS data server.
https://unidata.github.io/siphon
BSD 3-Clause "New" or "Revised" License
212 stars 75 forks source link

Wyoming sounding data to get the Station information and sounding indices #266

Open xigrug opened 5 years ago

xigrug commented 5 years ago

How to get the Station information and sounding indices like

df, header = IGRAUpperAir.request_data(date, station, derived=True)

for Station number: 59280 Observation time: 190530/0000 Station latitude: 23.66 Station longitude: 113.05 Station elevation: 19.0 Showalter index: 1.12 Lifted index: 1.99 LIFT computed using virtual temperature: 2.01 SWEAT index: 227.42 K index: 35.80 Cross totals index: 19.70 Vertical totals index: 20.90 Totals totals index: 40.60 Convective Available Potential Energy: 0.00 CAPE using virtual temperature: 0.00 Convective Inhibition: 0.00 CINS using virtual temperature: 0.00 Bulk Richardson Number: 0.00 Bulk Richardson Number using CAPV: 0.00 Temp [K] of the Lifted Condensation Level: 293.68 Pres [hPa] of the Lifted Condensation Level: 962.59 Mean mixed layer potential temperature: 296.92 Mean mixed layer mixing ratio: 16.09 1000 hPa to 500 hPa thickness: 5777.00 Precipitable water [mm] for entire sounding: 61.63

dopplershift commented 5 years ago

There is not currently a way to do this, since it's unclear to me how to put this information into the same returned DataFrame as the profile data without an exceptional amount of missing data. A PR that manages to do this cleanly (or some other solution) would be welcome. What I don't want to do is bloat the DataFrame or do something like change the API to return multiple values.

eliteuser26 commented 4 years ago

Do you want the indices extracted from the text file or calculated by Metpy.calc? I developed Python code to put some calculated indices in a dataframe for Cape, Cin and Lifted Index from Metpy.

dopplershift commented 4 years ago

@eliteuser26 So how are you incorporating scalar (i.e. singular) values within a dataframe that contains columns of T, Td, etc. that are all indexed on pressure?

eliteuser26 commented 4 years ago

I should have been more clear in my explanation. I have a sounding in a dataframe from Metpy and a separate dataframe for indices. I am able to create a Skewt profile for my website and bring over the dataframe for calculated indices. I couldn't find a way to combine the profile and indices into the same dataframe. That is the question being asked. It needs to be separate.

I don't think it would be difficult to add additional parameters with the indices in the same dataframe. I use dataframes for everything except for things that can't be combined together because of different dimensions.