Skip to content

Commit

Permalink
Merge pull request #220 from antarctica/config_validator
Browse files Browse the repository at this point in the history
Config validator and data coverage logging
  • Loading branch information
hjabbot authored Aug 11, 2023
2 parents d68b24e + 604f99a commit 8333f62
Show file tree
Hide file tree
Showing 22 changed files with 877 additions and 354 deletions.
15 changes: 14 additions & 1 deletion docs/source/sections/Configuration/Configuration_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,17 @@ Descriptions of the configuration options for Route Planning can be found in the

./Mesh_construction_config
./Vessel_performance_config
./Route_planning_config
./Route_planning_config


Config Validation
^^^^^^^^^^^^^^^^^

At each major stage of the code (mesh construction, vessel performance modelling,
and route planning), the configs supplied are validated using a template JSON Schema.
These schema check that the correct keywords and datatypes are provided in the config
JSON's, as well as the waypoints CSV file. They also perform rudimentary checks on the
values to ensure that they make sense (e.g. startTime is before endTime).

.. automodule:: polar_route.config_validation.config_validator
:members:
167 changes: 83 additions & 84 deletions docs/source/sections/Configuration/Mesh_construction_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,97 +4,96 @@ Configuration - Mesh Construction
.. code-block:: json
{
"config": {
"Mesh_info": {
"Region": {
"latMin": -65,
"latMax": -60,
"longMin": -70,
"longMax": -50,
"startTime": "2013-03-01",
"endTime": "2013-03-14",
"cellWidth": 5,
"cellHeight": 2.5
},
"Data_sources": [
{
"loader": "GEBCO",
"params": {
"downsample_factors": [
5,
5
],
"file": "../datastore/bathymetry/GEBCO/gebco_2022_n-40.0_s-90.0_w-140.0_e0.0.nc",
"data_name": "elevation",
"value_fill_types": "parent",
"aggregate_type": "MAX",
"splitting_conditions": [
{
"elevation": {
"threshold": -10,
"upper_bound": 1,
"lower_bound": 0
}
"Mesh_info": {
"Region": {
"latMin": -65,
"latMax": -60,
"longMin": -70,
"longMax": -50,
"startTime": "2013-03-01",
"endTime": "2013-03-14",
"cellWidth": 5,
"cellHeight": 2.5
},
"Data_sources": [
{
"loader": "GEBCO",
"params": {
"downsample_factors": [
5,
5
],
"file": "../datastore/bathymetry/GEBCO/gebco_2022_n-40.0_s-90.0_w-140.0_e0.0.nc",
"data_name": "elevation",
"value_fill_types": "parent",
"aggregate_type": "MAX",
"splitting_conditions": [
{
"elevation": {
"threshold": -10,
"upper_bound": 1,
"lower_bound": 0
}
]
}
},
{
"loader": "AMSR",
"params": {
"folder": "../datastore/sic/amsr_south/",
"hemisphere": "south",
"value_fill_types": "parent",
"data_name": "SIC",
"splitting_conditions": [
{
"SIC": {
"threshold": 35,
"upper_bound": 0.9,
"lower_bound": 0.1
}
}
]
}
},
{
"loader": "AMSR",
"params": {
"folder": "../datastore/sic/amsr_south/",
"hemisphere": "south",
"value_fill_types": "parent",
"data_name": "SIC",
"splitting_conditions": [
{
"SIC": {
"threshold": 35,
"upper_bound": 0.9,
"lower_bound": 0.1
}
]
}
},
{
"loader": "SOSE",
"params": {
"file": "../datastore/currents/sose_currents/SOSE_surface_velocity_6yearMean_2005-2010.nc",
"value_fill_types": "parent",
"data_name": "uC,vC",
"splitting_conditions": [
{
"uC,vC": {
"curl": 0.04
}
}
]
}
},
{
"loader": "SOSE",
"params": {
"file": "../datastore/currents/sose_currents/SOSE_surface_velocity_6yearMean_2005-2010.nc",
"value_fill_types": "parent",
"data_name": "uC,vC",
"splitting_conditions": [
{
"uC,vC": {
"curl": 0.04
}
]
}
},
{
"loader": "thickness",
"params": {
"data_name": "thickness",
"file": "",
"value_fill_types": "parent"
}
},
{
"loader": "density",
"params": {
"data_name": "density",
"file": "",
"value_fill_types": "parent"
}
}
]
}
},
{
"loader": "thickness",
"params": {
"data_name": "thickness",
"file": "",
"value_fill_types": "parent"
}
},
{
"loader": "density",
"params": {
"data_name": "density",
"file": "",
"value_fill_types": "parent"
}
],
"splitting": {
"split_depth": 4,
"minimum_datapoints": 5
}
],
"splitting": {
"split_depth": 4,
"minimum_datapoints": 5
}
}
}
The configuration file used for mesh construction contains information required to build the discretised environment in which the route planner
Expand Down
Loading

0 comments on commit 8333f62

Please sign in to comment.