Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
275 commits
Select commit Hold shift + click to select a range
b165236
Fixed strange issue that happened while applying filters. Removed som…
rmclaren Nov 9, 2021
0051a0e
Updated a bunch of unit tests so that they would work with the latest…
rmclaren Nov 16, 2021
c655f4a
updated test output files to work with latest version of ioda
rmclaren Nov 18, 2021
8644963
Added unit test and now time the runtime.
rmclaren Dec 17, 2021
25982ab
Fixed a couple more unit tests.
rmclaren Dec 21, 2021
2b81f86
Added .dump files to gitlfs
rmclaren Dec 22, 2021
0dabeb8
removed uneeded file
rmclaren Dec 22, 2021
9eb5f62
BUFR2IODA conversion for AMSU-A and MHS Radiance data (#713)
emilyhcliu Dec 22, 2021
1679444
Update README.md
rmclaren Dec 28, 2021
ef43b58
Test and enhance two yaml files for adpsfc snow and sevcrs data (#736)
YoulongXia-NOAA Dec 29, 2021
7dfe9ef
Reduce the size of test files for amsua, mhs and iasi. Update the co…
emilyhcliu Jan 27, 2022
92aedb7
Merged in latest changes from develop.
rmclaren Jan 31, 2022
a48e36a
Removed uneeded files I missed during merge.
rmclaren Jan 31, 2022
aa1f4ff
Initial checkin of query classes with a lot of placeholder code
rmclaren Feb 2, 2022
a723efc
Got data collection mostly working.
rmclaren Feb 8, 2022
f655842
Starting to work end to end. Need to fix exportdims and revisit code …
rmclaren Feb 9, 2022
a815020
Merge branch 'feature/query' of https://github.com/JCSDA-internal/iod…
rmclaren Feb 10, 2022
a9983fc
Fixed issue where targets and masks were being copied unecessarily.
rmclaren Feb 10, 2022
af1304a
Feature/adpupa prepbufr (#794)
PraveenKumar-NOAA Feb 11, 2022
48f5189
Got a bunch of unit tests working.
rmclaren Feb 11, 2022
eebbf26
add aircft profiles to feature/query
nicholasesposito Feb 16, 2022
81a63a1
Fixed non-working functional unit tests.
rmclaren Mar 4, 2022
3432e9c
Merge branch 'feature/query' of https://github.com/JCSDA-internal/iod…
rmclaren Mar 4, 2022
6402f03
Merge branch 'feature/query' into feature/query_cxx
rmclaren Mar 4, 2022
2159242
Added unit test for simple groupby example.
rmclaren Mar 8, 2022
ee81939
Merge branch 'feature/query' of https://github.com/JCSDA-internal/iod…
rmclaren Mar 8, 2022
69a2f72
Merge branch 'feature/query' of https://github.com/JCSDA-internal/iod…
rmclaren Mar 9, 2022
7378b39
Merge branch 'feature/query' into feature/query_cxx
rmclaren Mar 9, 2022
598ebf6
Made simple groupby test work. Fixed related bugs.
rmclaren Mar 10, 2022
2406042
Added unit test for bufr files with missing fields.
rmclaren Mar 11, 2022
d8240c0
Added unit test for sfcshp data
rmclaren Mar 13, 2022
81931e3
accidentaly messed up the bufr-mhs test. this fixes it
rmclaren Mar 14, 2022
430850c
Integrated latest bug fixes from the feature/query branch.
rmclaren Mar 14, 2022
f083af6
Merge branch 'feature/query' of https://github.com/JCSDA-internal/iod…
rmclaren Mar 14, 2022
85c1a3e
Merge branch 'feature/query' into feature/query_cxx
rmclaren Mar 14, 2022
d16bf12
Fixed bug were we weren't checking for empty sequence counts.
rmclaren Mar 14, 2022
6e158c7
added adpupa tests
rmclaren Mar 14, 2022
68bc140
Merge branch 'feature/query' of https://github.com/JCSDA-internal/iod…
rmclaren Mar 14, 2022
6c9f1d6
Merge branch 'feature/query' into feature/query_cxx
rmclaren Mar 14, 2022
eeb0896
Fixed bugs that prevented adpupa from working.
rmclaren Mar 15, 2022
552aceb
Getting much closer to having adpupa groupby example working.
rmclaren Mar 22, 2022
d74796c
fixed final bug to get adpupa groupby case to work the same way.
rmclaren Mar 22, 2022
26ab396
Removed some uneeded code.
rmclaren Mar 22, 2022
56a452c
Merged latest from develop, and made it work with the latest from NCE…
rmclaren Mar 23, 2022
b86c4da
Reduce the size of the ADPUPA test input furrther
emilyhcliu Mar 23, 2022
9da4fb3
Merge branch 'feature/query_cxx' of https://github.com/JCSDA-internal…
rmclaren Mar 30, 2022
da9c483
Removed undesired include from legacy bufr code.
rmclaren Mar 31, 2022
5153474
Removed undesired include from legacy bufr code.
rmclaren Mar 31, 2022
8300c35
Removed undesired include from legacy bufr code.
rmclaren Mar 31, 2022
a052afb
Removed undesired include from legacy bufr code.
rmclaren Mar 31, 2022
418b1f4
Removed undesired include from legacy bufr code.
rmclaren Mar 31, 2022
e83ff00
Removed undesired include from legacy bufr code. Fixed some copyright…
rmclaren Mar 31, 2022
6a892fd
Changed the way data provider works (no longer a singleton). Minor cl…
rmclaren Apr 4, 2022
c683b4b
Added print_queries tool to the ioda-converter project.
rmclaren Apr 5, 2022
fb5f07f
Improved situation arrising from missing string fields.
rmclaren Apr 6, 2022
067390d
Improved detection of string fields.
rmclaren Apr 6, 2022
efa2763
Moved table logic out of the print_quiries function. Fixed bug were i…
rmclaren Apr 8, 2022
0a79cb3
Merge branch 'develop' into feature/query_cxx
rmclaren Apr 11, 2022
ccbbeb6
Replace nlocs with Location, reduce the size of ADPUPA.prepbufr and ……
emilyhcliu Apr 11, 2022
f09a98c
Merge branch 'feature/query_cxx' of https://github.com/JCSDA-internal…
rmclaren Apr 11, 2022
d403b75
Reverted ADPUPA bufr file to smaller one.
rmclaren Apr 11, 2022
dff7251
Fixed compiler warnings
rmclaren Apr 11, 2022
eca2524
Fixed code style (norm) issues.
rmclaren Apr 11, 2022
d723ac0
Added doc strings to query code.
rmclaren Apr 12, 2022
20eb76b
Feature/query cxx praveen (#893)
PraveenKumar-NOAA Apr 13, 2022
6fe7e43
Added white space
rmclaren Apr 13, 2022
664c2bf
Change dimension name to following unified IODA naming convention (#…
emilyhcliu Apr 13, 2022
394ae09
Merge branch 'feature/query_cxx' of https://github.com/JCSDA-internal…
rmclaren Apr 13, 2022
b5d4cdc
Fixed bug when there were more than one subset in the file. Added abi…
rmclaren Apr 18, 2022
b55c75d
Updated print queries so it no longer uses colors but prints the dime…
rmclaren Apr 25, 2022
b98c09d
Chenged some maps to unordered_maps as they are better performance wise.
rmclaren Apr 26, 2022
3122f9a
Feature/query cxx as (#914)
AshleyStanfield-NOAA May 6, 2022
da75624
Modify unit attribute in BUFR2IODA converter and bug fix for satellit…
emilyhcliu May 9, 2022
24d6a3e
Fixed issue where non-existing query with index would cause a crash. …
rmclaren May 17, 2022
68e94ec
Fixed some norm test failures.
rmclaren May 17, 2022
6a5043e
Fixed all the unit tests
rmclaren May 18, 2022
724b104
Made change so that there is always one group_by field whcih applies …
rmclaren May 23, 2022
9657fb2
Removed uneeded test
rmclaren May 23, 2022
107376f
Merge branch 'develop' into feature/query_cxx
emilyhcliu May 24, 2022
f76dbc8
Improved some of the code to do with finding the data object to group…
rmclaren May 24, 2022
bcda337
Merge branch 'feature/query_cxx' of https://github.com/JCSDA-internal…
rmclaren May 24, 2022
c80d02c
Fixed bug in print queries were fixed repeats were being missed.
rmclaren May 25, 2022
29a65b3
update two yaml files via query_cxx (#906)
YoulongXia-NOAA May 26, 2022
9325c5b
Feature/query cxx mhs (#960)
emilyhcliu Jun 2, 2022
a0dd8e1
Feature/query cxx amsua (#958)
emilyhcliu Jun 2, 2022
4bd2e8c
Feature/query cxx iasi (#966)
emilyhcliu Jun 7, 2022
ac14e75
Feature/query cxx nick e adpsfc (#904)
nicholasesposito Jun 7, 2022
f611e3a
Feature/query cxx atovs (#963)
emilyhcliu Jun 14, 2022
4adeaef
Added code for automated type selection.
rmclaren Jun 15, 2022
afbcb8f
Merge branch 'develop' into feature/query_cxx
srherbener Jun 17, 2022
a518afe
Removed check for unit type mismatch.
rmclaren Jun 24, 2022
9bba0bf
Fixed bug with string fields.
rmclaren Jun 27, 2022
b8165a7
Missing values now depend directly on the types (always max value for…
rmclaren Jun 28, 2022
297b19a
Updated DatetimeVariable.cpp code for optional value of Minute (#949)
PraveenKumar-NOAA Jul 12, 2022
b4a32e4
Automatic type selection based on NCEPLIB-bufr refernece, scale and u…
rmclaren Jul 25, 2022
65ffefb
Added target.h and updated cmakelists.txt
rmclaren Jul 25, 2022
3aecf36
updated mhs test file
rmclaren Jul 25, 2022
53b6e41
Merge branch 'feature/query_cxx' into feature/query_cxx_types
rmclaren Jul 25, 2022
92e46f3
Added way to manually override the type.
rmclaren Jul 27, 2022
230ad33
Print queries now displays type information.
rmclaren Jul 27, 2022
bf8606e
Fixed issue with discovering if field is an integer.
rmclaren Jul 27, 2022
c2fc683
Added some doc strings. Fixed readme.
rmclaren Jul 28, 2022
a6e38a2
Improved the handling of data types when doing transforms.
rmclaren Jul 28, 2022
2bd39d0
Fixed issue where transforms were being applied to missing value values.
rmclaren Aug 4, 2022
8de9b84
Got it kinda working.
rmclaren Aug 4, 2022
a92d54b
slight improvemetn
rmclaren Aug 4, 2022
b1d0647
slight improvement
rmclaren Aug 4, 2022
2be7961
Merged latest from develop branch
rmclaren Aug 8, 2022
36419c6
Added support for the latest changes to NCEPLIB bufr
rmclaren Aug 8, 2022
d7d3f91
Merge branch 'develop' into feature/query_cxx
srherbener Aug 9, 2022
3ec5043
Updated calls to NCEPLIB-bufr
rmclaren Aug 10, 2022
aafc721
Now uses OOPS logging.
rmclaren Aug 12, 2022
df7d5c8
Merge branch 'feature/query_cxx' of https://github.com/JCSDA-internal…
rmclaren Aug 12, 2022
4fb7bae
merged from feature/query_cxx
rmclaren Aug 12, 2022
22c73b6
Changed things back to using a NCEPLIB function to get table b data i…
rmclaren Aug 12, 2022
27a670a
Updated for latest NCEPLIB-bufr enhancements branch. It removed get_t…
rmclaren Aug 19, 2022
a53f0e1
Fixed some comments
rmclaren Aug 22, 2022
03bbffd
cast time to seconds instead of dividing by 1000
rmclaren Aug 22, 2022
dccf5a4
fixed norm test failure
rmclaren Aug 22, 2022
a76894e
made exit into exception
rmclaren Aug 22, 2022
dfc55d7
using back inserter to append to sequence path
rmclaren Aug 22, 2022
fbadda3
fixed error message.
rmclaren Aug 22, 2022
703b087
fixed error message.
rmclaren Aug 22, 2022
482f684
added prepbufr to git lfs
rmclaren Aug 22, 2022
aff8124
removed line continuation characters.
rmclaren Aug 22, 2022
bdd5c9b
replaced 10e10 with missing value
rmclaren Aug 22, 2022
f3fe27e
accidentally deleted line of code. added it back
rmclaren Aug 22, 2022
adf9c7e
changed print time function back tot he original.
rmclaren Aug 22, 2022
a2f7e65
using gsl::narrow instead of simpoe static cast
rmclaren Aug 22, 2022
39bfe36
Enhanced vector product function
rmclaren Aug 22, 2022
ec02de9
Pulled out missing value into a Constants.h file to avoid duplication.
rmclaren Aug 22, 2022
d4905fe
fixed some comments
rmclaren Aug 22, 2022
509af0f
fixed file permissions
rmclaren Aug 22, 2022
03dadc4
Added try catch statements to main functions. Fixed warning.
rmclaren Aug 22, 2022
06fb678
pre reserve some memory
rmclaren Aug 23, 2022
79ad913
removed unused test from CMakeLists.txt file.
rmclaren Aug 23, 2022
1360fd9
fixed norm check issues
rmclaren Aug 23, 2022
8dff03a
Added include of unordered map as some compilers were not finding it.
rmclaren Aug 29, 2022
950e3c9
Additions from previous branch
nicholasesposito Aug 31, 2022
d823c86
merged latest from develop
rmclaren Aug 31, 2022
a5a1b1b
Reverted unintended changes to files in ncar-bufr2nc-fortran and lib-…
rmclaren Aug 31, 2022
4c43af3
Fixed bug that invovled parsing the bufr table data incorrectly. Basi…
rmclaren Sep 1, 2022
f4477bf
Fixed bug in print queries as it was not trimming subset trims proper…
rmclaren Sep 1, 2022
37c0e49
merged latest from query_cxx. fixed issue in print queries where it w…
rmclaren Sep 1, 2022
71f2046
Fixed some warnings and errors that happen with the CLANG compiler.
rmclaren Sep 1, 2022
5281c18
Merge branch 'develop' into feature/query_cxx
srherbener Sep 1, 2022
ba1b34b
Enable the C++14 standard for C++ compiles. (#1036)
srherbener Sep 1, 2022
2cf589b
Fixed some code review issues that Cory Martin broght up.
rmclaren Sep 2, 2022
e49879a
Merge branch 'feature/query_cxx' of https://github.com/JCSDA-internal…
rmclaren Sep 2, 2022
71d2c26
updated docs for DataObject::print function
rmclaren Sep 2, 2022
c78b93e
commented in line that was accidentally commented out
rmclaren Sep 2, 2022
6c29f1f
Revert "commented in line that was accidentally commented out"
rmclaren Sep 2, 2022
f92e4e5
Added back missing tests from the develop branch.
rmclaren Sep 2, 2022
cdecff3
Moved test_iodaconv_generic_gnssro_bufr back to where it was before (…
rmclaren Sep 2, 2022
0327d35
merged latest from feature/query_cxx
rmclaren Sep 6, 2022
25b31d9
Merge branch 'develop' into feature/query_cxx
CoryMartin-NOAA Sep 8, 2022
66ee993
Fixed failing unit tests
rmclaren Sep 8, 2022
f396537
updated mhs unit test with dimension source to test this feature.
rmclaren Sep 8, 2022
6a563eb
Moved applicable create dimension functions to be private scope.
rmclaren Sep 8, 2022
cb80b94
Update unit tests files and fixed some bugs so everything passes now.
rmclaren Sep 9, 2022
09c01c7
Fixed issue caused by code review comment fix that caused bufr2ioda.x…
rmclaren Sep 9, 2022
4e14eb9
Fixed exception handler in print_queries.x.
rmclaren Sep 12, 2022
8d5d8e4
Merged latest from feature/query_cxx
rmclaren Sep 12, 2022
5367711
Updated readme with a type example.
rmclaren Sep 12, 2022
12e8ab8
got the latest from feature/query_cxx
rmclaren Sep 12, 2022
10bf033
newest updates. aircar works, aircft doesnt
nicholasesposito Sep 12, 2022
eccc632
Merge branch 'feature/query_cxx_types' into feature/query_labeled_dims
rmclaren Sep 13, 2022
bc048c4
fixed test
rmclaren Sep 13, 2022
2f7d0c6
Updated code to take advantage of types branch
rmclaren Sep 13, 2022
905bd44
Updated docs strings for createDimension functions
rmclaren Sep 13, 2022
4d1e6be
Updated a unit test to check that dimesnion sourcing code is working.
rmclaren Sep 13, 2022
411e74b
Works except adds datetime -1
nicholasesposito Sep 13, 2022
01f2e1f
Added some doc strings to ioda encoder.
rmclaren Sep 13, 2022
db27ad3
Pushing files onto git-lfs
rmclaren Sep 15, 2022
9c65f78
Removed support for unsigned types as Fortran does not support them.
rmclaren Sep 16, 2022
a3c82a3
pushing files into lfs
rmclaren Sep 16, 2022
09064f7
Updated with latest from feature/query_cxx_types
rmclaren Sep 16, 2022
a36a577
Added some validation for the dimension source fields.
rmclaren Sep 19, 2022
3cf0f98
Enhanced some doc strings
rmclaren Sep 19, 2022
96b30cc
Fixed norm test issue
rmclaren Sep 19, 2022
663a2ce
Updated the readme.
rmclaren Sep 19, 2022
e65cc3e
Fixed some bugs with the datetime object. Added some validation.
rmclaren Sep 20, 2022
c183def
Made modifications so that the the messages would be filtered based o…
rmclaren Sep 20, 2022
eb3c877
Added configuration parameter called subsets to explicitly limit the …
rmclaren Sep 21, 2022
8b37ae5
Improved the implemention a little.
rmclaren Sep 21, 2022
202676d
Fixed coding norm issues
rmclaren Sep 21, 2022
09d4b8b
Renamed query function to accumulate.
rmclaren Sep 21, 2022
3317006
Added some yaml files for testing purposes (still need to make the te…
rmclaren Sep 21, 2022
5ae5209
resolved merge conflicts
rmclaren Sep 22, 2022
be80e19
Merge branch 'feature/query_cxx_types' into feature/query_labeled_dims
rmclaren Sep 22, 2022
0565659
Merge branch 'feature/query_labeled_dims' into feature/query_datetime…
rmclaren Sep 22, 2022
40f0516
Updated adpsfc types (#1034)
nicholasesposito Sep 22, 2022
0966327
Added unit tests
rmclaren Sep 22, 2022
93e9894
most recent update
nicholasesposito Sep 22, 2022
2818ec7
updated readme
rmclaren Sep 22, 2022
ea8126e
added getAsFloat back.
rmclaren Sep 26, 2022
8f1e3fb
Merge branch 'develop' into feature/query_cxx_types
rmclaren Sep 26, 2022
598b003
Merge branch 'feature/query_cxx_types' into feature/query_labeled_dims
rmclaren Sep 26, 2022
0d4f5f3
Merge branch 'feature/query_labeled_dims' into feature/query_datetime…
rmclaren Sep 26, 2022
81390ce
Merge branch 'develop' into feature/query_datetime_subset_fix
nicholasesposito Sep 27, 2022
f88e35f
Merge branch 'feature/query_datetime_subset_fix' into feature/query_c…
nicholasesposito Sep 27, 2022
5d02287
Final Edits 20220927
nicholasesposito Sep 27, 2022
cd2c3a0
Update in/out/yamls and CMakelists
nicholasesposito Sep 28, 2022
ea3d27d
update CMakelists
nicholasesposito Sep 28, 2022
2616525
update outputs
nicholasesposito Sep 28, 2022
e54a265
update acft pro output
nicholasesposito Sep 28, 2022
b98a982
update cmake
nicholasesposito Sep 28, 2022
23885b5
update bufr_specifying_subsets.nc
nicholasesposito Sep 28, 2022
a2a85ec
update apro with aircraftFlightPhase
nicholasesposito Sep 28, 2022
c5340e2
update noAMDAR yaml with qualityInformation group
nicholasesposito Sep 28, 2022
42f2d7d
percentConfidence info update
nicholasesposito Sep 28, 2022
af2d807
QualityIndicator -> QualityInformation
nicholasesposito Sep 28, 2022
279429f
update noamdar
nicholasesposito Sep 29, 2022
728fc25
merge develop and fix conflicts
nicholasesposito Sep 29, 2022
cd451b8
conflicts re-fixed
nicholasesposito Sep 29, 2022
5c16e96
update output
nicholasesposito Sep 29, 2022
8027e91
update intput
nicholasesposito Sep 29, 2022
04ebd15
update bufr_specifying_subsets.nc
nicholasesposito Sep 29, 2022
2b8f5ea
2020 -> 2022, add std atm comment
nicholasesposito Sep 30, 2022
5453120
remove fort.20
nicholasesposito Sep 30, 2022
6621d9a
update yamls/outputs so vars are clearer
nicholasesposito Oct 4, 2022
a15e13c
Added isMissing method to dataObject
rmclaren Oct 7, 2022
e5f1b46
most recent updates AA
nicholasesposito Oct 7, 2022
52a5536
Merge branch 'feature/query_cxx_types_NE_aircraftAltitude' of https:/…
nicholasesposito Oct 7, 2022
58978fc
Major updates
nicholasesposito Oct 11, 2022
54d0859
Clean up
nicholasesposito Oct 11, 2022
ec1c863
AA.h get rid of Lat
nicholasesposito Oct 11, 2022
8927fde
Add validation / check for dims size
nicholasesposito Oct 20, 2022
d38f081
2020 -> 2022 in yamls
nicholasesposito Oct 20, 2022
40485ff
Merge branch 'develop' into feature/query_cxx_types_NE_aircraftAltitude
BenjaminRuston Oct 24, 2022
d23d416
newest yamls
nicholasesposito Nov 1, 2022
78b1151
Merge branch 'feature/query_cxx_types_NE_aircraftAltitude' of https:/…
nicholasesposito Nov 1, 2022
fd1c588
update yaml no lat
nicholasesposito Nov 1, 2022
12ed5d3
Refactored AircraftAltitudeVariable a little.
rmclaren Nov 1, 2022
c212011
Fixed bug. AircAircraftIndicatedAltitude only used with Pressure.
rmclaren Nov 1, 2022
b29bc00
update yaml outs
nicholasesposito Nov 1, 2022
bb167a2
Norm test fixes
rmclaren Nov 1, 2022
846f15d
Merge branch 'feature/query_cxx_types_NE_aircraftAltitude' of https:/…
nicholasesposito Nov 1, 2022
00aff4a
update with Metadata/rhpccf
nicholasesposito Nov 8, 2022
f4363aa
update testoutput name
nicholasesposito Nov 8, 2022
8c594ee
RH
nicholasesposito Nov 8, 2022
7b921ae
rm old aircft profiles yaml,bufr,outputnc
nicholasesposito Nov 8, 2022
3f20c99
Merge branch 'develop' into feature/query_cxx_types_NE_aircraftAltitude
nicholasesposito Dec 1, 2022
baf90b1
fix {
nicholasesposito Dec 1, 2022
6732c6f
Merge branch 'develop' into feature/query_cxx_types_NE_aircraftAltitude
srherbener Dec 1, 2022
8131875
AircraftAltitudeVariable.cpp numbers dot f
nicholasesposito Dec 5, 2022
ef4d09d
fieldValues updates
Dec 6, 2022
518d9f9
update noamdar
nicholasesposito Dec 7, 2022
107da96
coding norms
nicholasesposito Dec 7, 2022
7a0830c
fixed comment on isMissing function
rmclaren Dec 7, 2022
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
7 changes: 7 additions & 0 deletions src/bufr/BufrParser/Exports/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "Splits/CategorySplit.h"
#include "Variables/QueryVariable.h"
#include "Variables/DatetimeVariable.h"
#include "Variables/AircraftAltitudeVariable.h"
#include "Variables/TimeoffsetVariable.h"
#include "Variables/Transforms/Transform.h"
#include "Variables/Transforms/TransformBuilder.h"
Expand All @@ -37,6 +38,7 @@ namespace
const char* Timeoffset = "timeoffset";
const char* Query = "query";
const char* GroupByField = "group_by"; // Deprecated
const char* AircraftAltitude = "aircraftAltitude";
const char* Type = "type";
} // namespace Variable

Expand Down Expand Up @@ -133,6 +135,11 @@ namespace Ingester
auto dtconf = subConf.getSubConfiguration(ConfKeys::Variable::Datetime);
variable = std::make_shared<DatetimeVariable>(key, groupByField, dtconf);
}
else if (subConf.has(ConfKeys::Variable::AircraftAltitude))
{
auto dtconf = subConf.getSubConfiguration(ConfKeys::Variable::AircraftAltitude);
variable = std::make_shared<AircraftAltitudeVariable>(key, groupByField, dtconf);
}
else if (subConf.has(ConfKeys::Variable::Timeoffset))
{
auto dtconf = subConf.getSubConfiguration(ConfKeys::Variable::Timeoffset);
Expand Down
208 changes: 208 additions & 0 deletions src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
/*
* (C) Copyright 2022 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 <string>

#include <ostream>
#include <time.h>
#include <vector>

#include "eckit/exception/Exceptions.h"

#include "DataObject.h"
#include "AircraftAltitudeVariable.h"


namespace
{
namespace ConfKeys
{
const char* Pressure = "pressure";
const char* AircraftIndicatedAltitude = "aircraftIndicatedAltitude";
const char* PressureAltitudeRelativeToMeanSeaLevel =
"pressureAltitudeRelativeToMeanSeaLevel";
const char* FlightLevel = "flightLevel";
const char* Height = "height";
const char* HeightOrAltitude = "heightOrAltitude";
const char* FlightLevelST = "flightLevelST";
} // namespace ConfKeys

const std::vector<std::string> FieldNames = {ConfKeys::Pressure,
ConfKeys::AircraftIndicatedAltitude,
ConfKeys::PressureAltitudeRelativeToMeanSeaLevel,
ConfKeys::FlightLevel,
ConfKeys::Height,
ConfKeys::HeightOrAltitude,
ConfKeys::FlightLevelST};
} // namespace


namespace Ingester
{
AircraftAltitudeVariable::AircraftAltitudeVariable(const std::string& exportName,
const std::string& groupByField,
const eckit::LocalConfiguration &conf) :
Variable(exportName),
groupByField_(groupByField),
conf_(conf)
{
initQueryMap();
}

std::shared_ptr<DataObjectBase> AircraftAltitudeVariable::exportData(const BufrDataMap& map)
{
checkKeys(map);

std::unordered_map<std::string, std::shared_ptr<DataObjectBase>> includedFieldMap;
std::vector<std::string> includedFields;

std::shared_ptr<DataObjectBase> referenceObj = nullptr;
for (const auto& fieldName : FieldNames)
{
if (conf_.has(fieldName))
{
includedFieldMap.insert({fieldName, map.at(getExportKey(fieldName))});
includedFields.push_back(fieldName);
}
}

referenceObj = (*includedFieldMap.begin()).second;

// Validation: make sure the dimensions are consistent
auto path = referenceObj->getPath();
for (const auto& fieldName : FieldNames)
{
if (includedFieldMap.find(fieldName) != includedFieldMap.end() &&
includedFieldMap[fieldName]->getPath() != path)
{
std::ostringstream errStr;
errStr << "Inconsistent dimensions found in source data.";
throw eckit::BadParameter(errStr.str());
}
}

std::vector<float> aircraftAlts;
aircraftAlts.resize(referenceObj->size(), DataObject<float>::missingValue());

for (size_t idx = 0; idx < referenceObj->size(); idx++)
{
std::cout << "idx = " << idx << std::endl;
for (auto nameIt = includedFields.rbegin(); nameIt != includedFields.rend(); ++nameIt)
{
const auto& fieldName = *nameIt;
const auto& fieldValues = includedFieldMap.at(fieldName);
if (fieldName == ConfKeys::Pressure)
{
if (!fieldValues->isMissing(idx))
{
auto value = fieldValues->getAsFloat(idx);
if (value < 22630.0f)
{
aircraftAlts[idx] =
11000.0f - (std::log1p(value / 22630.0f) / 0.0001576106f);
std::cout << "section 1" << std::endl;
}
else
{
aircraftAlts[idx] =
(1.0f - powf((value / 101325.0f),
(1.0f / 5.256f))) * (288.15f / 0.0065f);
std::cout << "section 2" << std::endl;
}
}
else if (includedFieldMap.find(ConfKeys::AircraftIndicatedAltitude)
!= includedFieldMap.end())
{
if (!includedFieldMap[ConfKeys::AircraftIndicatedAltitude]->isMissing(idx))
{
aircraftAlts[idx] =
includedFieldMap[ConfKeys::AircraftIndicatedAltitude]->getAsFloat(idx);
std::cout << "section 3" << std::endl;
}
}
}
else if (fieldName == ConfKeys::AircraftIndicatedAltitude)
{
// This variable is only used in conjunction with pressure.
continue;
std::cout << "section 4" << std::endl;
}
else if (!fieldValues->isMissing(idx))
{
std::cout << " fieldValues = " << fieldValues << std::endl;
aircraftAlts[idx] = fieldValues->getAsFloat(idx);
std::cout << "section 5" << std::endl;
}
}
std::cout << "AA = " << aircraftAlts[idx] << std::endl;
}

return std::make_shared<DataObject<float>>(aircraftAlts,
getExportName(),
groupByField_,
referenceObj->getDims(),
referenceObj->getPath(),
referenceObj->getDimPaths());
}

void AircraftAltitudeVariable::checkKeys(const BufrDataMap& map)
{
std::vector<std::string> requiredKeys;
for (const auto& fieldName : FieldNames)
{
if (conf_.has(fieldName))
{
requiredKeys.push_back(getExportKey(fieldName));
}
}

std::stringstream errStr;
errStr << "Query ";

bool isKeyMissing = false;
for (const auto& key : requiredKeys)
{
if (map.find(key) == map.end())
{
isKeyMissing = true;
errStr << key;
break;
}
}

errStr << " could not be found during export of AircraftAltitude object.";

if (isKeyMissing)
{
throw eckit::BadParameter(errStr.str());
}
}

QueryList AircraftAltitudeVariable::makeQueryList() const
{
auto queries = QueryList();

for (const auto& fieldName : FieldNames)
{
if (conf_.has(fieldName))
{
QueryInfo info;
info.name = getExportKey(fieldName);
info.query = conf_.getString(fieldName);
info.groupByField = groupByField_;
queries.push_back(info);
}
}

return queries;
}

std::string AircraftAltitudeVariable::getExportKey(const std::string& name) const
{
return getExportName() + "_" + name;
}
} // namespace Ingester
52 changes: 52 additions & 0 deletions src/bufr/BufrParser/Exports/Variables/AircraftAltitudeVariable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* (C) Copyright 2022 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.
*/

#pragma once

#include <string>
#include <vector>
#include <memory>

#include "eckit/config/LocalConfiguration.h"

#include "Variable.h"


namespace Ingester
{
/// \brief Exports parsed data as aircraftAltitudes using specified Mnemonics
class AircraftAltitudeVariable final : public Variable
{
public:
AircraftAltitudeVariable() = delete;
AircraftAltitudeVariable(const std::string& exportName,
const std::string& groupByField,
const eckit::LocalConfiguration& conf);

~AircraftAltitudeVariable() final = default;

/// \brief Get the configured mnemonics and turn them into AircraftAltitude
/// \param map BufrDataMap that contains the parsed data for each mnemonic
std::shared_ptr<DataObjectBase> exportData(const BufrDataMap& map) final;

/// \brief Get a list of queries for this variable
QueryList makeQueryList() const final;

private:
/// \brief For field
std::string groupByField_;

/// \brief The configuration
const eckit::LocalConfiguration conf_;

/// \brief makes sure the bufr data map has all the required keys.
void checkKeys(const BufrDataMap& map);

/// \brief get the export key string
std::string getExportKey(const std::string& name) const;
};
} // namespace Ingester
2 changes: 2 additions & 0 deletions src/bufr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ list(APPEND _ingester_srcs
BufrParser/Exports/Variables/Variable.h
BufrParser/Exports/Variables/DatetimeVariable.h
BufrParser/Exports/Variables/DatetimeVariable.cpp
BufrParser/Exports/Variables/AircraftAltitudeVariable.h
BufrParser/Exports/Variables/AircraftAltitudeVariable.cpp
BufrParser/Exports/Variables/TimeoffsetVariable.h
BufrParser/Exports/Variables/TimeoffsetVariable.cpp
BufrParser/Exports/Variables/QueryVariable.h
Expand Down
12 changes: 12 additions & 0 deletions src/bufr/DataObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ namespace Ingester
/// \return Float data.
virtual float getAsFloat(const Location& loc) const = 0;

/// \brief Is the element at the location the missing value.
/// \return bool data.
virtual bool isMissing(const Location& loc) const = 0;

/// \brief Get the data at the index as an int.
/// \return Int data.
virtual int getAsInt(size_t idx) const = 0;
Expand Down Expand Up @@ -338,6 +342,14 @@ namespace Ingester
/// \return String data.
std::string getAsString(const Location& loc) const final { return _getAsString(loc); }

/// \brief Is the element at the location the missing value.
/// \param loc The coordinate for the data point (ex: if data 2d then loc {2,4} gets data
/// at that coordinate).
/// \return bool data.
bool isMissing(const Location& loc) const final
{
return get(loc) == missingValue();
}

/// \brief Get the data at the index into the internal 1d array as a int. This function
/// gives you direct access to the internal data and doesn't account for dimensional
Expand Down
47 changes: 47 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ if( iodaconv_bufr_ENABLED )
testinput/gdas.t12z.adpsfc.prepbufr
testinput/gdas.t06z.adpsfc.tm00.bufr_d
testinput/gdas.t12z.adpsfc.tm00.bufr_d
testinput/gdas.t12z.aircar.tm00.bufr_d
testinput/gdas.t12z.aircft.tm00.bufr_d
testinput/gdas.t12z.acft_profiles.prepbufr
testinput/bufr_ncep_snow_adpsfc.yaml
testinput/bufr_read_2_dim_blocks.yaml
testinput/bufr_ncep_1bamua.yaml
Expand All @@ -193,6 +196,10 @@ if( iodaconv_bufr_ENABLED )
testinput/bufr_ncep_esamua.yaml
testinput/bufr_ncep_esmhs.yaml
testinput/bufr_ncep_satwind_avhrr.yaml
testinput/bufr_ncep_aircar.yaml
testinput/bufr_ncep_aircft_AMDAR103.yaml
testinput/bufr_ncep_aircft_noAMDAR103.yaml
testinput/bufr_ncep_prepbufr_aircft.yaml
testinput/bufr_read_wmo_radiosonde.yaml
testinput/bufr_satwnd_old_format.yaml
testinput/bufr_satwnd_new_format.yaml
Expand Down Expand Up @@ -245,6 +252,10 @@ if( iodaconv_bufr_ENABLED )
testoutput/gdas.t12z.adpsfc.prepbufr.nc
testoutput/gdas.t12z.adpsfc.tm00.nc
testoutput/gdas.t06z.adpsfc_snow.tm00.nc
testoutput/gdas.t12z.aircar.tm00.nc
testoutput/gdas.t12z.aircft_AMDAR103.tm00.nc
testoutput/gdas.t12z.aircft_noAMDAR103.tm00.nc
testoutput/gdas.t12z.acft_profiles.prepbufr.nc
testoutput/gdas.t00z.sevcsr.tm00.nc
testoutput/bufr_read_2_dim_blocks.nc
testoutput/bufr_read_wmo_radiosonde.nc
Expand Down Expand Up @@ -1204,6 +1215,42 @@ if(iodaconv_bufr_ENABLED)
gdas.t06z.adpsfc_snow.tm00.nc ${IODA_CONV_COMP_TOL_ZERO}
DEPENDS bufr2ioda.x )

ecbuild_add_test( TARGET test_iodaconv_bufr_ncep_aircar2ioda
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need 4 new tests for this? seems excessive but I'm not sure...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's one for each yaml

  1. aircar bufr
  2. aircft amdar bufr
  3. aircft no amdar bufr
  4. aircft prepbufr (acft_profiles)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Up to you all if you want to keep them. There are slight differences that I think are important but I don't know enough about other non-aircraft yamls to know if they're important to keep in.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

At the unit level testing it's more about code coverage. So if you think that having the four tests will hit more of the "if" branches in your code, then it might be worth keeping all these. The tradeoff of course is that we want the tier1 ctests to run as fast as possible so tiny test cases are best.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The tests take a fraction of a second each. I think we should keep them, as they also test different portions of aircraftAltitude.

TYPE SCRIPT
COMMAND bash
ARGS ${CMAKE_BINARY_DIR}/bin/iodaconv_comp.sh
netcdf
"${CMAKE_BINARY_DIR}/bin/bufr2ioda.x testinput/bufr_ncep_aircar.yaml"
gdas.t12z.aircar.tm00.nc ${IODA_CONV_COMP_TOL_ZERO}
DEPENDS bufr2ioda.x )

ecbuild_add_test( TARGET test_iodaconv_bufr_ncep_aircft_noamdar2ioda
TYPE SCRIPT
COMMAND bash
ARGS ${CMAKE_BINARY_DIR}/bin/iodaconv_comp.sh
netcdf
"${CMAKE_BINARY_DIR}/bin/bufr2ioda.x testinput/bufr_ncep_aircft_noAMDAR103.yaml"
gdas.t12z.aircft_noAMDAR103.tm00.nc ${IODA_CONV_COMP_TOL_ZERO}
DEPENDS bufr2ioda.x )

ecbuild_add_test( TARGET test_iodaconv_bufr_ncep_aircft_amdar2ioda
TYPE SCRIPT
COMMAND bash
ARGS ${CMAKE_BINARY_DIR}/bin/iodaconv_comp.sh
netcdf
"${CMAKE_BINARY_DIR}/bin/bufr2ioda.x testinput/bufr_ncep_aircft_AMDAR103.yaml"
gdas.t12z.aircft_AMDAR103.tm00.nc ${IODA_CONV_COMP_TOL_ZERO}
DEPENDS bufr2ioda.x )

ecbuild_add_test( TARGET test_iodaconv_prepbufr_ncep_aircftprofiles2ioda
TYPE SCRIPT
COMMAND bash
ARGS ${CMAKE_BINARY_DIR}/bin/iodaconv_comp.sh
netcdf
"${CMAKE_BINARY_DIR}/bin/bufr2ioda.x testinput/bufr_ncep_prepbufr_aircft.yaml"
gdas.t12z.acft_profiles.prepbufr.nc ${IODA_CONV_COMP_TOL_ZERO}
DEPENDS bufr2ioda.x )


ecbuild_add_test( TARGET test_iodaconv_bufr_read_2_dim_blocks
TYPE SCRIPT
Expand Down
Binary file removed test/testinput/acft_profiles.data_thinned
Binary file not shown.
Loading