diff --git a/.gitignore b/.gitignore index bd01309..9e47ee5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ !/bundle/CMakeLists.txt /bundle/* __pycache__/ +_codeql_detected_source_root diff --git a/src/ioda-dump/README.md b/src/ioda-dump/README.md index 303ec0f..76f0046 100644 --- a/src/ioda-dump/README.md +++ b/src/ioda-dump/README.md @@ -51,6 +51,11 @@ The program reads a single YAML file. Required keys: - `input files`: list of explicit file paths - `output file`: path to the ASCII report to write (ensure the directory exists) +Optional keys: + +- `shared path`: path to directory containing mapping and query files for ODB files (defaults to `./` if not specified) +- `query prefix`: prefix for query files used with ODB files + ### Example: directory scan mode ```yaml @@ -64,6 +69,7 @@ time window: # Scan a directory (non-recursive). Files with extensions .nc, .nc4, .h5, .hdf5, .odb are included. input directory: /path/to/ioda/files +# Optional: only required for ODB files. Defaults to './' if not specified. shared path: [/path/to/ioda/shared/yaml] query prefix: [iodatest_odb_] @@ -95,6 +101,7 @@ input files: - /data/ioda/sst/file3.nc4 - /data/ioda/sst/file4.odb +# Optional: only required for ODB files. Defaults to './' if not specified. shared path: [/path/to/ioda/shared/yaml] query prefix: [iodatest_odb_] diff --git a/src/ioda-dump/ioda-dump.h b/src/ioda-dump/ioda-dump.h index 59b4afa..52b9869 100644 --- a/src/ioda-dump/ioda-dump.h +++ b/src/ioda-dump/ioda-dump.h @@ -84,7 +84,9 @@ namespace dautils { fullConfig.get("shared path", sharedPath); oops::Log::info() << "Shared Path: " << sharedPath << std::endl; } else { - throw eckit::Exception("Missing 'Shared Path' in YAML configuration"); + // Use default value and print warning + sharedPath.push_back("./"); + oops::Log::warning() << "Shared Path not defined in YAML configuration, using default: './' " << std::endl; } // get "query prefix" for mapping and query files @@ -303,11 +305,6 @@ namespace dautils { std::string base = filename.substr(0, filename.find_last_of('.')); std::string instrument = base.substr(base.find_last_of("/\\") + 1); - if (sharedPath.empty()) { - oops::Log::error() << "No shared path available for file " << filename << std::endl; - throw eckit::Exception("Shared path not available"); - } - std::string yamlDir = sharedPath[0]; std::string queryFile; if (queryPrefix.empty()) {