Skip to content

Feature/mars2grib new encoding for statistics#221

Draft
MircoValentiniECMWF wants to merge 27 commits into
developfrom
feature/mars2grib-new-encoding-for-statistics
Draft

Feature/mars2grib new encoding for statistics#221
MircoValentiniECMWF wants to merge 27 commits into
developfrom
feature/mars2grib-new-encoding-for-statistics

Conversation

@MircoValentiniECMWF
Copy link
Copy Markdown
Contributor

Description

Draft until debug is finished

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

MircoValentiniECMWF and others added 27 commits May 26, 2026 10:29
- Add new iteration concept under backend/concepts/iteration/ following the standard 4-file layout (Enum, Matcher, Encoding, ConceptDescriptor); single Default variant, applicable at (StagePreset, SecLocalUseSection), with LocalDefinitionNumber allow-list {20, 38}; encoder sets iterationNumber and (optionally) totalNumberOfIterations.
- Add the supporting deductions backend/deductions/iterationNumber.h (resolve_IterationNumber_or_throw) and backend/deductions/totalNumberOfIterations.h (resolve_TotalNumberOfIterations_opt) used by IterationOp.
- Register IterationConcept in AllConcepts.h: include added alphabetically between generating-process and level; type appended to the AllConcepts typelist after LongrangeConcept.
- Implement iterationMatcher: returns IterationType::Default when mars has the "iteration" key, MISSING otherwise.
- Extend analysisEncoding.h LocalDefinitionNumber allow-list from {36} to {36, 38} so AnalysisOp accepts the new combined template 38 (4i analysis products).
- Add Section 2 recipes in section2Recipes.h: S2_R20 (Mars + Iteration) and S2_R38 (Mars + Iteration + Analysis); both registered in the Section2Recipes aggregator in numerical order.
- Add new modelError concept under backend/concepts/model-error/ following the standard 4-file layout (Enum, Matcher, Encoding, ConceptDescriptor); single Default variant, applicable at (StagePreset, SecLocalUseSection), with LocalDefinitionNumber allow-list {25, 39}; encoder body left as TODO (deductions / GRIB key writes to be added separately).
- Register ModelErrorConcept in AllConcepts.h: include added alphabetically between mars and nil; type appended at the end of the AllConcepts typelist to preserve existing conceptIds and global variant indices.
- Implement modelErrorMatcher: returns ModelErrorType::Default when mars["type"] == "eme"; throws Mars2GribMatcherException if the mandatory "number" key is missing in that case; returns MISSING otherwise.
- Add Section 2 recipes in section2Recipes.h: S2_R25 (Mars + ModelError) and S2_R39 (Mars + Analysis + ModelError); both registered in the Section2Recipes aggregator in numerical order.
- Extend analysisEncoding.h LocalDefinitionNumber allow-list from {36, 38} to {36, 38, 39} so AnalysisOp accepts the new template 39.
- Update ensembleMatcher.h to return MISSING when mars["type"] == "eme", since in that case the "number" key identifies the model-error realization, not an ensemble member.
…MultipleLevel

- Replace the single LevelType::Hybrid variant with two variants:
  ModelSingleLevel for 2D fields published on the model-level system
  (no vertical column, no PV array) and ModelMultipleLevel for full
  vertical columns of model-level data, which require allocation and
  population of the PV array describing the hybrid coordinate
  transformation. Both variants map to GRIB typeOfLevel "hybrid", so
  encoded output is bit-identical for cases that previously used
  Hybrid; only encoder behaviour (PV allocation) differs between the
  two new variants.

- Update the LevelList typelist to reflect the new variants and keep
  it in sync with the LevelType enumeration.

- Update needPv to fire only on ModelMultipleLevel; update needLevel
  to cover both ModelSingleLevel and ModelMultipleLevel.

- Add a new AbstractLevel variant carrying a numeric level value,
  sitting alongside the existing AbstractSingleLevel and
  AbstractMultipleLevel opaque variants. AbstractLevel is included in
  needLevel.

- Rewrite matchML to dispatch single-level model paramIds (22, 127,
  128, 129, 152) to ModelSingleLevel and the remaining multi-level
  set to ModelMultipleLevel. ERA6 paramIds 127 and 128 on ML, which
  were previously rejected, are now accepted as ModelSingleLevel.

- Refresh Doxygen for the level concept to document the three
  orthogonal predicates needPv, needLevel, needTopBottomLevel and to
  describe the rationale for splitting Hybrid into single-level and
  multi-level model variants.

- Fix typo in the level encoder header comment: "Se of typeOfLevel"
  becomes "Setting of typeOfLevel".
…fc detection, model-error types)

- params.yaml: register ECMWF covariance paramIds 254001..254017 on levtype=sfc.
- levelMatcher: map paramIds 254001..254017 to LevelType::AbstractLevel
  (typeOfFirstFixedSurface=254); extend matchO2D with ocean paramIds
  262146/262147 (DepthBelowSeaLayer) and 262148 (OceanSurfaceToBottom).
- pointInTimeMatcher: add 254001..254017 and 262146..262148 to the default
  point-in-time set so Section 4 recipe selection succeeds for these params.
- significanceOfReferenceTime: recognize MARS type "est" as a forecast type.
- typeOfGeneratingProcess:
  * For type=fc, detect ensemble evidence (numberOfForecastsInEnsemble>1,
    typeOfEnsembleForecast present, or mars.number>0) and resolve to
    EnsembleForecast instead of Forecast; default behavior is preserved
    when no ensemble evidence is present. Adds detail to RESOLVE log.
  * Map type=eme/me (4D-Var model errors) to Analysis, matching the
    existing {4i,4v,me,eme} grouping in significanceOfReferenceTime.
Represent brightness-temperature metadata as a dedicated concept so it can be selected independently of the surrounding satellite or derived product family.

This removes the brightness-temperature variants from satellite and derived handling and routes section 2 recipes through the new concept.
Split model-error handling into explicit component-index and Fourier-coefficient variants so recipe selection can distinguish the supported request shapes.

Also treats legacy type=me requests as model-error requests alongside type=eme.
Set packing precision during allocation using setBitsPerValue and defer spectral packing metadata to the preset stage.

Initialize sample values from the representation concept using a deduced reference value so intermediate samples remain valid throughout encoding, even though this adds work to the encoder path.
- Introduce ProductTime as the single source of truth for all temporal data; remove per-concept re-parsing of raw MARS keys.
- Collapse the statistics encoder to a uniform SoA path (no instant / single-window / multi-window branching).
- Migrate referenceTime, pointInTime, statistics concepts onto resolve_ProductTime_or_throw.
- Drop superseded legacy deductions (forecastTimeInSeconds, timeSpanInSeconds, referenceDateTime, hindcastDateTime, numberOfTimeRanges, statisticsDescriptor, detail/timeUtils).

Skeleton for design review; runtime stage of statistics deliberately left empty pending follow-up.
- timeProducts.md: 18 surgical edits reconciling spec with reality
  (factory rename to make_ProductTime_or_throw, statisticsDescriptor.h
  relocated to concepts/statistics/impl/, timeIncrementInSeconds.h
  preserved, significanceOfReferenceTime.h preserved, consumer-migration
  marked complete, dropped STEP4 checklist mandate, fixed deductions/
  detail/ProductTime.h casing, swapped numberOfTimeRanges.h exemplars)
- timeIncrementInSeconds.h: add full ECMWF doxygen header
  (file/brief/ingroup, per-function param/return/throws), drop misleading
  copy-paste comment and implemented-already TODO
- significanceOfReferenceTime.h: replace two broken @ref lines pointing
  at never-existing files with @ref productTime.h
- detail/ProductTime.h, productTime.h, detail/StatType.h, detail/
  StatisticalWindow.h: rename factory makeProductTime_or_throw to
  make_ProductTime_or_throw (definition + call site + 5 doxygen refs)
- detail/pv_137_be.h: delete dangling commented-out namespace open
- timeProducts.md section 9.5: document new numberOfTimeRanges helper
- timeProducts.md section 19: drop Step 0/1 design-discussion wording
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the mars2grib concept/recipe system to support additional Section 2 local templates (including 4D-Var iteration, model-error, and brightness-temperature products) and refactors time handling to use a unified ProductTime model across multiple concepts/deductions. It also updates Doxygen inputs and expands/standardizes matcher + concept descriptor documentation.

Changes:

  • Add new Section 2 recipes/templates (20/25/37/38/39) and register them for allocation.
  • Introduce new concepts/deductions for iteration + model-error + brightness-temperature, and expand type mappings (e.g., generating process, derived forecast).
  • Refactor multiple time-related paths to use productTime/ProductTime and reorganize Doxygen inputs accordingly.

mars2grib documentation synchronization (files under src/metkit/mars2grib/**): ❌ outdated

  • Documented behavior mismatches exist in the new brightness-temperature concept (variant description and numberOfFrequencies handling). See stored PR comments.

Reviewed changes

Copilot reviewed 139 out of 139 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/metkit/mars2grib/frontend/resolution/section-recipes/impl/section2Recipes.h Adds new Section 2 recipes for iteration/model-error/brightness-temperature templates.
src/metkit/mars2grib/docs/doxygen/mars2grib.config.in Updates Doxygen INPUT set to reflect refactored/renamed time/statistics components.
src/metkit/mars2grib/docs/doxygen/mars2grib_concepts.md Adds conceptual guardrails (new concept vs variant; level concept constraints).
src/metkit/mars2grib/copilot-instructions.md Adds project-specific AI contribution guidance (concept vs variant; level guardrail; doc sync).
src/metkit/mars2grib/backend/sections/initializers/sectionRegistry.h Registers new Section 2 templates (20/25/37/38/39) for allocation.
src/metkit/mars2grib/backend/deductions/typeOfGeneratingProcess.h Improves typeOfGeneratingProcess resolution for ensemble evidence and new types (eme/me/est…).
src/metkit/mars2grib/backend/deductions/timeSpanInSeconds.h Removes old timespan→seconds deduction (superseded by ProductTime refactor).
src/metkit/mars2grib/backend/deductions/timeIncrementInSeconds.h Expands/clarifies optional time increment deduction and adds an “or_throw” wrapper.
src/metkit/mars2grib/backend/deductions/significanceOfReferenceTime.h Updates type classification arrays (adds est; rewires related deductions docs).
src/metkit/mars2grib/backend/deductions/referenceDateTime.h Removes old reference date/time deduction (superseded by ProductTime refactor).
src/metkit/mars2grib/backend/deductions/perturbationNumber.h Enhances Doxygen structure/metadata (ingroup/file header cleanup).
src/metkit/mars2grib/backend/deductions/numberOfTimeRanges.h Removes old time-ranges deduction (superseded by ProductTime/statistics refactor).
src/metkit/mars2grib/backend/deductions/numberOfFrequencies.h Adds a new deduction for numberOfFrequencies with a default (54) and override support.
src/metkit/mars2grib/backend/deductions/numberOfComponents.h Adds mandatory deduction for model-error ensemble size (numberOfComponents).
src/metkit/mars2grib/backend/deductions/modelErrorType.h Adds mandatory deduction for model-error type identifier (modelErrorType).
src/metkit/mars2grib/backend/deductions/iterationNumber.h Adds deduction for mars["iteration"] (4D-Var iteration/offset handling).
src/metkit/mars2grib/backend/deductions/hindcastDateTime.h Removes old hindcast date/time deduction (superseded by ProductTime refactor).
src/metkit/mars2grib/backend/deductions/generatingProcessIdentifier.h Adds/expands documentation for optional passthrough deduction.
src/metkit/mars2grib/backend/deductions/forecastTimeInSeconds.h Removes old step→seconds deduction (superseded by ProductTime refactor).
src/metkit/mars2grib/backend/deductions/detail/StatisticalWindow.h Introduces shared (TimeUnit,count) window type for stattype parsing/ProductTime assembly.
src/metkit/mars2grib/backend/deductions/detail/pv_137_be.h Adds licensing + Doxygen metadata for PV coefficient table header.
src/metkit/mars2grib/backend/deductions/derivedForecast.h Extends spread classification to include ses.
src/metkit/mars2grib/backend/deductions/allowedReferenceValue.h Splits behavior by grid vs truncation; enforces exclusivity and adds spectral default rule.
src/metkit/mars2grib/backend/concepts/wave/waveMatcher.h Improves error handling for missing wave-spectra metadata (frequency/direction) and wraps exceptions.
src/metkit/mars2grib/backend/concepts/wave/waveEnum.h Updates documentation references to waveEncoding.h.
src/metkit/mars2grib/backend/concepts/wave/waveEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/wave/waveConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/tables/tablesMatcher.h Wraps matcher with nested exception context and expands documentation.
src/metkit/mars2grib/backend/concepts/tables/tablesEnum.h Updates documentation references to tablesEncoding.h.
src/metkit/mars2grib/backend/concepts/tables/tablesEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/tables/tablesConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/statistics/statisticsEnum.h Adds strongly-typed mapping from StatisticsType to tables::TypeOfStatisticalProcessing.
src/metkit/mars2grib/backend/concepts/statistics/statisticsConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/shape-of-the-earth/shapeOfTheEarthMatcher.h Wraps matcher with nested exception context; documents spectral skip behavior.
src/metkit/mars2grib/backend/concepts/shape-of-the-earth/shapeOfTheEarthEnum.h Updates documentation references to shapeOfTheEarthEncoding.h.
src/metkit/mars2grib/backend/concepts/shape-of-the-earth/shapeOfTheEarthEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/shape-of-the-earth/shapeOfTheEarthConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/satellite/satelliteMatcher.h Adds exception wrapping + documentation improvements for applicability.
src/metkit/mars2grib/backend/concepts/satellite/satelliteEnum.h Updates documentation references to satelliteEncoding.h.
src/metkit/mars2grib/backend/concepts/satellite/satelliteEncoding.h Changes Local Use Section encoding to template 37 keys (channelNumber, numberOfFrequencies).
src/metkit/mars2grib/backend/concepts/satellite/satelliteConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/representation/representationMatcher.h Adds exception wrapping and Healpix mapping; improves unsupported-grid failure.
src/metkit/mars2grib/backend/concepts/representation/representationEnum.h Updates documentation references to representationEncoding.h.
src/metkit/mars2grib/backend/concepts/representation/representationConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/reference-time/referenceTimeMatcher.h Wraps matcher with nested exception context.
src/metkit/mars2grib/backend/concepts/reference-time/referenceTimeEnum.h Updates documentation references to referenceTimeEncoding.h.
src/metkit/mars2grib/backend/concepts/reference-time/referenceTimeEncoding.h Refactors reference-time encoding to use ProductTime instead of separate date/time deductions.
src/metkit/mars2grib/backend/concepts/reference-time/referenceTimeConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/point-in-time/pointInTimeEnum.h Updates documentation references to pointInTimeEncoding.h.
src/metkit/mars2grib/backend/concepts/point-in-time/pointInTimeEncoding.h Refactors step computation to derive from ProductTime windows.
src/metkit/mars2grib/backend/concepts/point-in-time/pointInTimeConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/param/paramMatcher.h Adds exception wrapping + documentation for always-active matcher.
src/metkit/mars2grib/backend/concepts/param/paramEnum.h Updates documentation references to paramEncoding.h.
src/metkit/mars2grib/backend/concepts/param/paramEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/param/paramConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/packing/packingMatcher.h Improves matcher errors + wraps exceptions; supports complex mapping.
src/metkit/mars2grib/backend/concepts/packing/packingEnum.h Updates documentation references to packingEncoding.h.
src/metkit/mars2grib/backend/concepts/packing/packingEncoding.h Changes applicability stages and defers bits-per-value setting to allocation; stage-splits spectral complex parameters.
src/metkit/mars2grib/backend/concepts/packing/packingConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/origin/originMatcher.h Adds exception wrapping + documentation for always-active matcher.
src/metkit/mars2grib/backend/concepts/origin/originEnum.h Updates documentation references to originEncoding.h.
src/metkit/mars2grib/backend/concepts/origin/originEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/origin/originConceptDescriptor.h Expands descriptor documentation.
src/metkit/mars2grib/backend/concepts/nil/nilMatcher.h Adds exception wrapping + documentation for always-active matcher.
src/metkit/mars2grib/backend/concepts/nil/nilEnum.h Updates documentation references to nilEncoding.h.
src/metkit/mars2grib/backend/concepts/nil/nilEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/nil/nilConceptDescriptor.h Updates @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/model-error/modelErrorMatcher.h Adds matcher for model-error products (type=me/eme) and selects variant by keys.
src/metkit/mars2grib/backend/concepts/model-error/modelErrorEnum.h Defines model-error concept metadata + variant names.
src/metkit/mars2grib/backend/concepts/model-error/modelErrorConceptDescriptor.h Registers model-error concept into compile-time registry.
src/metkit/mars2grib/backend/concepts/MatchingCallbacksRegistry.h Adds Doxygen grouping metadata.
src/metkit/mars2grib/backend/concepts/GeneralRegistry.h Adds Doxygen grouping metadata.
src/metkit/mars2grib/backend/concepts/mars/marsMatcher.h Wraps matcher with nested exception context.
src/metkit/mars2grib/backend/concepts/mars/marsEnum.h Updates documentation references to marsEncoding.h.
src/metkit/mars2grib/backend/concepts/mars/marsEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/mars/marsConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/longrange/longrangeMatcher.h Wraps matcher with nested exception context.
src/metkit/mars2grib/backend/concepts/longrange/longrangeEnum.h Updates documentation references to longrangeEncoding.h.
src/metkit/mars2grib/backend/concepts/longrange/longrangeEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/longrange/longrangeConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/level/levelEnum.h Splits hybrid into model single/multi-level variants; adds AbstractLevel; updates mapping/docs.
src/metkit/mars2grib/backend/concepts/level/levelEncoding.h Updates PV/level predicates and documentation to match new model-level split.
src/metkit/mars2grib/backend/concepts/level/levelConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/iteration/iterationMatcher.h Adds matcher for iteration key presence.
src/metkit/mars2grib/backend/concepts/iteration/iterationEnum.h Defines iteration concept metadata + variant list.
src/metkit/mars2grib/backend/concepts/iteration/iterationConceptDescriptor.h Registers iteration concept into compile-time registry.
src/metkit/mars2grib/backend/concepts/generating-process/generatingProcessMatcher.h Adds exception wrapping + documentation for always-active matcher.
src/metkit/mars2grib/backend/concepts/generating-process/generatingProcessEnum.h Updates documentation references to generatingProcessEncoding.h.
src/metkit/mars2grib/backend/concepts/generating-process/generatingProcessEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/generating-process/generatingProcessConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/AllConcepts.h Adds new concepts to the universe and adjusts ordering/docs.
src/metkit/mars2grib/backend/concepts/ensemble/ensembleMatcher.h Skips model-error products when number is present; wraps exceptions.
src/metkit/mars2grib/backend/concepts/ensemble/ensembleEnum.h Updates documentation references to ensembleEncoding.h.
src/metkit/mars2grib/backend/concepts/ensemble/ensembleEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/ensemble/ensembleConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/EncodingCallbacksRegistry.h Adds Doxygen grouping metadata.
src/metkit/mars2grib/backend/concepts/destine/destineMatcher.h Wraps matcher exceptions; improves error messages for unsupported/missing dataset.
src/metkit/mars2grib/backend/concepts/destine/destineEnum.h Updates documentation references to destineEncoding.h.
src/metkit/mars2grib/backend/concepts/destine/destineEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/destine/destineConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/derived/derivedMatcher.h Adds ses support and wraps matcher exceptions.
src/metkit/mars2grib/backend/concepts/derived/derivedEnum.h Simplifies derived variants to Default only.
src/metkit/mars2grib/backend/concepts/derived/derivedEncoding.h Expands applicability to Local Use Section; scopes PDS behavior to PDS-only branch.
src/metkit/mars2grib/backend/concepts/derived/derivedConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/data-type/dataTypeMatcher.h Adds exception wrapping + documentation for always-active matcher.
src/metkit/mars2grib/backend/concepts/data-type/dataTypeEnum.h Updates documentation references to dataTypeEncoding.h.
src/metkit/mars2grib/backend/concepts/data-type/dataTypeEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/data-type/dataTypeConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/concepts.md Adds guidance on concept-vs-variant and level guardrails; renumbers sections.
src/metkit/mars2grib/backend/concepts/composition/compositionMatcher.h Adds exception wrapping + documentation for concept activation rules.
src/metkit/mars2grib/backend/concepts/composition/compositionEnum.h Updates documentation references to compositionEncoding.h.
src/metkit/mars2grib/backend/concepts/composition/compositionEncoding.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/composition/compositionConceptDescriptor.h Corrects @file name in Doxygen header.
src/metkit/mars2grib/backend/concepts/brightness-temperature/brightnessTemperatureMatcher.h Adds matcher for brightness-temperature products (param=194, stream oper/elda).
src/metkit/mars2grib/backend/concepts/brightness-temperature/brightnessTemperatureEnum.h Adds brightness-temperature concept enum + metadata.
src/metkit/mars2grib/backend/concepts/analysis/analysisMatcher.h Adds exception wrapping + documentation for activation via anoffset.
src/metkit/mars2grib/backend/concepts/analysis/analysisEnum.h Updates documentation references to analysisEncoding.h.
src/metkit/mars2grib/backend/concepts/analysis/analysisEncoding.h Broadens Local Definition Number validation set (36/37/38/39).
src/metkit/mars2grib/backend/concepts/analysis/analysisConceptDescriptor.h Corrects @file name in Doxygen header.
share/metkit/params.yaml Adds new sfc parameter IDs (254001–254017) mapping entry.
Comments suppressed due to low confidence (1)

src/metkit/mars2grib/backend/deductions/timeIncrementInSeconds.h:99

  • The validation logic normalizes a present value of 0 to std::nullopt, but the error message for negative values says the key must be "> 0 if present". Since 0 is explicitly allowed (as legacy normalization), the error message should reflect the actual contract (non-negative).

Comment on lines +65 to +69
/// @brief Enumeration of all supported `brightnessTemperature` concept variants.
///
/// The concept currently has a single variant because both supported streams
/// share the same Local Use Section encoding logic.
///
Comment on lines 218 to +222
// Check/Validation
validation::match_LocalDefinitionNumber_or_throw(opt, out, {24});
validation::match_LocalDefinitionNumber_or_throw(opt, out, {37});

// Deductions
long channel = deductions::resolve_Channel_or_throw(mars, par, opt);
long channelNumber = deductions::resolve_Channel_or_throw(mars, par, opt);
Comment on lines +143 to +155
// Preconditions / contracts
validation::match_LocalDefinitionNumber_or_throw(opt, out, {37L});

// number of frequencies is always 1 for brightness temperature products
auto numberOfFrequenciesVal = deductions::resolve_NumberOfFrequencies_or_throw(mars, par, opt);
set_or_throw(out, "numberOfFrequencies", numberOfFrequenciesVal);

// In Ensemble Mean variant, channel number is required; in Default variant it is already set by the
// satellite concept
if constexpr (Variant == BrightnessTemperatureType::EnsembleMean) {
auto channelNumberVal = deductions::resolve_Channel_or_throw(mars, par, opt);
set_or_throw(out, "channelNumber", channelNumberVal);
}
Comment on lines 179 to +183
TypeList<AnalysisConcept, CompositionConcept, DataTypeConcept, DerivedConcept, DestineConcept, EnsembleConcept,
GeneratingProcessConcept, LevelConcept, LongrangeConcept, MarsConcept, NilConcept, OriginConcept,
PackingConcept, ParamConcept, PointInTimeConcept, ReferenceTimeConcept, RepresentationConcept,
SatelliteConcept, ShapeOfTheEarthConcept, StatisticsConcept, TablesConcept, WaveConcept>;
GeneratingProcessConcept, LevelConcept, LongrangeConcept, IterationConcept, MarsConcept, NilConcept,
OriginConcept, PackingConcept, ParamConcept, PointInTimeConcept, ReferenceTimeConcept,
RepresentationConcept, SatelliteConcept, ShapeOfTheEarthConcept, StatisticsConcept, TablesConcept,
WaveConcept, ModelErrorConcept, BrightnessTemperatureConcept>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants