...
Read the data into a fieldset variable and extract the point values into a list like this:with code similar to this:
Code Block | ||
---|---|---|
| ||
lat = 51
lon = 1
fs = read("t2m_forecast_24.grib")
vals = nearest_gridpoint(fs, lat, lon)
print(vals) |
This will return a list of values, one for each field.
Now extract the dates and times of the fields and combine them into a list of date variables:
Code Block | ||
---|---|---|
| ||
d = grib_get_long(fs, 'validityDate')
t = grib_get_long(fs, 'validityTime')
dates = d + (t / 24) # ASSUME the times are in hours
print(dates) |
Now construct an Input Visualiser icon which you will drop into the Macro Editor: ensure that the Input X Type is set to type Date and enter some dummy values so that useful Macro code generated. Replace the values of input_date_x_values
and input_y_values
with your lists of data.
Plot the Input Visualiser variable to get your time series plot.