neic-glass3  1.4.6
Public Member Functions | Protected Member Functions | List of all members
glasscore::CPick Class Reference

glasscore pick class More...

#include <Pick.h>

Collaboration diagram for glasscore::CPick:
Collaboration graph

Public Member Functions

 CPick ()
 CPick default constructor. More...
 
 CPick (std::shared_ptr< CSite > pickSite, double pickTime, std::string pickIdString, double backAzimuth, double slowness)
 CPick advanced constructor. More...
 
 CPick (std::shared_ptr< CSite > pickSite, double pickTime, std::string pickIdString, std::string source, double backAzimuth, double slowness, std::string phase, double phaseProb, double distance, double distanceProb, double azimuth, double azimuthProb, double depth, double depthProb, double magnitude, double magnitudeProb)
 CPick advanced constructor. More...
 
 CPick (std::shared_ptr< json::Object > pick, CSiteList *pSiteList)
 CPick advanced constructor. More...
 
 ~CPick ()
 CPick destructor. More...
 
void clear ()
 CPick clear function. More...
 
bool initialize (std::shared_ptr< CSite > pickSite, double pickTime, std::string pickIdString, std::string source, double backAzimuth, double slowness, std::string phase, double phaseProb, double distance, double distanceProb, double azimuth, double azimuthProb, double depth, double depthProb, double magnitude, double magnitudeProb)
 CPick initialization function. More...
 
void addHypoReference (std::shared_ptr< CHypo > hyp, bool force=false)
 Add hypo reference to this pick. More...
 
void removeHypoReference (std::shared_ptr< CHypo > hyp)
 Remove hypo reference to this pick. More...
 
void removeHypoReference (std::string pid)
 Remove hypo specific reference to this pick by id. More...
 
bool nucleate (CPickList *parentThread)
 Attempt to nucleate new hypo based on the addition of this pick. More...
 
double getBackAzimuth () const
 Get the optional back azimuth related to this pick. More...
 
double getSlowness () const
 Get the optional slowness related to this pick. More...
 
const std::shared_ptr< json::Object > & getJSONPick () const
 Get input JSON pick message. More...
 
const std::shared_ptr< CHypogetHypoReference () const
 Get the current hypo referenced by this pick. More...
 
const std::shared_ptr< CSitegetSite () const
 Get the site for this pick. More...
 
const std::string & getPhaseName () const
 Get the phase name for this pick. More...
 
const std::string & getID () const
 Get the ID of this pick. More...
 
double getTPick () const
 Get the arrival time for this pick. More...
 
void setTPick (double tPick)
 Set the arrival time for this pick. More...
 
double getTSort () const
 Get the sorting time for this pick. More...
 
void setTSort (double newTSort)
 Set the sorting time for this pick. More...
 
double getTInsertion () const
 Get the insertion time for this pick. More...
 
double getTFirstAssociation () const
 Get the first assoc time for this pick. More...
 
double getTNucleation () const
 Get the nucleation time for this pick. More...
 
const std::string & getClassifiedPhase () const
 Get the classified phase for this pick. More...
 
double getClassifiedPhaseProbability () const
 Get the classified phase probability for this pick. More...
 
double getClassifiedDistance () const
 Get the classified distance for this pick. More...
 
double getClassifiedDistanceProbability () const
 Get the classified distance probability for this pick. More...
 
double getClassifiedAzimuth () const
 Get the classified azimuth for this pick. More...
 
double getClassifiedAzimuthProbability () const
 Get the classified azimuth probability for this pick. More...
 
double getClassifiedDepth () const
 Get the classified depth for this pick. More...
 
double getClassifiedDepthProbability () const
 Get the classified depth probability for this pick. More...
 
double getClassifiedMagnitude () const
 Get the classified magnitude for this pick. More...
 
double getClassifiedMagnitudeProbability () const
 Get the classified magnitude probability for this pick. More...
 
const std::string & getSource () const
 Get the source for this pick. More...
 

Protected Member Functions

void clearHypoReference ()
 Remove hypo reference to this pick. More...
 
void setTFirstAssociation ()
 Set the first-assoc time for this pick to Now. More...
 
void setTNucleation ()
 Set the nucleation time for this pick to Now. More...
 

