8 #ifndef OBSSPACEPARAMETERS_H_
9 #define OBSSPACEPARAMETERS_H_
16 #include "ioda/io/ObsIoFactory.h"
17 #include "ioda/io/ObsIoParametersBase.h"
19 #include "eckit/exception/Exceptions.h"
20 #include "eckit/mpi/Comm.h"
22 #include "oops/base/ParameterTraitsVariables.h"
23 #include "oops/util/DateTime.h"
24 #include "oops/util/Logger.h"
25 #include "oops/util/parameters/OptionalParameter.h"
26 #include "oops/util/parameters/Parameter.h"
27 #include "oops/util/parameters/Parameters.h"
28 #include "oops/util/parameters/RequiredParameter.h"
29 #include "oops/util/parameters/RequiredPolymorphicParameter.h"
44 oops::RequiredParameter<std::string>
fileName{
"obsfile",
this};
59 oops::RequiredParameter<std::string>
fileName{
"obsfile",
this};
67 oops::RequiredParameter<int>
numModelLevels{
"average profiles onto model levels",
this};
71 {
"variables filled with non-missing values",
72 {
"latitude",
"longitude",
"datetime",
"air_pressure",
"air_pressure_levels" },
81 oops::Parameter<std::vector<float>>
obsErrors{
"obs errors", { },
this};
89 oops::RequiredParameter<int>
numObs{
"nobs",
this};
92 oops::RequiredParameter<float>
latStart{
"lat1",
this};
95 oops::RequiredParameter<float>
latEnd{
"lat2",
this};
98 oops::RequiredParameter<float>
lonStart{
"lon1",
this};
101 oops::RequiredParameter<float>
lonEnd{
"lon2",
this};
104 oops::OptionalParameter<int>
ranSeed{
"random seed",
this};
121 oops::RequiredParameter<std::vector<float>>
lats{
"lats",
this};
124 oops::RequiredParameter<std::vector<float>>
lons{
"lons",
this};
127 oops::RequiredParameter<std::vector<std::string>>
datetimes{
"datetimes",
this};
148 oops::OptionalParameter<EmbeddedObsGenerateRandomParameters>
random{
"random",
this};
151 oops::OptionalParameter<EmbeddedObsGenerateListParameters>
list{
"list",
this};
154 oops::Parameter<ObsGroupingParameters>
obsGrouping{
"obsgrouping", { },
this};
157 oops::Parameter<std::vector<float>>
obsErrors{
"obs errors", { },
this};
166 oops::RequiredPolymorphicParameter<ObsIoParametersBase, ObsIoFactory>
178 void deserialize(util::CompositePath &path,
const eckit::Configuration &config)
override;
184 oops::Parameter<int>
obsPertSeed{
"obs perturbations seed", 0,
this};
187 oops::Parameter<std::string>
distName{
"distribution",
"RoundRobin",
this};
190 oops::RequiredParameter<oops::Variables>
simVars{
"simulated variables",
this};
193 oops::OptionalParameter<std::vector<float>>
haloCenter{
"center",
this};
199 oops::OptionalParameter<ObsFileOutParameters>
obsOutFile{
"obsdataout",
this};
202 oops::OptionalParameter<ObsExtendParameters>
obsExtend{
"extension",
this};
206 if (
source.value() != boost::none)
207 return source.value()->obsIoInParameters.value();
208 throw eckit::BadValue(
"obsIoInParameters() must not be called before deserialize()", Here());
213 oops::OptionalParameter<ObsFileInParameters>
obsInFile{
"obsdatain",
this};
216 oops::OptionalParameter<LegacyObsGenerateParameters>
obsGenerate{
"generate",
this};
220 oops::OptionalParameter<ObsIoParametersWrapper>
source{
"source",
this};
230 const eckit::mpi::Comm &
comm,
const eckit::mpi::Comm &
timeComm) :
255 oops::Log::trace() <<
"ObsSpaceParameters config: " << config << std::endl;
275 void setDimScale(
const std::string & dimName,
const Dimensions_t curSize,
276 const Dimensions_t maxSize,
const Dimensions_t chunkSize) {
278 NewDimensionScale<int>(dimName, curSize, maxSize, chunkSize));
Convenience classes for constructing ObsSpaces and setting up new Dimension Scales.
Describe the dimensions of a ioda::Attribute or ioda::Variable.
oops::RequiredParameter< std::vector< float > > lats
latitude values
oops::RequiredParameter< std::vector< std::string > > datetimes
datetime values
oops::RequiredParameter< std::vector< float > > lons
longitude values
oops::RequiredParameter< float > latEnd
latitude range end
oops::RequiredParameter< float > lonStart
longitude range start
oops::RequiredParameter< float > latStart
latitude range start
oops::OptionalParameter< int > ranSeed
random seed
oops::RequiredParameter< float > lonEnd
longitude range end
oops::RequiredParameter< int > numObs
number of observations
Options in the 'generate' YAML section.
oops::Parameter< std::vector< float > > obsErrors
obs error estimates
oops::Parameter< ObsGroupingParameters > obsGrouping
options controlling obs record grouping
oops::OptionalParameter< EmbeddedObsGenerateRandomParameters > random
specification for generating using the random method
oops::OptionalParameter< EmbeddedObsGenerateListParameters > list
specification for generating using the list method
oops::Parameter< int > maxFrameSize
maximum frame size
oops::Parameter< std::vector< std::string > > nonMissingExtendedVars
number of model levels in target of the averaging function
oops::RequiredParameter< int > numModelLevels
number of model levels in target of the averaging function
oops::Parameter< bool > readFromSeparateFiles
oops::RequiredParameter< std::string > fileName
input obs file name
oops::RequiredParameter< std::string > fileName
output obs file name
Options controlling the ObsIoGenerateList class.
EmbeddedObsGenerateListParameters list
options shared by this class and the legacy implementation (LegacyObsGenerateParameters)
oops::Parameter< std::vector< float > > obsErrors
obs error estimates
Options controlling the ObsIoGenerateRandom class.
EmbeddedObsGenerateRandomParameters random
options shared by this class and the legacy implementation (LegacyObsGenerateParameters)
Base of classes storing the configuration parameters of ObsIo subclasses.
oops::RequiredPolymorphicParameter< ObsIoParametersBase, ObsIoFactory > obsIoInParameters
void deserialize(const eckit::Configuration &config)
deserialize the parameter sub groups
const eckit::mpi::Comm & time_comm_
MPI time communicator.
int obsPertSeed() const
return the associated perturbations seed
ObsSpaceParameters(const util::DateTime &winStart, const util::DateTime &winEnd, const eckit::mpi::Comm &comm, const eckit::mpi::Comm &timeComm)
Constructor.
NewDimensionScales_t new_dims_
new dimension scales for output file construction
int getMpiTimeRank() const
get the MPI rank number
const util::DateTime & windowEnd() const
return the end of the DA timing window
void setMaxVarSize(const Dimensions_t maxVarSize)
set the maximum variable size
ObsTopLevelParameters top_level_
sub groups of parameters
std::size_t mpi_rank_
group MPI rank number for output file construction
std::size_t getMpiRank() const
get the MPI rank number
NewDimensionScales_t getDimScales() const
get a new dimension scale
const util::DateTime win_start_
Beginning of DA timing window.
const eckit::mpi::Comm & comm_
MPI group communicator.
void setDimScale(const std::string &dimName, const Dimensions_t curSize, const Dimensions_t maxSize, const Dimensions_t chunkSize)
set a new dimension scale
Dimensions_t getMaxVarSize() const
get the maximum variable size
int mpi_time_rank_
time MPI rank number of output file construction
const eckit::mpi::Comm & timeComm() const
return the associated MPI time communicator
const util::DateTime & windowStart() const
return the start of the DA timing window
const eckit::mpi::Comm & comm() const
return the associated MPI group communicator
const util::DateTime win_end_
End of DA timing window.
Dimensions_t max_var_size_
maximum variable size for output file contruction
oops::OptionalParameter< ObsFileInParameters > obsInFile
Fill this section to read observations from a file.
oops::OptionalParameter< float > haloRadius
Halo distribution radius.
oops::Parameter< int > obsPertSeed
perturbation seed
oops::OptionalParameter< LegacyObsGenerateParameters > obsGenerate
Fill this section to generate observations on the fly.
oops::RequiredParameter< oops::Variables > simVars
simulated variables
void deserialize(util::CompositePath &path, const eckit::Configuration &config) override
oops::OptionalParameter< ObsIoParametersWrapper > source
Fill this section instead of obsdatain and generate to load observations from any other source.
oops::OptionalParameter< std::vector< float > > haloCenter
Halo distribution center.
oops::OptionalParameter< ObsExtendParameters > obsExtend
extend the ObsSpace with extra fixed-size records
oops::RequiredParameter< std::string > obsSpaceName
name of obs space
oops::OptionalParameter< ObsFileOutParameters > obsOutFile
output specification by writing to a file
oops::Parameter< std::string > distName
name of MPI distribution
const ObsIoParametersBase & obsIoInParameters() const
parameters indicating where to load data from
std::vector< std::shared_ptr< NewDimensionScale_Base > > NewDimensionScales_t
constexpr int DEFAULT_FRAME_SIZE