version
0.0.1
Defines the C++ API for MsPASS
|
Public Member Functions | |
TimeSeriesWGaps () | |
Constructor. More... | |
TimeSeriesWGaps (const TimeSeries &parent) | |
TimeSeriesWGaps (const TimeSeriesWGaps &parent) | |
TimeSeriesWGaps (const TimeSeries &tsp, const DataGap &dgp) | |
TimeSeriesWGaps & | operator= (const TimeSeriesWGaps &parent) |
void | ator (const double tshift) |
void | rtoa (const double tshift) |
void | rtoa () |
void | shift (const double dt) |
void | zero_gaps () |
size_t | memory_use () const |
Public Member Functions inherited from mspass::seismic::TimeSeries | |
TimeSeries () | |
TimeSeries (const size_t nsamples) | |
TimeSeries (const BasicTimeSeries &bts, const Metadata &md) | |
TimeSeries (const Metadata &md) | |
TimeSeries (const mspass::seismic::CoreTimeSeries &d) | |
Construct from lower level CoreTimeSeries. More... | |
TimeSeries (const mspass::seismic::CoreTimeSeries &d, const std::string alg) | |
TimeSeries (const mspass::seismic::BasicTimeSeries &b, const mspass::utility::Metadata &m, const mspass::utility::ProcessingHistory &mcts, const std::vector< double > &d) | |
TimeSeries (const TimeSeries &parent) | |
TimeSeries & | operator= (const TimeSeries &parent) |
TimeSeries & | operator+= (const TimeSeries &d) |
TimeSeries & | operator*= (const double scale) |
TimeSeries & | operator-= (const TimeSeries &d) |
void | load_history (const mspass::utility::ProcessingHistory &h) |
size_t | memory_use () const |
Public Member Functions inherited from mspass::seismic::CoreTimeSeries | |
CoreTimeSeries () | |
CoreTimeSeries (const size_t nsin) | |
CoreTimeSeries (const BasicTimeSeries &bts, const Metadata &md) | |
CoreTimeSeries (const CoreTimeSeries &) | |
void | set_dt (const double sample_interval) |
Set the sample interval. More... | |
void | set_npts (const size_t npts) |
Set the number of samples attribute for data. More... | |
void | sync_npts () |
Sync the number of samples attribute with actual data size. More... | |
void | set_t0 (const double t0in) |
Set the data start time. More... | |
CoreTimeSeries & | operator= (const CoreTimeSeries &parent) |
CoreTimeSeries & | operator+= (const CoreTimeSeries &d) |
Summation operator. More... | |
const CoreTimeSeries | operator+ (const CoreTimeSeries &other) const |
CoreTimeSeries & | operator*= (const double) |
CoreTimeSeries & | operator-= (const CoreTimeSeries &d) |
Subtraction operator. More... | |
const CoreTimeSeries | operator- (const CoreTimeSeries &other) const |
double | operator[] (size_t const sample) const |
Public Member Functions inherited from mspass::seismic::BasicTimeSeries | |
BasicTimeSeries () | |
BasicTimeSeries (const BasicTimeSeries &) | |
virtual | ~BasicTimeSeries () |
Virtual destructor. More... | |
double | time (const int i) const |
int | sample_number (double t) const |
double | endtime () const noexcept |
bool | shifted () const |
double | time_reference () const |
void | force_t0_shift (const double t) |
Force a t0 shift value on data. More... | |
bool | live () const |
bool | dead () const |
void | kill () |
void | set_live () |
double | dt () const |
bool | time_is_UTC () const |
bool | time_is_relative () const |
TimeReferenceType | timetype () const |
double | samprate () const |
size_t | npts () const |
double | t0 () const |
void | set_tref (const TimeReferenceType newtref) |
Force the time standard. More... | |
BasicTimeSeries & | operator= (const BasicTimeSeries &parent) |
Public Member Functions inherited from mspass::utility::Metadata | |
Metadata () | |
Metadata (std::ifstream &ifs, const std::string form=std::string("pf")) | |
Metadata (const Metadata &mdold) | |
virtual | ~Metadata () |
Metadata & | operator= (const Metadata &mdold) |
Metadata & | operator+= (const Metadata &rhs) noexcept |
const Metadata | operator+ (const Metadata &other) const |
double | get_double (const std::string key) const override |
int | get_int (const std::string key) const override |
long | get_long (const std::string key) const |
std::string | get_string (const std::string key) const override |
bool | get_bool (const std::string key) const override |
template<typename T > | |
T | get (const std::string key) const |
template<typename T > | |
T | get (const char *key) const |
Generic get interface for C char array. More... | |
boost::any | get_any (const std::string key) const |
std::string | type (const std::string key) const |
template<typename T > | |
void | put (const std::string key, T val) noexcept |
template<typename T > | |
void | put (const char *key, T val) noexcept |
void | put (const std::string key, const double val) override |
void | put (const std::string key, const int val) override |
void | put (const std::string key, const bool val) override |
void | put (const std::string key, const std::string val) override |
void | put (const char *key, const char *val) |
void | put (std::string key, const char *val) |
void | put_object (const std::string key, const pybind11::object val) |
void | put_int (const std::string key, const int val) |
void | put_string (const std::string key, const std::string val) |
void | put_bool (const std::string key, const bool val) |
void | put_double (const std::string key, const double val) |
void | put_long (const std::string key, const long val) |
void | append_chain (const std::string key, const std::string val, const std::string separator=std::string(":")) |
std::set< std::string > | modified () const |
void | clear_modified () |
Mark all data as unmodified. More... | |
std::set< std::string > | keys () const noexcept |
bool | is_defined (const std::string key) const noexcept |
void | erase (const std::string key) |
std::size_t | size () const noexcept |
std::map< std::string, boost::any >::const_iterator | begin () const noexcept |
std::map< std::string, boost::any >::const_iterator | end () const noexcept |
void | change_key (const std::string oldkey, const std::string newkey) |
Change the keyword to access an attribute. More... | |
Public Member Functions inherited from mspass::utility::ProcessingHistory | |
ProcessingHistory () | |
ProcessingHistory (const std::string jobnm, const std::string jid) | |
ProcessingHistory (const ProcessingHistory &parent) | |
bool | is_empty () const |
bool | is_raw () const |
bool | is_origin () const |
bool | is_volatile () const |
bool | is_saved () const |
size_t | number_of_stages () override |
Return number of processing stages that have been applied to this object. More... | |
void | set_as_origin (const std::string alg, const std::string algid, const std::string uuid, const AtomicType typ, bool define_as_raw=false) |
std::string | new_ensemble_process (const std::string alg, const std::string algid, const AtomicType typ, const std::vector< ProcessingHistory * > parents, const bool create_newid=true) |
void | add_one_input (const ProcessingHistory &data_to_add) |
Add one datum as an input for current data. More... | |
void | add_many_inputs (const std::vector< ProcessingHistory * > &d) |
Define several data objects as inputs. More... | |
void | merge (const ProcessingHistory &data_to_add) |
Merge the history nodes from another. More... | |
void | accumulate (const std::string alg, const std::string algid, const AtomicType typ, const ProcessingHistory &newinput) |
Method to use with a spark reduce algorithm. More... | |
std::string | clean_accumulate_uuids () |
Clean up inconsistent uuids that can be produced by reduce. More... | |
std::string | new_map (const std::string alg, const std::string algid, const AtomicType typ, const ProcessingStatus newstatus=ProcessingStatus::VOLATILE) |
Define this algorithm as a one-to-one map of same type data. More... | |
std::string | new_map (const std::string alg, const std::string algid, const AtomicType typ, const ProcessingHistory &data_to_clone, const ProcessingStatus newstatus=ProcessingStatus::VOLATILE) |
Define this algorithm as a one-to-one map. More... | |
std::string | map_as_saved (const std::string alg, const std::string algid, const AtomicType typ) |
Prepare the current data for saving. More... | |
void | clear () |
std::multimap< std::string, mspass::utility::NodeData > | get_nodes () const |
int | stage () const |
ProcessingStatus | status () const |
std::string | id () const |
std::pair< std::string, std::string > | created_by () const |
NodeData | current_nodedata () const |
std::string | newid () |
int | number_inputs () const |
int | number_inputs (const std::string uuidstr) const |
void | set_id (const std::string newid) |
std::list< mspass::utility::NodeData > | inputs (const std::string id_to_find) const |
Return a list of data that define the inputs to a give uuids. More... | |
ProcessingHistory & | operator= (const ProcessingHistory &parent) |
Public Member Functions inherited from mspass::utility::BasicProcessingHistory | |
BasicProcessingHistory (const std::string jobname, const std::string jobid) | |
BasicProcessingHistory (const BasicProcessingHistory &parent) | |
std::string | jobid () const |
void | set_jobid (const std::string &newjid) |
std::string | jobname () const |
void | set_jobname (const std::string jobname) |
BasicProcessingHistory & | operator= (const BasicProcessingHistory &parent) |
Public Member Functions inherited from mspass::seismic::DataGap | |
DataGap () | |
DataGap (const std::list< mspass::algorithms::TimeWindow > &twlist) | |
DataGap (const DataGap &parent) | |
bool | is_gap (const double ttest) |
bool | has_gap (const mspass::algorithms::TimeWindow twin) |
bool | has_gap () |
void | add_gap (const mspass::algorithms::TimeWindow tw) |
std::list< mspass::algorithms::TimeWindow > | get_gaps () const |
void | clear_gaps () |
Clear gaps. More... | |
int | number_gaps () const |
DataGap | subset (const mspass::algorithms::TimeWindow tw) const |
void | translate_origin (double time_of_new_origin) |
DataGap & | operator= (const DataGap &parent) |
DataGap & | operator+= (const DataGap &other) |
Additional Inherited Members | |
Public Attributes inherited from mspass::seismic::CoreTimeSeries | |
std::vector< double > | s |
Public Attributes inherited from mspass::utility::ProcessingHistory | |
ErrorLogger | elog |
Protected Attributes inherited from mspass::seismic::BasicTimeSeries | |
bool | mlive |
double | mdt |
double | mt0 |
size_t | nsamp |
TimeReferenceType | tref |
bool | t0shift_is_valid |
double | t0shift |
Protected Attributes inherited from mspass::utility::Metadata | |
std::map< std::string, boost::any > | md |
std::set< std::string > | changed_or_set |
Protected Attributes inherited from mspass::utility::ProcessingHistory | |
std::multimap< std::string, mspass::utility::NodeData > | nodes |
Protected Attributes inherited from mspass::utility::BasicProcessingHistory | |
std::string | jid |
std::string | jnm |
Protected Attributes inherited from mspass::seismic::DataGap | |
std::set< mspass::algorithms::TimeWindow, mspass::algorithms::TimeWindowCmp > | gaps |
Holds data gap definitions. We use an STL set object to define data gaps for any time series object derived from this base class. The set is keyed by a TimeWindow which allows a simple, fast way to define a time range with invalid data. | |
|
inline |
Constructor.
Will need a set of conastructors. Requires some thought as how to set gap is an issue.
|
inline |
Partial copy constructor from a plain TimeSeries.
Sometimes we need to build the skeleton of a gappy TimeSeries from a regular TimeSeries. This does that and builds makes a copy of the TimeSeries and creates an empty container that defines the gaps.
|
inline |
Copy constructor.
|
virtual |
Absolute to relative time conversion. Sometimes we want to convert data from absolute time (epoch times) to a relative time standard. Examples are conversions to travel time using an event origin time or shifting to an arrival time reference frame. This operation simply switches the tref variable and alters t0 by tshift.
This method overrides the one in BasicTimeSeries to correctly reference gaps.
tshift | - time shift applied to data before switching data to relative time mode. |
Reimplemented from mspass::seismic::BasicTimeSeries.
References mspass::algorithms::TimeWindow::end, mspass::seismic::Relative, and mspass::algorithms::TimeWindow::start.
size_t mspass::seismic::TimeSeriesWGaps::memory_use | ( | ) | const |
Return an estimate of the memmory use by the data in this object.
Memory consumed by a TimeSeriesWGaps object is needed to implement the sizeof method in python that dask/spark use to manage memory. Without that feature we had memory fault issues. Note the estimate this method returns should not be expected to be exact. The MsPASS implementation or any alternative implementation avoids an exact calculation because it requries an (expensive) traversal of multiple map containers.
References mspass::seismic::TimeSeries::memory_use().
|
virtual |
Relative to absolute time conversion. Sometimes we want to convert data from relative time to to an absolute time standard. An example would be converting segy shot data to something that could be processed like earthquake data in a css3.0 database.
This method returns data previously converted to relative back to absolute using the internally stored time shift attribute.
This method overrides the one in BasicTimeSeries to correctly reference gaps.
Reimplemented from mspass::seismic::BasicTimeSeries.
References mspass::algorithms::TimeWindow::end, mspass::algorithms::TimeWindow::start, and mspass::seismic::UTC.
void mspass::seismic::TimeSeriesWGaps::rtoa | ( | const double | tshift | ) |
Relative to absolute time conversion. Sometimes we want to convert data from relative time to to an absolute time standard. An example would be converting segy shot data to something that could be processed like earthquake data in a css3.0 database. This operation simply switches the tref variable and alters t0 by tshift.
This method overrides the one in BasicTimeSeries to correctly reference gaps.
tshift | - time shift applied to data before switching data to absolute time mode. |
NOTE: This method is maintained only for backward compatibility. May be depricated in favor of method that uses internally stored private shift variable.
References mspass::algorithms::TimeWindow::end, mspass::algorithms::TimeWindow::start, and mspass::seismic::UTC.
|
virtual |
Shift the reference time.
Sometimes we need to shift the reference time t0. An example is a moveout correction. This method shifts the reference time by dt. Note a positive dt means data aligned to zero will be shifted left because relative time is t-t0.
Reimplemented from mspass::seismic::BasicTimeSeries.
void mspass::seismic::TimeSeriesWGaps::zero_gaps | ( | ) |
Force all data inside data gaps to zero.