Detailed Description

glasscore pick class

The CPick class is the class that encapsulates everything necessary to represent a waveform arrival pick, including arrival time, phase id, and an unique identifier. The CPick class is also a node in the detection graph database.

CPick contains functions to support nucleation of a new event based on the pick.

CPick maintains a graph database link between it and the the site (station) the pick was made at.

CPick also maintains a vector of CHypo objects represent the graph database links between this pick and various hypocenters. A single pick may be linked to multiple hypocenters

CPick uses smart pointers (std::shared_ptr).

Constructor & Destructor Documentation

glasscore::CPick::CPick ( )

CPick default constructor.

The default constructor for the CPick class. Initializes members to default values.

glasscore::CPick::CPick ( std::shared_ptr< CSite pickSite,
double  pickTime,
std::string  pickIdString,
double  backAzimuth,
double  slowness 
)

CPick advanced constructor.

An advanced constructor for the CPick class. This function initializes members to the provided values.

Parameters
pickSite- A shared pointer to a CSite object that the pick was made at
pickTime- A double containing the pick arrival time
pickIdString- A std::string containing the external pick id.
backAzimuth- A double containing the optional back azimuth, std::numeric_limits<double>::quiet_NaN() to omit
slowness- A double containing the optional slowness, std::numeric_limits<double>::quiet_NaN() to omit
glasscore::CPick::CPick ( std::shared_ptr< CSite pickSite,
double  pickTime,
std::string  pickIdString,
std::string  source,
double  backAzimuth,
double  slowness,
std::string  phase,
double  phaseProb,
double  distance,
double  distanceProb,
double  azimuth,
double  azimuthProb,
double  depth,
double  depthProb,
double  magnitude,
double  magnitudeProb 
)

CPick advanced constructor.

An advanced constructor for the CPick class. This function initializes members to the provided values.

Parameters
pickSite- A shared pointer to a CSite object that the pick was made at
pickTime- A double containing the pick arrival time
pickIdString- A std::string containing the external pick id.
source- A std::string containing the pick source.
backAzimuth- A double containing the optional back azimuth, std::numeric_limits<double>::quiet_NaN() to omit
slowness- A double containing the optional slowness, std::numeric_limits<double>::quiet_NaN() to omit
phase- A std::string containing the optional classified phase, empty string to omit.
phaseProb- A double containing the optional classified phase probability, std::numeric_limits<double>::quiet_NaN() to omit
distance- A double containing the optional classified distance, std::numeric_limits<double>::quiet_NaN() to omit
distanceProb- A double containing the optional classified distance probability, std::numeric_limits<double>::quiet_NaN() to omit
azimuth- A double containing the optional classified azimuth, std::numeric_limits<double>::quiet_NaN() to omit
azimuthProb- A double containing the optional classified azimuth probability, std::numeric_limits<double>::quiet_NaN() to omit
depth- A double containing the optional classified depth, std::numeric_limits<double>::quiet_NaN() to omit
depthProb- A double containing the optional classified depth probability, std::numeric_limits<double>::quiet_NaN() to omit
magnitude- A double containing the optional classified magnitude, std::numeric_limits<double>::quiet_NaN() to omit
magnitudeProb- A double containing the optional classified magnitude probability, std::numeric_limits<double>::quiet_NaN() to omit
glasscore::CPick::CPick ( std::shared_ptr< json::Object >  pick,
CSiteList pSiteList 
)

CPick advanced constructor.

An advanced constructor for the CPick class. This function initializes members to the values parsed from the provided json object and using the provided pointer to a CSiteList class to lookup the pick station.

Parameters
pick- A shared pointer to a json::Object to containing the data to construct the pick from
pSiteList- A pointer to the CSiteList class to use when looking up the pick station
glasscore::CPick::~CPick ( )

CPick destructor.

Member Function Documentation

void glasscore::CPick::addHypoReference ( std::shared_ptr< CHypo hyp,
bool  force = false 
)

Add hypo reference to this pick.

Adds a weak_ptr reference to the given hypo to this pick, representing a graph database link between this pick and a hypocenter. If the pick is already linked to a hypocenter, the new link will be ignored unless force is set to true.

Note that this pick may or may not also be included in other hypocenter pick data lists, but this pick will only link to a single hypocenter

Parameters
hyp- A std::shared_ptr to an object containing the hypocenter to link.
force- A boolean flag indicating whether to force the association, defaults to false.
void glasscore::CPick::clear ( )

CPick clear function.

void glasscore::CPick::clearHypoReference ( )
protected

Remove hypo reference to this pick.

Remove any existing weak_ptr reference to a hypo from this pick, breaking the graph database link between this pick and a hypocenter.

Note that this pick may or may not still be included in other hypocenter pick data lists.

double glasscore::CPick::getBackAzimuth ( ) const

Get the optional back azimuth related to this pick.

Returns
Returns a double value containing the optional back azimuth, or std::numeric_limits<double>::quiet_NaN() if no back azimuth was provided
double glasscore::CPick::getClassifiedAzimuth ( ) const

Get the classified azimuth for this pick.

Returns
Returns a double containing the pick classified azimuth
double glasscore::CPick::getClassifiedAzimuthProbability ( ) const

Get the classified azimuth probability for this pick.

Returns
Returns a double containing the pick classified azimuth probability
double glasscore::CPick::getClassifiedDepth ( ) const

Get the classified depth for this pick.

Returns
Returns a double containing the pick classified depth
double glasscore::CPick::getClassifiedDepthProbability ( ) const

Get the classified depth probability for this pick.

Returns
Returns a double containing the pick classified depth probability
double glasscore::CPick::getClassifiedDistance ( ) const

Get the classified distance for this pick.

Returns
Returns a double containing the pick classified distance
double glasscore::CPick::getClassifiedDistanceProbability ( ) const

Get the classified distance probability for this pick.

Returns
Returns a double containing the pick classified distance probability
double glasscore::CPick::getClassifiedMagnitude ( ) const

Get the classified magnitude for this pick.

Returns
Returns a double containing the pick classified magnitude
double glasscore::CPick::getClassifiedMagnitudeProbability ( ) const

Get the classified magnitude probability for this pick.

Returns
Returns a double containing the pick classified magnitude probability
const std::string & glasscore::CPick::getClassifiedPhase ( ) const

Get the classified phase for this pick.

Returns
Return a std::string containing the pick phase
double glasscore::CPick::getClassifiedPhaseProbability ( ) const

Get the classified phase probability for this pick.

Returns
Returns a double containing the pick classified phase probability
const std::shared_ptr< CHypo > glasscore::CPick::getHypoReference ( ) const

Get the current hypo referenced by this pick.

Note that this pick may or may not also be included in other hypocenter pick data lists, but this pick will only link to a single hypocenter

Returns
Return a shared_ptr to the CHypo referenced by this pick, or NULL if no hypo is referenced
const std::string & glasscore::CPick::getID ( ) const

Get the ID of this pick.

Returns
Return a std::string containing the pick ID
const std::shared_ptr< json::Object > & glasscore::CPick::getJSONPick ( ) const

Get input JSON pick message.

Returns
Return a shared_ptr to a json::Object containing the pick message
const std::string & glasscore::CPick::getPhaseName ( ) const

Get the phase name for this pick.

Returns
Return a std::string containing the pick phase name
const std::shared_ptr< CSite > glasscore::CPick::getSite ( ) const

Get the site for this pick.

Returns
Return a shared_ptr to a CSite object containing the site this pick was made at
double glasscore::CPick::getSlowness ( ) const

Get the optional slowness related to this pick.

Returns
Returns a double value containing the optional slowness, or std::numeric_limits<double>::quiet_NaN() if no slowness was provided
const std::string & glasscore::CPick::getSource ( ) const

Get the source for this pick.

Returns
Return a std::string containing the picksource
double glasscore::CPick::getTFirstAssociation ( ) const

Get the first assoc time for this pick.

Returns
Returns a double containing the time in Gregorian seconds when the pick was first associated with an event.
double glasscore::CPick::getTInsertion ( ) const

Get the insertion time for this pick.

Returns
Returns a double containing the pick insertion time into Glass in Gregorian seconds
double glasscore::CPick::getTNucleation ( ) const

Get the nucleation time for this pick.

Returns
Returns a double containing the time in Gregorian seconds when this pick was used as keystone for nucleation
double glasscore::CPick::getTPick ( ) const

Get the arrival time for this pick.

Returns
Return a double containing the pick arrival time
double glasscore::CPick::getTSort ( ) const

Get the sorting time for this pick.

Returns
Returns an double containing the pick sort time in Gregorian seconds
bool glasscore::CPick::initialize ( std::shared_ptr< CSite pickSite,
double  pickTime,
std::string  pickIdString,
std::string  source,
double  backAzimuth,
double  slowness,
std::string  phase,
double  phaseProb,
double  distance,
double  distanceProb,
double  azimuth,
double  azimuthProb,
double  depth,
double  depthProb,
double  magnitude,
double  magnitudeProb 
)

CPick initialization function.

Initializes pick class to provided values.

Parameters
pickSite- A shared pointer to a CSite object that the pick was made at
pickTime- A double containing the pick arrival time
pickIdString- A std::string containing the external pick id.
source- A std::string containing the pick source.
backAzimuth- A double containing the optional back azimuth, std::numeric_limits<double>::quiet_NaN() to omit
slowness- A double containing the optional slowness, std::numeric_limits<double>::quiet_NaN() to omit
phase- A std::string containing the optional classified phase, empty string to omit.
phaseProb- A double containing the optional classified phase probability, std::numeric_limits<double>::quiet_NaN() to omit
distance- A double containing the optional classified distance, std::numeric_limits<double>::quiet_NaN() to omit
distanceProb- A double containing the optional classified distance probability, std::numeric_limits<double>::quiet_NaN() to omit
azimuth- A double containing the optional classified azimuth, std::numeric_limits<double>::quiet_NaN() to omit
azimuthProb- A double containing the optional classified azimuth probability, std::numeric_limits<double>::quiet_NaN() to omit
depth- A double containing the optional classified depth, std::numeric_limits<double>::quiet_NaN() to omit
depthProb- A double containing the optional classified depth probability, std::numeric_limits<double>::quiet_NaN() to omit
magnitude- A double containing the optional classified magnitude, std::numeric_limits<double>::quiet_NaN() to omit
magnitudeProb- A double containing the optional classified magnitude probability, std::numeric_limits<double>::quiet_NaN() to omit
Returns
Returns true if successful, false otherwise.
bool glasscore::CPick::nucleate ( CPickList parentThread)

Attempt to nucleate new hypo based on the addition of this pick.

Attempt to nucleate a new hypo based on the addition of this pick. By scanning all nodes linked to this pick's site, producing a list of triggers. Then, for the best trigger for each web, try to generate a new hypo, performing a fast location/prune using hypo->anneal

Parameters
parentThread- A pointer to the parent CPickList thread to allow nucleate to call the CPickList thread status update function, the owner of this pointer is the CPickList object
Returns
Returns true if successful, false otherwise
void glasscore::CPick::removeHypoReference ( std::shared_ptr< CHypo hyp)

Remove hypo reference to this pick.

Remove a weak_ptr reference to the given hypo from this pick, breaking the graph database link between this pick and the hypocenter.

Note that this pick may or may not still be included in other hypocenter pick data lists.

Parameters
hyp- A std::shared_ptr to an object containing the hypocenter to unlink.
void glasscore::CPick::removeHypoReference ( std::string  pid)

Remove hypo specific reference to this pick by id.

Remove a weak_ptr reference to the given hypo id from this pick, breaking the graph database link between this pick and the hypocenter.

Note that this pick may or may not still be included in other hypocenter pick data lists.

Parameters
pid- A std::string identifying the the hypocenter to unlink.
void glasscore::CPick::setTFirstAssociation ( )
protected

Set the first-assoc time for this pick to Now.

void glasscore::CPick::setTNucleation ( )
protected

Set the nucleation time for this pick to Now.

void glasscore::CPick::setTPick ( double  tPick)

Set the arrival time for this pick.

Parameters
tPick- a double containing the pick arrival time
void glasscore::CPick::setTSort ( double  newTSort)

Set the sorting time for this pick.

Parameters
newTSort- a double containing the pick sort time in Gregorian seconds

The documentation for this class was generated from the following files: