Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6daae1e
Add a load_parquet function with unit tests.
gavinevans Oct 11, 2021
6c8bd74
Modifications to functions required to support converting tabular dat…
gavinevans Oct 11, 2021
b254f8b
Addition of a CLI and illustrative acceptance tests, although these a…
gavinevans Oct 11, 2021
258a6a7
Minor edits to load_parquet functionality.
gavinevans Oct 11, 2021
4d347ef
Modifications to the columns expected within the truth table.
gavinevans Oct 11, 2021
be1d606
Add edit to doc/source/conf.py.
gavinevans Oct 11, 2021
a730c5c
Extend docstring.
gavinevans Oct 11, 2021
979790a
Modify environments in preparation for changes required for ingestion…
gavinevans Oct 1, 2021
719b787
Modify environments in preparation for changes required for ingestion…
gavinevans Oct 1, 2021
2ce0318
Merge branch 'improver1538_load_parquet' into improver1538_tabular_in…
gavinevans Oct 11, 2021
b830db5
Merge branch 'improver1538_tabular_ingestion_functions' into improver…
gavinevans Oct 11, 2021
df0e171
Modifications to functions required to support converting tabular dat…
gavinevans Oct 11, 2021
344d29d
Modifications to the columns expected within the truth table.
gavinevans Oct 11, 2021
0177a77
Edits to expect the period column to be a timedelta64 dtype.
gavinevans Oct 12, 2021
85ca5ea
Modify environments in preparation for changes required for ingestion…
gavinevans Oct 1, 2021
bf1023d
Merge remote-tracking branch 'upstream/master' into improver1538_tabu…
gavinevans Oct 12, 2021
719ca4c
Merge branch 'improver1538_tabular_ingestion_functions' into improver…
gavinevans Oct 12, 2021
645df69
Current state.
gavinevans Oct 12, 2021
25005bb
Edits to expect the period column to be a timedelta64 dtype.
gavinevans Oct 12, 2021
a637cdd
Merge branch 'improver1538_tabular_ingestion_functions' into improver…
gavinevans Oct 12, 2021
55bec1d
Corrections to __init__.py
gavinevans Oct 12, 2021
da0f48b
Updates to CLI acceptance tests.
gavinevans Oct 12, 2021
820546e
Corrections to __init__.py
gavinevans Oct 12, 2021
e35453c
Modifications to use assertCubeEqual to ensure the full cubes are com…
gavinevans Oct 12, 2021
e4fd9b6
Merge branch 'improver1538_tabular_ingestion_functions' into improver…
gavinevans Oct 12, 2021
1deceeb
Update checksums.
gavinevans Oct 12, 2021
d0d43dd
Correction to the CLI docstring.
gavinevans Oct 12, 2021
8974924
Modifications following review comments.
gavinevans Oct 14, 2021
36411f6
Minor updates to docstrings.
gavinevans Oct 14, 2021
af51ed4
Add missing unit tests.
gavinevans Oct 14, 2021
96f243b
Correction to csv files.
gavinevans Oct 14, 2021
606ac81
Sort lists.
gavinevans Oct 14, 2021
2757be1
Minor docstring amendment.
gavinevans Oct 14, 2021
8773766
Merge branch 'improver1538_tabular_ingestion_functions' into improver…
gavinevans Oct 14, 2021
6b2ab0f
NOT WORKING: Working commit to try to avoid using the truth altitude,…
gavinevans Oct 14, 2021
5192f8a
Extend docstrings.
gavinevans Oct 15, 2021
81877cc
Extended documentation updates.
gavinevans Oct 15, 2021
2ccebbb
Refinement and addition of tests for column name checking.
gavinevans Oct 15, 2021
e1a762c
Modifications to tidy up dataframe preparation.
gavinevans Oct 15, 2021
25dce2d
Minor extended documentation edits.
gavinevans Oct 15, 2021
ec04f89
Further minor docstring edit.
gavinevans Oct 15, 2021
88ab030
Merge branch 'improver1538_tabular_ingestion_functions' into improver…
gavinevans Oct 18, 2021
bb654ea
Latest edits
gavinevans Oct 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@
"https://scitools.org.uk/cf-units/docs/latest/": None,
"https://docs.scipy.org/doc/numpy/": None,
"https://docs.scipy.org/doc/scipy/reference/": None,
"https://pandas.pydata.org/pandas-docs/dev/": None,
}

# Get napoleon to document constructor methods.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#######################################
Ingestion of DataFrames into iris cubes
#######################################

DataFrames of the forecasts and truths (observations) can be provided
for use with Ensemble Model Output Statistics (EMOS). The format
expected for the forecast and truths DataFrames is described below.
The forecasts are ensemble site forecasts in percentile format at
a set of observation sites. The truths are observations from
observation sites.

****************************
Forecast DataFrame
****************************

The forecast DataFrame is expected to contain the following compulsory
columns: forecast, blend_time, forecast_period, forecast_reference_time,
time, wmo_id, percentile, diagnostic, latitude, longitude, period, height,
cf_name and units. Other columns will be ignored.

A summary of the expected contents of a forecast table is shown below.

.. csv-table::
:file: ./forecast_dataframe_metadata_info.csv
:widths: 25, 22, 53
:header-rows: 1

An example forecast table for an instantaneous diagnostic is shown below.

.. csv-table::
:file: ./forecast_dataframe_instantaneous_example.csv
:header-rows: 1

An example forecast table for a period diagnostic is shown below.

.. csv-table::
:file: ./forecast_dataframe_period_example.csv
:header-rows: 1

****************************
Truth DataFrame
****************************

The truth DataFrame is expected to contain the following compulsory
columns: ob_value, time, wmo_id, diagnostic, latitude, longitude and
altitude. Other columns will be ignored.

A summary of the expected contents of a truth table is shown below.

.. csv-table::
:file: ./truth_dataframe_metadata_info.csv
:widths: 30, 30, 40
:header-rows: 1

An example truth table is shown below.

