ocssw
V2022
|
Product.hpp
Go to the documentation of this file.
190 static VisitorAny<char, std::string, float, double, long double, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t,std::vector<int8_t>,
191 std::vector<int16_t>, std::vector<int32_t>, std::vector<int64_t>, std::vector<float>, std::vector<double>,std::vector<uint8_t>, std::vector<uint16_t>, std::vector<uint32_t>, std::vector<uint64_t>> _visitorAny{};
197 Attribute(const std::string &name, const ANY & value, size_t attr_len) : name_{name}, a_value_{value}, attr_len_(attr_len) {}
204 return _visitorAny.apply_visitor(AsDouble{},a_value_); //return boost::apply_visitor(AsDouble{}, value_);
311 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
315 template <typename T, std::enable_if_t<is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
326 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
330 template <typename T, std::enable_if_t<is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
357 template <typename T, typename U, std::enable_if_t<(is_iterable<T> && !is_iterable <U>) && (!std::is_same_v<T, std::string> || !std::is_same_v<U, std::string>), bool> = true>
359 template <typename T, typename U, std::enable_if_t<(!is_iterable<T> && is_iterable <U>) && (!std::is_same_v<T, std::string> || !std::is_same_v<U, std::string>), bool> = true>
361 template <typename T, typename U, std::enable_if_t<(is_iterable<T> && is_iterable <U>) && (!std::is_same_v<T, std::string> || !std::is_same_v<U, std::string>), bool> = true>
363 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
367 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
368 bool operator()(std::string, T) const { return false; /* throw std::invalid_argument("Can't compare std::string to non-std::string"); */ }
369 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
370 bool operator()(T, std::string) const { return false; /* throw std::invalid_argument("Can't compare std::string to non-std::string"); */ }
373 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_integral<U>::value && std::is_signed<T>::value == std::is_signed<U>::value>::type* = nullptr>
375 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_integral<U>::value && !std::is_signed<T>::value && std::is_signed<U>::value>::type* = nullptr>
382 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_integral<U>::value && std::is_signed<T>::value && !std::is_signed<U>::value>::type* = nullptr>
391 template <typename T, typename U, typename std::enable_if<std::is_floating_point<T>::value && std::is_floating_point<U>::value>::type* = nullptr>
393 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_floating_point<U>::value>::type* = nullptr>
395 template <typename T, typename U, typename std::enable_if<std::is_integral<U>::value && std::is_floating_point<T>::value>::type* = nullptr>
399 template <typename T, typename U, std::enable_if_t<(is_iterable<T> && !is_iterable <U>) && (!std::is_same_v<T, std::string> || !std::is_same_v<U, std::string>), bool> = true>
401 template <typename T, typename U, std::enable_if_t<(!is_iterable<T> && is_iterable <U>) && (!std::is_same_v<T, std::string> || !std::is_same_v<U, std::string>), bool> = true>
403 template <typename T, typename U, std::enable_if_t<(is_iterable<T> && is_iterable <U>) && (!std::is_same_v<T, std::string> || !std::is_same_v<U, std::string>), bool> = true>
406 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
410 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
411 bool operator()(std::string, T) const { return false; /* throw std::invalid_argument("Can't compare std::string to non-std::string"); */ }
412 template <typename T, std::enable_if_t<!is_iterable<T> && !std::is_same_v<T, std::string>, bool> = true>
413 bool operator()(T, std::string) const { return false; /* throw std::invalid_argument("Can't compare std::string to non-std::string"); */ }
416 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_integral<U>::value && std::is_signed<T>::value == std::is_signed<U>::value>::type* = nullptr>
418 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_integral<U>::value && !std::is_signed<T>::value && std::is_signed<U>::value>::type* = nullptr>
425 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_integral<U>::value && std::is_signed<T>::value && !std::is_signed<U>::value>::type* = nullptr>
434 template <typename T, typename U, typename std::enable_if<std::is_floating_point<T>::value && std::is_floating_point<U>::value>::type* = nullptr>
436 template <typename T, typename U, typename std::enable_if<std::is_integral<T>::value && std::is_floating_point<U>::value>::type* = nullptr>
438 template <typename T, typename U, typename std::enable_if<std::is_integral<U>::value && std::is_floating_point<T>::value>::type* = nullptr>
446 friend std::ostream& operator<<(std::ostream& out, const AttributeCondition&){return out << "unknown condition";}
465 AttributeRange(const std::string& name, T min, T max) : name_{name}, between_{Between<T>(min, max)} {}
482 template <typename V, std::enable_if_t<!is_iterable<V> && !std::is_same_v<V, std::string>, bool> = true>
484 template <typename V, std::enable_if_t<is_iterable<V> && !std::is_same_v<V, std::string>, bool> = true>
495 static Attribute parse_attribute_any(const rapidjson::Value::ConstMemberIterator &itr, T (*get_attr_rj)(const rapidjson::Value &))
509 std::transform(arr.begin(),arr.end(),std::back_inserter(vec),[&](auto &v){return get_attr_rj(v);});
549 Product(std::string name, const std::initializer_list<Attribute>&& attributes) : name_{name}, attributes_{attributes} {}
550 Product(std::string name, const std::set<Attribute>& attributes) : name_{name}, attributes_{attributes} {}
552 Product(std::string name, const std::set<Attribute>&& attributes, std::vector<std::shared_ptr<AttributeCondition>>&& conditions) : name_{name}, attributes_{attributes}, conditions_{std::move(conditions)} {}
553 Product(std::string name, const std::set<Attribute>& attributes, const std::vector<std::shared_ptr<AttributeCondition>>&& conditions) : name_{name}, attributes_{attributes}, conditions_{conditions} {}
555 Product(std::string name, const std::vector<std::shared_ptr<AttributeCondition>>& conditions) : name_{name}, conditions_{conditions} {}
556 Product(std::string name, std::vector<std::shared_ptr<AttributeCondition>>&& conditions) : name_{name}, conditions_{std::move(conditions)} {}
569 // void add_attribute(std::unique_ptr<Attribute> attr){attributes_.insert(attributes_.end(), std::move(attr));}
575 std::is_permutation(other.attributes().cbegin(), other.attributes().cend(), me.attributes().cbegin(), me.attributes().cend()) &&
576 std::is_permutation(other.conditions().cbegin(), other.conditions().cend(), me.conditions().cbegin(), me.conditions().cend());
597 bool all_matches = std::all_of(match_atts.cbegin(), match_atts.cend(), [this](const auto& o){return attributes_.find(o) != attributes_.end();});
607 all_matches = std::all_of(conditions_.cbegin(), conditions_.cend(), [&match_atts](const auto& c){
608 auto i = std::find_if(match_atts.cbegin(), match_atts.cend(), [&c](const auto& o){return c->matches(o);});
643 static size_t skip_passed_char(const std::string& input, size_t pos, char c, bool in_quotes=false){
756 std::vector<std::shared_ptr<AttributeCondition>> conditions_{}; // pointer for hierarchy, shared for copy-able
761 // static bool attributes_equal( const std::unique_ptr<Attribute>& left, const std::unique_ptr<Attribute>& right){return *left == *right;}
762 // static bool attributes_equal( const Attribute& left, const Attribute& right){return left == right;}
763 // static bool attributes_equal( const std::unique_ptr<Attribute>& left, const std::unique_ptr<Attribute>& right){return *left == *right;}
Definition: Product.hpp:442
virtual ~Attribute()=default
Product(std::string name, const std::set< Attribute > &attributes, const std::vector< std::shared_ptr< AttributeCondition >> &&conditions)
Definition: Product.hpp:553
friend std::ostream & operator<<(std::ostream &out, const Attribute &attribute)
Definition: Product.hpp:216
Definition: Product.hpp:44
void visit(Callable &&callable, LinkedList< ANY, S > &list, Ps... params) const
Definition: Product.hpp:105
bool matches(const Attribute &attribute) const override
Definition: Product.hpp:467
AttributeRange(const std::string &name, T min, T max)
Definition: Product.hpp:465
Definition: Product.hpp:462
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
std::pair< const std::type_index, std::function< void(ANY const &)> > to_any_visitor(F const &f)
Definition: Product.hpp:169
LinkedList(const T &_val, [[maybe_unused]] Ts &... args)
Definition: Product.hpp:68
friend bool operator<(const Attribute &left, const Attribute &right)
Definition: Product.hpp:222
virtual ~AttributeCondition()
Definition: Product.hpp:444
Definition: Variable.hpp:72
void visit(Callable &&callable, R &ret, LinkedList< ANY, S > &list, Ps... params) const
Definition: Product.hpp:121
friend std::ostream & operator<<(std::ostream &out, const AttributeCondition &)
Definition: Product.hpp:446
Definition: Product.hpp:90
bool matches(const std::vector< Product > &other) const
Definition: Product.hpp:578
friend bool operator==(const Attribute &left, const std::string &name)
Definition: Product.hpp:230
static Attribute parse_attribute(const netCDF::NcAtt &att)
const double F
Attribute(const std::string &name, const ANY &value, size_t attr_len)
Definition: Product.hpp:197
std::ostream & operator<<(std::ostream &os, const std::vector< T > &data) noexcept
Definition: Product.hpp:159
std::tuple_element_t< 0, std::tuple< Ts... > > first_type
Definition: Product.hpp:97
friend std::ostream & operator<<(std::ostream &out, const AttributeWild &condition)
Definition: Product.hpp:455
Product(std::string name, const std::set< Attribute > &attributes)
Definition: Product.hpp:550
list(APPEND LIBS ${NETCDF_LIBRARIES}) find_package(GSL REQUIRED) include_directories($
Definition: CMakeLists.txt:8
subroutine os(tamoy, trmoy, pizmoy, tamoyp, trmoyp, palt, phirad, nt, mu, np, rm, gb, rp, xl)
Definition: 6sm1.f:5484
static size_t skip_passed_char(const std::string &input, size_t pos, char c, bool in_quotes=false)
Definition: Product.hpp:643
Definition: Product.hpp:544
static std::vector< Product > parse_list(const std::string &input)
Definition: Product.hpp:666
Definition: Product.hpp:448
Product(std::string name, const std::initializer_list< Attribute > &&attributes)
Definition: Product.hpp:549
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude data
Definition: HISTORY.txt:356
Definition: Product.hpp:193
void insert(std::unordered_set< std::type_index > &found_types)
Definition: Product.hpp:75
bool matches(const Attribute &attribute) const override
Definition: Product.hpp:452
friend std::ostream & operator<<(std::ostream &out, const Product &product)
Definition: Product.hpp:617
virtual bool matches(const Attribute &attribute) const
Definition: Product.hpp:445
std::unordered_set< std::type_index > found_types
Definition: Product.hpp:92
Product(std::string name, const std::set< Attribute > &&attributes, std::vector< std::shared_ptr< AttributeCondition >> &&conditions)
Definition: Product.hpp:552
auto apply_visitor(Callable &&callable, Tanys &&... anys) const
Definition: Product.hpp:137
friend bool operator==(const Product &me, const Product &other)
Definition: Product.hpp:572
Product(std::string name, std::vector< std::shared_ptr< AttributeCondition >> &&conditions)
Definition: Product.hpp:556
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in per delivery and then split off a new MYD_PR03 pcf file for Aqua Added AssociatedPlatformInstrumentSensor to the inventory metadata in MOD01 mcf and MOD03 mcf Created new versions named MYD01 mcf and MYD03 where AssociatedPlatformShortName is rather than Terra The program itself has been changed to read the Satellite Instrument validate it against the input L1A and LUT and to use it determine the correct files to retrieve the ephemeris and attitude data from Changed to produce a LocalGranuleID starting with MYD03 if run on Aqua data Added the Scan Type file attribute to the Geolocation copied from the L1A and attitude_angels to radians rather than degrees The accumulation of Cumulated gflags was moved from GEO_validate_earth_location c to GEO_locate_one_scan c
Definition: HISTORY.txt:464
friend bool operator==(const Attribute &left, const Attribute &right)
Definition: Product.hpp:234
PGE01 indicating that PGE02 PGE01 V6 for and PGE01 V2 for MOD03 were used to produce the granule By convention adopted in all MODIS Terra PGE02 code versions are The fourth digit of the PGE02 version denotes the LUT version used to produce the granule The source of the metadata environment variable ProcessingCenter was changed from a QA LUT value to the Process Configuration A sign used in error in the second order term was changed to a
Definition: HISTORY.txt:424
HISTORY txt for MOD_PR01(step one of PGE01) History follows the following convention needed due to new Aqua ReprocessingActual and the expected LUT revision number from PCF Changed to use PGE version for ProductionHistory Added Archive including ProcessingEnvironment Corrected handling of bad to resovle GSFcd02514 Changed to check staged LUT revision number versus the expected LUT revision number from thereby resolving defect report MODxl02056 This change also avoids the memory access violation reported in MODur00039 Changed the way output arrays were initialized with fill to be more but placed into the L1A output product and thought of as valid packets These packets had an invalid frame count in them and since only the last valid packet of any specific type gets it frame count data written to the output product
Definition: HISTORY.txt:176
LinkedList()=default
Attribute()=default
Product(std::string name, const std::vector< std::shared_ptr< AttributeCondition >> &conditions)
Definition: Product.hpp:555
Definition: DataProvider.hpp:16
a context in which it is NOT documented to do so subscript which cannot be easily calculated when extracting TONS attitude data from the Terra L0 files Corrected several defects in extraction of entrained ephemeris and and as HDF file attributes
Definition: HISTORY.txt:65