ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Namespaces | Classes | Typedefs | Functions
daq::dpm::merge Namespace Reference

Namespaces

 base
 

Classes

class  JsonReporter
 Reports in JSON format. More...
 
class  SimpleReporter
 Reports in unspecified human-readable format. More...
 
class  Formatter
 
class  Sorter
 
class  MergeEvent
 Base class of merge events. More...
 
class  StatusReporter
 Interface to reporter (implementations exist for JSON or human readable) More...
 
class  KeywordFormatter
 
class  KeywordSorter
 
class  KeywordFilter
 Interface to a keyword selector. More...
 
class  KeywordTransform
 
struct  Operations
 
struct  Params
 
struct  SourceNotFoundError
 Source file not found. More...
 
class  TargetSource
 Target FITS file. More...
 
class  FitsFileSource
 Input FITS source file. More...
 
class  FitsKeywordsSource
 Input FITS keywords. More...
 
struct  MockReporter
 
struct  MockFormatter
 
struct  MockSorter
 
struct  MockKeywordProcessor
 
class  TestMergeKeywords
 Fixture that sets up a in-place target FITS file with standard HDU keywords. More...
 

Typedefs

using SourceTypes = std::variant< FitsKeywordsSource, FitsFileSource >
 Variant of the different supported source types. More...
 

Functions

std::optional< KeywordRuleProcessor::DefaultRuleConvert (std::optional<::daq::json::InitialKeywords > const &rhs)
 
fs::path MakeSourcePath (fs::path source, fs::path const &root)
 
std::unique_ptr< KeywordRuleProcessorMakeKeywordRuleProcessor (json::KeywordRules const &rules)
 
int Entrypoint (fs::path const &root, std::optional< fs::path > const &opt_out_path, json::DpSpec const &spec, SourceResolver const &resolver, bool dry_run, bool use_json)
 
int Entrypoint (std::filesystem::path const &root, std::optional< std::filesystem::path > const &dp_path, json::DpSpec const &spec, SourceResolver const &resolver, bool dry_run, bool use_json)
 Validates and loads data sources to the format expected by the merge function. More...
 
fits::KeywordVector CompileKeywords (Operations ops, FitsKeywordsSource const &source)
 
fits::KeywordVector CompileKeywords (Operations ops, FitsFileSource const &source, int hdu_num)
 
fits::KeywordVector CompilePrimaryHduKeywords (Operations ops, TargetSource &target, std::vector< SourceTypes > const &sources)
 Compiles unique keywords and formats primary HDU keywords. More...
 
std::vector< fits::LiteralKeywordFormatKeywords (fits::KeywordVector::const_iterator begin, fits::KeywordVector::const_iterator end, KeywordFormatter &fmt)
 
template<class Container >
void LogKeywords (log4cplus::Logger const &logger, Container const &keywords)
 
void MergePrimaryHduKeywords (Operations ops, Params const &params, TargetSource &target, std::vector< SourceTypes > const &sources, bool dry_run)
 
void CopyExtensions (Operations ops, TargetSource &target, FitsFileSource const &source, bool dry_run)
 Copy all extensions from source to target. More...
 
void MergeHduExtensions (Operations ops, TargetSource &target, std::vector< SourceTypes > const &sources, bool dry_run)
 
void UpdateChecksums (Operations ops, TargetSource &target, bool dry_run)
 
void Merge (Operations ops, Params const &params, TargetSource &target, std::vector< SourceTypes > const &sources, bool dry_run)
 Merge sources into the target target. More...
 
void MergePrimaryHduKeywords (Operations ops, TargetSource &target, std::vector< SourceTypes > const &sources, bool dry_run)
 
 TEST_F (TestMergeKeywords, MergeEmptyStillSortsKeywords)
 
 TEST_F (TestMergeKeywords, NoSourceStillSortsPrimaryHdu)
 Test that primary HDU keywords are sorted. More...
 
 TEST_F (TestMergeKeywords, MergeSingleKeywordList)
 Test merging some keywords from a single source. More...
 
 TEST_F (TestMergeKeywords, MergeFailsIfTransformsCauseInvalidKeyword)
 

Class Documentation

◆ daq::dpm::merge::MergeEvent

class daq::dpm::merge::MergeEvent

Base class of merge events.

Definition at line 19 of file merge.hpp.

◆ daq::dpm::merge::Operations

struct daq::dpm::merge::Operations

Definition at line 88 of file merge.hpp.

Class Members
KeywordFormatter & keyword_formatter
KeywordSorter & keyword_sorter
Logger const & logger
StatusReporter & status_reporter

◆ daq::dpm::merge::Params

struct daq::dpm::merge::Params

Definition at line 100 of file merge.hpp.

Class Members
string arcfile
string origfile

Typedef Documentation

◆ SourceTypes

Variant of the different supported source types.

Definition at line 196 of file sources.hpp.

Function Documentation

◆ CompileKeywords() [1/2]

fits::KeywordVector daq::dpm::merge::CompileKeywords ( Operations  ops,
FitsFileSource const &  source,
int  hdu_num 
)

Definition at line 28 of file merge.cpp.

◆ CompileKeywords() [2/2]

fits::KeywordVector daq::dpm::merge::CompileKeywords ( Operations  ops,
FitsKeywordsSource const &  source 
)

Definition at line 15 of file merge.cpp.

◆ CompilePrimaryHduKeywords()

fits::KeywordVector daq::dpm::merge::CompilePrimaryHduKeywords ( Operations  ops,
TargetSource target,
std::vector< SourceTypes > const &  sources 
)

Compiles unique keywords and formats primary HDU keywords.

Definition at line 51 of file merge.cpp.

◆ Convert()

std::optional<KeywordRuleProcessor::DefaultRule> daq::dpm::merge::Convert ( std::optional<::daq::json::InitialKeywords > const &  rhs)

Definition at line 29 of file entrypoint.cpp.

◆ CopyExtensions()

void daq::dpm::merge::CopyExtensions ( Operations  ops,
TargetSource target,
FitsFileSource const &  source,
bool  dry_run 
)

Copy all extensions from source to target.

Definition at line 187 of file merge.cpp.

◆ Entrypoint() [1/2]

int daq::dpm::merge::Entrypoint ( fs::path const &  root,
std::optional< fs::path > const &  opt_out_path,
json::DpSpec const &  spec,
SourceResolver const &  resolver,
bool  dry_run,
bool  use_json 
)

Definition at line 145 of file entrypoint.cpp.

◆ Entrypoint() [2/2]

int daq::dpm::merge::Entrypoint ( std::filesystem::path const &  root,
std::optional< std::filesystem::path > const &  dp_path,
json::DpSpec const &  spec,
SourceResolver const &  resolver,
bool  dry_run,
bool  use_json 
)

Validates and loads data sources to the format expected by the merge function.

◆ FormatKeywords()

std::vector<fits::LiteralKeyword> daq::dpm::merge::FormatKeywords ( fits::KeywordVector::const_iterator  begin,
fits::KeywordVector::const_iterator  end,
KeywordFormatter fmt 
)

Definition at line 105 of file merge.cpp.

◆ LogKeywords()

template<class Container >
void daq::dpm::merge::LogKeywords ( log4cplus::Logger const &  logger,
Container const &  keywords 
)

Definition at line 123 of file merge.cpp.

◆ MakeKeywordRuleProcessor()

std::unique_ptr<KeywordRuleProcessor> daq::dpm::merge::MakeKeywordRuleProcessor ( json::KeywordRules const &  rules)

Definition at line 101 of file entrypoint.cpp.

◆ MakeSourcePath()

fs::path daq::dpm::merge::MakeSourcePath ( fs::path  source,
fs::path const &  root 
)

Definition at line 94 of file entrypoint.cpp.

◆ Merge()

void daq::dpm::merge::Merge ( Operations  ops,
Params const &  params,
TargetSource target,
std::vector< SourceTypes > const &  sources,
bool  dry_run 
)

Merge sources into the target target.

Parameters
[in,out]targetFITS file target.
sourcesInput sources.

Definition at line 286 of file merge.cpp.

◆ MergeHduExtensions()

void daq::dpm::merge::MergeHduExtensions ( Operations  ops,
TargetSource target,
std::vector< SourceTypes > const &  sources,
bool  dry_run 
)

Definition at line 237 of file merge.cpp.

◆ MergePrimaryHduKeywords() [1/2]

void daq::dpm::merge::MergePrimaryHduKeywords ( Operations  ops,
Params const &  params,
TargetSource target,
std::vector< SourceTypes > const &  sources,
bool  dry_run 
)

Definition at line 129 of file merge.cpp.

◆ MergePrimaryHduKeywords() [2/2]

void daq::dpm::merge::MergePrimaryHduKeywords ( Operations  ops,
TargetSource target,
std::vector< SourceTypes > const &  sources,
bool  dry_run 
)

◆ TEST_F() [1/4]

daq::dpm::merge::TEST_F ( TestMergeKeywords  ,
MergeEmptyStillSortsKeywords   
)

Definition at line 112 of file testMerge.cpp.

◆ TEST_F() [2/4]

daq::dpm::merge::TEST_F ( TestMergeKeywords  ,
MergeFailsIfTransformsCauseInvalidKeyword   
)

Definition at line 179 of file testMerge.cpp.

◆ TEST_F() [3/4]

daq::dpm::merge::TEST_F ( TestMergeKeywords  ,
MergeSingleKeywordList   
)

Test merging some keywords from a single source.

Definition at line 149 of file testMerge.cpp.

◆ TEST_F() [4/4]

daq::dpm::merge::TEST_F ( TestMergeKeywords  ,
NoSourceStillSortsPrimaryHdu   
)

Test that primary HDU keywords are sorted.

Definition at line 130 of file testMerge.cpp.

◆ UpdateChecksums()

void daq::dpm::merge::UpdateChecksums ( Operations  ops,
TargetSource target,
bool  dry_run 
)

Definition at line 261 of file merge.cpp.