Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ingest-bufr-sensor-height' into …
Browse files Browse the repository at this point in the history
…making_ingest_api
  • Loading branch information
johtoblan committed Mar 22, 2024
2 parents afb6903 + 9c7fda9 commit 88dfa01
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
27 changes: 15 additions & 12 deletions ingest/src/ingest/bufr/ESOHBufr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ std::list<std::string> ESOHBufr::msg() const {
v.y() == 51) // PRESSURE, PRESSURE REDUCED TO MEAN SEA LEVEL
{
ret.push_back(addMessage(ci, subset_message, sensor_level_active,
sensor_level));
sensor_level, "point"));
}
if (v.y() == 9) // Geopotential height, TODO: unit conversion?
{
Expand All @@ -499,7 +499,7 @@ std::list<std::string> ESOHBufr::msg() const {
sensor_level = 10.0;
}
ret.push_back(addMessage(ci, subset_message, sensor_level_active,
sensor_level));
sensor_level, "point"));
}

break;
Expand All @@ -512,7 +512,7 @@ std::list<std::string> ESOHBufr::msg() const {
sensor_level = 2.0;
}
ret.push_back(addMessage(ci, subset_message, sensor_level_active,
sensor_level));
sensor_level, "point"));
}

break;
Expand All @@ -526,7 +526,7 @@ std::list<std::string> ESOHBufr::msg() const {
sensor_level = 10.0;
}
ret.push_back(addMessage(ci, subset_message, sensor_level_active,
sensor_level));
sensor_level, "point"));
}

break;
Expand All @@ -537,7 +537,7 @@ std::list<std::string> ESOHBufr::msg() const {

if (v.y() == 42 || v.y() == 43 || v.y() == 45) {
ret.push_back(addMessage(ci, subset_message, sensor_level_active,
sensor_level));
sensor_level, "point"));
}

break;
Expand Down Expand Up @@ -578,7 +578,7 @@ std::list<std::string> ESOHBufr::msg() const {

ret.push_back(addMessage(ci, subset_message,
sensor_level_active, sensor_level,
&start_datetime));
"sum", &start_datetime));
}
}

Expand Down Expand Up @@ -613,7 +613,7 @@ std::list<std::string> ESOHBufr::msg() const {
static_cast<double>(std::numeric_limits<uint64_t>::max())) {
ret.push_back(addMessage(ci, subset_message,
sensor_level_active, sensor_level,
&start_datetime));
"sum", &start_datetime));
}
}
}
Expand Down Expand Up @@ -643,7 +643,7 @@ std::list<std::string> ESOHBufr::msg() const {
static_cast<double>(std::numeric_limits<uint64_t>::max())) {
ret.push_back(addMessage(ci, subset_message,
sensor_level_active, sensor_level,
&start_datetime));
"sun", &start_datetime));
}
}

Expand All @@ -658,7 +658,7 @@ std::list<std::string> ESOHBufr::msg() const {
static_cast<double>(std::numeric_limits<uint64_t>::max())) {
ret.push_back(addMessage(ci, subset_message,
sensor_level_active, sensor_level,
&start_datetime));
"sum", &start_datetime));
}
}
++ci; // [ 0 14 16 ] NET RADIATION, INTEGRATED OVER PERIOD SPECIFIED
Expand Down Expand Up @@ -717,7 +717,7 @@ bool ESOHBufr::addDescriptor(

bool ESOHBufr::addContent(const Descriptor &v, std::string cf_name,
char sensor_level_active, double sensor_level,
rapidjson::Document &message) const {
std::string fn, rapidjson::Document &message) const {

const DescriptorMeta *meta = v.getMeta();
rapidjson::Document::AllocatorType &message_allocator =
Expand All @@ -731,6 +731,9 @@ bool ESOHBufr::addContent(const Descriptor &v, std::string cf_name,
is >> id;

message["id"].SetString(id.c_str(), id.length(), message_allocator);
if (fn.size()) {
message_properties["function"].SetString(fn.c_str(), message_allocator);
}

if (sensor_level_active) {
std::stringstream ss;
Expand Down Expand Up @@ -896,7 +899,7 @@ bool ESOHBufr::setStartDateTime(struct tm *start_meas_datetime,
std::string ESOHBufr::addMessage(std::list<Descriptor>::const_iterator ci,
rapidjson::Document &message,
char sensor_level_active, double sensor_level,
time_t *start_datetime) const {
std::string fn, time_t *start_datetime) const {
std::string ret;

rapidjson::Document new_message;
Expand All @@ -907,7 +910,7 @@ std::string ESOHBufr::addMessage(std::list<Descriptor>::const_iterator ci,
if (start_datetime)
setStartDateTime(gmtime(start_datetime), new_message);

addContent(*ci, cf_names[*ci].first, sensor_level_active, sensor_level,
addContent(*ci, cf_names[*ci].first, sensor_level_active, sensor_level, fn,
new_message);

rapidjson::StringBuffer sb;
Expand Down
5 changes: 3 additions & 2 deletions ingest/src/ingest/bufr/ESOHBufr.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ class ESOHBufr : public NorBufr {
private:
std::string addMessage(std::list<Descriptor>::const_iterator ci,
rapidjson::Document &message, char sensor_level_active,
double sensor_level, time_t *start_datetime = 0) const;
double sensor_level, std::string fn = "",
time_t *start_datetime = 0) const;
bool addDescriptor(Descriptor &D, rapidjson::Value &dest,
rapidjson::Document::AllocatorType &) const;
bool addContent(const Descriptor &D, std::string cf_name,
char sensor_level_active, double sensor_level,
char sensor_level_active, double sensor_level, std::string fn,
rapidjson::Document &) const;
bool setPlatformName(std::string v, rapidjson::Document &message,
bool force = true) const;
Expand Down
1 change: 1 addition & 0 deletions ingest/src/ingest/schemas/bufr_to_e_soh_message.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"license": "http//spdx.org/licenses/CC-BY-4.0(CC-BY-4.0)",
"naming_authority": "naming_authority",
"level": "0.0m",
"function": "point",
"period": "PT0S",
"content": {
"encoding": "utf-8",
Expand Down

1 comment on commit 88dfa01

@github-actions
Copy link

Choose a reason for hiding this comment

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

API Unit Test Coverage Report
FileStmtsMissCoverMissing
\_\_init\_\_.py00100% 
datastore_pb2.py584621%24–69
datastore_pb2_grpc.py432347%37–52, 85–87, 92–94, 99–101, 106–108, 112–136, 174, 191, 208, 225
dependencies.py683647%16, 26–27, 34, 41, 52, 62–69, 77–84, 89–96, 104–121
grpc_getter.py16850%15–16, 20–23, 27–29
locustfile.py15150%1–31
main.py32584%40, 50–51, 61–62
metadata_endpoints.py381366%29, 46–109, 113
custom_geo_json
   edr_feature_collection.py60100% 
formatters
   \_\_init\_\_.py70100% 
   covjson.py50492%71, 86–89
routers
   \_\_init\_\_.py00100% 
   edr.py934057%58–131, 159–172, 201, 212–218, 257–278
   records.py00100% 
TOTAL42619055% 

API Unit Test Coverage Summary

Tests Skipped Failures Errors Time
16 0 💤 9 ❌ 0 🔥 2.347s ⏱️

Please sign in to comment.