.. csv-table::
:file: ./truth_dataframe_example.csv
:header-rows: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
index,forecast,altitude,blend_time,forecast_period,forecast_reference_time,latitude,longitude,time,wmo_id,cf_name,units,percentile,period,height,diagnostic
0,282.69,15,2021-08-01 18:00:00+00:00,1 days,2021-08-01 18:00:00+00:00,60,-5,2021-08-02 18:00:00+00:00,03001,air_temperature,K,5,NaT,1.5,temperature_at_screen_level
1,283.2,82,2021-08-01 18:00:00+00:00,1 days,2021-08-01 18:00:00+00:00,59,-4,2021-08-02 18:00:00+00:00,03002,air_temperature,K,5,NaT,1.5,temperature_at_screen_level
2,282.62,30,2021-08-01 18:00:00+00:00,1 days,2021-08-01 18:00:00+00:00,58,-3,2021-08-02 18:00:00+00:00,03003,air_temperature,K,5,NaT,1.5,temperature_at_screen_level
3,286.17,4,2021-08-01 18:00:00+00:00,1 days,2021-08-01 18:00:00+00:00,57,-2,2021-08-02 18:00:00+00:00,03004,air_temperature,K,5,NaT,1.5,temperature_at_screen_level
4,284.43,15,2021-08-01 18:00:00+00:00,1 days,2021-08-01 18:00:00+00:00,56,-1,2021-08-02 18:00:00+00:00,03005,air_temperature,K,5,NaT,1.5,temperature_at_screen_level
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Column,Dtype,Notes
forecast,float64,The value for a particular forecast.
altitude,float32,The altitude in metres.
blend_time,"datetime64[ns,UTC]",The time at which a blend of models was produced.
forecast_period,timedelta64[ns],The difference between the blend time (and forecast reference time) and the validity time.
forecast_reference_time,"datetime64[ns,UTC]",The time at which the forecast analysis was made for a forecast from a single source. Equal to the blend_time for a forecast created from blending multiple forecast sources.
latitude,float32,The latitude in degrees.
longitude,float32,The longitude in degrees.
time,"datetime64[ns,UTC]",The validity time of the forecasts. Signifies the end of the forecast period for period diagnostics.
wmo_id,object,The five digit WMO ID.
cf_name,object,The CF name for the diagnostic. From DataFrames consisting of one diagnostic this is expected to be constant.
units,object,The units of the forecast value. From DataFrames consisting of one diagnostic this is expected to be constant.
percentile,float64,The percentile value.
period,timedelta64[ns],The period the forecast valid is over. Set to missing data for instantaneous forecasts.
height,float32,The height of the forecast value. From DataFrames consisting of one diagnostic this is expected to be constant.
diagnostic,category,The name of the diagnostic. From DataFrames consisting of one diagnostic this is expected to be constant.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
index,forecast,altitude,blend_time,forecast_period,forecast_reference_time,latitude,longitude,time,wmo_id,cf_name,units,percentile,period,height,diagnostic
0,282.69,15,2021-08-01 00:00:00+00:00,0 days 09:00:00,2021-08-01 00:00:00+00:00,60,-5,2021-08-01 21:00:00+00:00,03001,temperature_at_screen_level_daytime_max,K,5,0 days 12:00:00,1.5,temperature_at_screen_level_max-daytime
1,283.2,82,2021-08-01 00:00:00+00:00,0 days 09:00:00,2021-08-01 00:00:00+00:00,59,-4,2021-08-01 21:00:00+00:00,03002,temperature_at_screen_level_daytime_max,K,5,0 days 12:00:00,1.5,temperature_at_screen_level_max-daytime
2,282.62,30,2021-08-01 00:00:00+00:00,0 days 09:00:00,2021-08-01 00:00:00+00:00,58,-3,2021-08-01 21:00:00+00:00,03003,temperature_at_screen_level_daytime_max,K,5,0 days 12:00:00,1.5,temperature_at_screen_level_max-daytime
3,286.17,4,2021-08-01 00:00:00+00:00,0 days 09:00:00,2021-08-01 00:00:00+00:00,57,-2,2021-08-01 21:00:00+00:00,03004,temperature_at_screen_level_daytime_max,K,5,0 days 12:00:00,1.5,temperature_at_screen_level_max-daytime
4,284.43,15,2021-08-01 00:00:00+00:00,0 days 09:00:00,2021-08-01 00:00:00+00:00,56,-1,2021-08-01 21:00:00+00:00,03005,temperature_at_screen_level_daytime_max,K,5,0 days 12:00:00,1.5,temperature_at_screen_level_max-daytime
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
index,ob_value,altitude,latitude,longitude,time,wmo_id,diagnostic
0,283.45,15,60,-5,2021-08-02 18:00:00+00:00,03001,temperature_at_screen_level
1,283.91,82,59,-4,2021-08-02 18:00:00+00:00,03002,temperature_at_screen_level
2,281.63,30,58,-3,2021-08-02 18:00:00+00:00,03003,temperature_at_screen_level
3,286.55,4,57,-2,2021-08-02 18:00:00+00:00,03004,temperature_at_screen_level
4,283.19,15,56,-1,2021-08-02 18:00:00+00:00,03005,temperature_at_screen_level
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Column,Dtype,Notes
time,"datetime64[ns,UTC]",The time of the observation.
wmo_id,object,The five digit WMO ID.
latitude,float32,The latitude in degrees.
longitude,float32,The longtitude in degrees.
altitude,float32,The altitude in metres.
ob_value,float32,The value for a particular observation.
diagnostic,category,The name of the diagnostic.
2 changes: 2 additions & 0 deletions envs/environment_py37_iris30.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ dependencies:
- iris=3.0
- netCDF4
- numpy<1.21
- pandas
- python-dateutil
- python-stratify
- pytz=2020.5
- scipy=1.6
- sigtools
- sphinx
# Optional
- fastparquet
- numba
- pysteps=1.4.1
- statsmodels
Expand Down
1 change: 1 addition & 0 deletions envs/environment_py38_iris30.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- iris=3.0
- netCDF4
- numpy<1.21
- pandas
- python-dateutil
- python-stratify
- pytz=2020.5
Expand Down
Loading