-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve salinity measurements on multiple heights #31
Comments
59 tasks
There are Hoek van Holland Chlorinity measurements available, and the different heights are available via the "WaarnemingMetadata.BemonsteringshoogteLijst" property: import ddlpy
import matplotlib.pyplot as plt
plt.close("all")
locations = ddlpy.locations()
# bool_stations = locations.index.isin(['HOEKVHLD'])
# bool_stations = locations['Naam'].str.contains("olland")
# historic
bool_stations = locations.index.isin(['HOEKVHLRTOVR']) #contains 3 depths (BemonsteringshoogteLijst)
bool_grootheid = locations['Grootheid.Code'].isin(['CONCTTE'])
bool_hoedanigheid = locations['Hoedanigheid.Code'].isin(['Cl'])
selected = locations.loc[bool_stations & bool_grootheid & bool_hoedanigheid]
# LMW/realtime
# bool_stations = locations.index.isin(['HVH90','HVH45','HVH25'])
# bool_grootheid = locations['Grootheid.Code'].isin(['SALNTT'])
# selected = locations.loc[bool_stations & bool_grootheid]
start_data = "2022-07-01"
end_date = "2022-09-01"
print(f"downloading data for {len(selected)} stations")
for irow, row in selected.iterrows():
last = ddlpy.measurements_latest(selected.iloc[0])
station_code = row.name
print(f"{station_code}: last measurement is {last.index[0]}")
# measurements_latest = ddlpy.measurements_latest(row)
measurements = ddlpy.measurements(row, start_data, end_date, freq=None)
if measurements.empty:
print("[NODATA]")
continue
fig, ax = plt.subplots()
for hoogte in measurements["WaarnemingMetadata.BemonsteringshoogteLijst"].drop_duplicates().values:
sel_bool = measurements["WaarnemingMetadata.BemonsteringshoogteLijst"] == hoogte
measurements_sel = measurements.loc[sel_bool]
measurements_sel.plot(ax=ax, label=hoogte, y='Meetwaarde.Waarde_Numeriek')
ax.legend() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When retrieving salinity measurements for e.g. HOEKVHLD, it is difficult to get data on all the available heights. There are dedicated HVH90/HVH45/HVH25 stations but these seem to contain only realtime information (and only nans). When downloading data for all stations for an arbitrary period, there are only two stations with data:
Gives:
And prints:
The stations with different height notations have the last month/day as last measurements so these seem to be realtime stations. How to get to the rest of the salinity measurements (historic timeseries)?
The text was updated successfully, but these errors were encountered: