Skip to content

Commit

Permalink
Merge branch 'develop' into feature/submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMartin-NOAA authored Dec 18, 2023
2 parents c38bdaa + ceedcce commit 349541a
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 336 deletions.
24 changes: 21 additions & 3 deletions utils/obsproc/NetCDFToIodaConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,26 @@ namespace gdasapp {
// Update the group with the location dimension
ioda::NewDimensionScales_t
newDims {ioda::NewDimensionScale<int>("Location", iodaVarsAll.location_)};

// Update the group with the location and channel dimension (if channel value is assigned)
if (iodaVars.channelValues_(0) > 0) {
newDims = {
ioda::NewDimensionScale<int>("Location", iodaVarsAll.location_),
ioda::NewDimensionScale<int>("Channel", iodaVarsAll.channel_)
};
}
ioda::ObsGroup ogrp = ioda::ObsGroup::generate(group, newDims);

// Create different dimensionScales for data w/wo channel info
std::vector<ioda::Variable> dimensionScales {
ogrp.vars["Location"]
};
if (iodaVars.channelValues_(0) > 0) {
dimensionScales = {ogrp.vars["Location"], ogrp.vars["Channel"]};
ogrp.vars["Channel"].writeWithEigenRegular(iodaVars.channelValues_);
}


// Set up the creation parameters
ioda::VariableCreationParameters float_params = createVariableParams<float>();
ioda::VariableCreationParameters int_params = createVariableParams<int>();
Expand All @@ -112,14 +130,14 @@ namespace gdasapp {

ioda::Variable iodaObsVal =
ogrp.vars.createWithScales<float>("ObsValue/"+variable_,
{ogrp.vars["Location"]}, float_params);
dimensionScales, float_params);
ioda::Variable iodaObsErr =
ogrp.vars.createWithScales<float>("ObsError/"+variable_,
{ogrp.vars["Location"]}, float_params);
dimensionScales, float_params);

ioda::Variable iodaPreQc =
ogrp.vars.createWithScales<int>("PreQC/"+variable_,
{ogrp.vars["Location"]}, int_params);
dimensionScales, int_params);

// add input filenames to IODA file global attributes
ogrp.atts.add<std::string>("obs_source_files", inputFilenames_);
Expand Down
318 changes: 0 additions & 318 deletions utils/obsproc/NetCDFToIodaConverter2D.h

This file was deleted.

Loading

0 comments on commit 349541a

Please sign in to comment.