Skip to content

Commit

Permalink
Relaxed CAMS spatial pattern filename regex
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Apr 23, 2024
1 parent fedb833 commit 51e98b9
Show file tree
Hide file tree
Showing 91 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion logic/spatialpatterninventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const SpatialPatternData* SpatialPatternTableCache::find_data_for_sector(const s

SpatialPatternInventory::SpatialPatternInventory(const RunConfiguration& cfg)
: _cfg(cfg)
, _spatialPatternCamsRegex("CAMS_emissions_REG-APv\\d+.\\d+_(\\d{4})_(\\w+)_([A-Z]{1}_[^_]+|[1-6]{1}[^_]+)")
, _spatialPatternCamsRegex("CAMS_emissions_REG-\\w+v\\d+.\\d+_(\\d{4})_(\\w+)_([A-Z]{1}_[^_]+|[1-6]{1}[^_]+)")
, _spatialPatternCeipRegex("(\\w+)_([A-Z]{1}_[^_]+|[1-6]{1}[^_]+)_(\\d{4})_GRID_(\\d{4})")
, _spatialPatternBelgium1Regex("Emissies per km2 (?:excl|incl) puntbrongegevens_(\\d{4})_([\\w,]+)")
, _spatialPatternBelgium2Regex("Emissie per km2_met NFR_([\\w ,]+) (\\d{4})_(\\w+) (\\d{4})")
Expand Down
2 changes: 1 addition & 1 deletion logic/test/spatialpatterninventorytest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ TEST_CASE("Spatial pattern selection test")
{
// Available in 2018 at gnfr (not in 2016 or 2015 or 2017 or 2014)
const auto sp = inv.get_spatial_pattern(EmissionIdentifier(countries::NL, EmissionSector(sectors::nfr::Nfr1B2b), pollutants::NOx), nlCoverage);
CHECK(sp.source.path == fs::u8path(TEST_DATA_DIR) / "spatialinventory" / "rest" / "reporting_2021" / "CAMS" / "2018" / "CAMS_emissions_REG-APv5.1_2018_nox_D_Fugitives.tif");
CHECK(sp.source.path == fs::u8path(TEST_DATA_DIR) / "spatialinventory" / "rest" / "reporting_2021" / "CAMS" / "2018" / "CAMS_emissions_REG-ANTv6.1_2018_nox_D_Fugitives.tif");
CHECK(sp.source.emissionId.pollutant == pollutants::NOx);
CHECK(sp.source.emissionId.sector == EmissionSector(sectors::nfr::Nfr1B2b));
CHECK(sp.source.usedEmissionId.sector == EmissionSector(sectors::gnfr::Fugitive));
Expand Down

0 comments on commit 51e98b9

Please sign in to comment.