Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
658 changes: 658 additions & 0 deletions doc/bufr_table_samples/NCEP_NC021XXX_NormalFeed_Radiance_BUFRTable.txt

Large diffs are not rendered by default.

447 changes: 447 additions & 0 deletions doc/bufr_table_samples/NCEP_NC021XXX_RARS-DB_Radiance_BUFRTable.txt

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/bufr/BufrParser/BufrParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <map>
#include <ostream>
#include <iostream>
#include <chrono>
#include <chrono> // NOLINT

#include "eckit/exception/Exceptions.h"

Expand Down Expand Up @@ -78,8 +78,10 @@ namespace Ingester
auto exportedData = exportData(srcData);

auto timeElapsed = std::chrono::steady_clock::now() - startTime;
auto timeElapsedDuration = std::chrono::duration_cast<std::chrono::milliseconds>
(timeElapsed);
std::cout << "Finished "
<< "[" << std::chrono::duration_cast<std::chrono::milliseconds>(timeElapsed).count()/1000.0 << "s]"
<< "[" << timeElapsedDuration.count()/1000.0 << "s]"
<< std::endl;

return exportedData;
Expand Down
1 change: 0 additions & 1 deletion src/bufr/BufrParser/Exports/Export.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Ingester
class Export
{
public:

typedef std::vector<std::shared_ptr<Split>> Splits;
typedef std::vector<std::shared_ptr<Variable>> Variables;
typedef std::vector<std::shared_ptr<Filter>> Filters;
Expand Down
3 changes: 2 additions & 1 deletion src/bufr/BufrParser/Exports/Filters/BoundingFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ namespace Ingester
extraDims *= dims[dimIdx];
}

auto rawData = var->getRawData(); // Make local copy otherwise you get weird memory corruption issue.
// Make local copy otherwise you get weird memory corruption issue.
auto rawData = var->getRawData();
auto array = Eigen::Map<EigArray> (rawData.data(), dims[0], extraDims);

for (std::size_t rowIdx = 0; rowIdx < dims[0]; rowIdx++)
Expand Down
3 changes: 2 additions & 1 deletion src/bufr/BufrParser/Exports/Splits/CategorySplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

namespace Ingester
{
CategorySplit::CategorySplit(const std::string& name, const std::string& variable, const NameMap& nameMap) :
CategorySplit::CategorySplit(const std::string& name, const std::string& variable,
const NameMap& nameMap) :
Split(name),
variable_(variable),
nameMap_(nameMap)
Expand Down
10 changes: 7 additions & 3 deletions src/bufr/BufrParser/Exports/Splits/Split.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
//
// Created by rmclaren on 7/26/21.
//
/*
* (C) Copyright 2021 NOAA/NWS/NCEP/EMC
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*/


#include "Split.h"

Expand Down
2 changes: 1 addition & 1 deletion src/bufr/BufrParser/Exports/Splits/Split.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Ingester
/// \brief Get the split name
inline std::string getName() const { return name_; }

private:
private:
/// \brief The name of the split as defined by the key in the YAML file.
const std::string name_;
};
Expand Down
6 changes: 3 additions & 3 deletions src/bufr/BufrParser/Exports/Variables/DatetimeVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace

namespace Ingester
{
DatetimeVariable::DatetimeVariable(const std::string& exportName,
DatetimeVariable::DatetimeVariable(const std::string& exportName,
const eckit::Configuration &conf) :
Variable(exportName),
yearQuery_(conf.getString(ConfKeys::Year)),
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace Ingester
datetimeStr << "Z";
datetimes[idx] = datetimeStr.str();
}

Dimensions dims = {datetimes.size()};
return std::make_shared<DataObject<std::string>>(
datetimes,
Expand Down Expand Up @@ -195,7 +195,7 @@ namespace Ingester
queries.push_back(info);
}

if (!secondQuery_.empty()) // Second
if (!secondQuery_.empty()) // Second
{
QueryInfo info;
info.name = getExportKey(ConfKeys::Second);
Expand Down
12 changes: 9 additions & 3 deletions src/bufr/DataObject.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* (C) Copyright 2021 NOAA/NWS/NCEP/EMC
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*/

#include "DataObject.h"

Expand All @@ -6,10 +12,10 @@
#include "eckit/exception/Exceptions.h"


namespace Ingester
namespace Ingester
{
std::shared_ptr<DataObjectBase>
DataObjectBase::fromResult(const std::shared_ptr<bufr::ResultBase>& resultBase,
DataObjectBase::fromResult(const std::shared_ptr<bufr::ResultBase>& resultBase,
const std::string& query)
{
std::shared_ptr<DataObjectBase> dataObject = nullptr;
Expand All @@ -19,7 +25,7 @@ namespace Ingester
dataObject = std::make_shared<DataObject<float>> (result->data,
result->field_name,
result->group_by_field_name,
result->dims,
result->dims,
query,
result->dimPaths);
}
Expand Down
13 changes: 7 additions & 6 deletions src/bufr/DataObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ namespace Ingester
/// IodaEncoder.
class DataObjectBase
{
public:
public:
static std::shared_ptr<DataObjectBase>
fromResult(const std::shared_ptr<bufr::ResultBase>& resultBase, const std::string& query);
fromResult(const std::shared_ptr<bufr::ResultBase>& resultBase,
const std::string& query);

explicit DataObjectBase(const std::string& fieldName,
const std::string& groupByFieldName,
Expand Down Expand Up @@ -76,7 +77,7 @@ namespace Ingester
/// \brief Slice the data object given a vector of row indices.
/// \param slice The indices to slice.
/// \return Slice of the data object.
virtual std::shared_ptr<DataObjectBase>
virtual std::shared_ptr<DataObjectBase>
slice(const std::vector<std::size_t>& rows) const = 0;

protected:
Expand Down Expand Up @@ -150,7 +151,7 @@ namespace Ingester
dim_prod *= dims_[dim_idx];
}

//Compute the index into the data array
// Compute the index into the data array
size_t index = 0;
for (int dim_idx = loc.size() - 1; dim_idx >= 0; --dim_idx)
{
Expand Down Expand Up @@ -226,13 +227,13 @@ namespace Ingester
{
result[dataIdx] = std::stof(data_[dataIdx]);
}

return result;
}

std::shared_ptr<DataObjectBase> slice(const std::vector<std::size_t>& rows) const final
{
//Compute product of extra dimensions)
// Compute product of extra dimensions)
std::size_t extraDims = 1;
for (std::size_t i = 1; i < dims_.size(); ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/bufr/IodaEncoder/IodaDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace Ingester
throw eckit::BadParameter(errStr.str());
}

for (const auto &dimConf: dimConfs) {
for (const auto &dimConf : dimConfs) {
DimensionDescription dim;
dim.name = dimConf.getString(ConfKeys::Dimension::Name);

Expand Down
20 changes: 12 additions & 8 deletions src/bufr/IodaEncoder/IodaEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

namespace Ingester
{
const static char* DefualtLocationName = "nlocs";
const static char* DefualtDimName = "dim";
static const char* DefualtLocationName = "nlocs";
static const char* DefualtDimName = "dim";

IodaEncoder::IodaEncoder(const eckit::Configuration& conf) :
description_(IodaDescription(conf))
Expand Down Expand Up @@ -52,7 +52,8 @@ namespace Ingester
{
if (dimNames.find(dim.name) != dimNames.end())
{
throw eckit::UserError("ioda::dimensions: Duplicate dimension name: " + dim.name);
throw eckit::UserError("ioda::dimensions: Duplicate dimension name: "
+ dim.name);
}

dimNames.insert(dim.name);
Expand All @@ -61,7 +62,8 @@ namespace Ingester
{
if (dimPaths.find(path) != dimPaths.end())
{
throw eckit::BadParameter("ioda::dimensions: Declared duplicate dimension path: " + path);
throw eckit::BadParameter("ioda::dimensions: Declared duplicate dim. path: "
+ path);
}

dimPaths.insert(path);
Expand Down Expand Up @@ -101,7 +103,8 @@ namespace Ingester
else
{
auto newDimStr = std::ostringstream();
newDimStr << DefualtLocationName << "_" << dataObject->getGroupByFieldName();
newDimStr << DefualtLocationName << "_"
<< dataObject->getGroupByFieldName();

dimName = newDimStr.str();
namedLocDims[{dimPath}] = dimName;
Expand Down Expand Up @@ -132,7 +135,8 @@ namespace Ingester

if (dimMap.find(dimName) == dimMap.end())
{
dimMap[dimName] = ioda::NewDimensionScale<int>(dimName, dataObject->getDims()[dimIdx]);
dimMap[dimName] = ioda::NewDimensionScale<int>(dimName,
dataObject->getDims()[dimIdx]);
}
}
}
Expand Down Expand Up @@ -347,7 +351,8 @@ namespace Ingester
return false;
}

std::string IodaEncoder::nameForDimPath(const std::string& path, const NamedPathDims& pathMap) const
std::string IodaEncoder::nameForDimPath(const std::string& path,
const NamedPathDims& pathMap) const
{
std::string name;

Expand All @@ -361,6 +366,5 @@ namespace Ingester
}

return name;

}
} // namespace Ingester
8 changes: 5 additions & 3 deletions src/ncar-bufr2nc-fortran/define_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ module define_mod
integer(i_kind), parameter :: nvar_met = 6
integer(i_kind), parameter :: nvar_info = 9 ! number of metadata
integer(i_kind), parameter :: nsen_info = 7 ! number of sensor metadata
integer(i_kind), parameter :: ninst = 12
!integer(i_kind), parameter :: ninst = 13 ! including airs
integer(i_kind), parameter :: ninst = 15 ! including airs
integer(i_kind), parameter :: write_nc_conv = 1
integer(i_kind), parameter :: write_nc_radiance = 2

Expand Down Expand Up @@ -81,7 +80,10 @@ module define_mod
'mhs_n19 ', &
'mhs_metop-a ', &
'mhs_metop-b ', &
'mhs_metop-c ' &
'mhs_metop-c ', &
'iasi_metop-a ', &
'iasi_metop-b ', &
'iasi_metop-c ' &
/)

! variables for outputing netcdf files
Expand Down
Loading