neic-glass3  1.4.6
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
glasscore::CGlass Class Reference

glasscore interface class More...

#include <Glass.h>

Collaboration diagram for glasscore::CGlass:
Collaboration graph

Public Member Functions

 CGlass ()
 CGlass constructor. More...
 
 ~CGlass ()
 CGlass destructor. More...
 

Static Public Member Functions

static void clear ()
 CGlass clear function. More...
 
static bool receiveExternalMessage (std::shared_ptr< json::Object > com)
 CGlass communication receiving function. More...
 
static bool sendExternalMessage (std::shared_ptr< json::Object > com)
 CGlass communication sending function. More...
 
static void setExternalInterface (glasscore::IGlassSend *newSend)
 Sets the IGlassSend interface pointer used to send communication (such as output data), to outside the glasscore library. More...
 
static bool initialize (std::shared_ptr< json::Object > com)
 CGlass initialization function. More...
 
static bool healthCheck ()
 check to see if each thread is still functional More...
 
static double getBeamMatchingAzimuthWindow ()
 Gets the azimuth window used to determine whether a beam can be matched with an existing hypo. More...
 
static double getBeamMatchingDistanceWindow ()
 Gets the distance window used to determine whether a beam can be matched with an existing hypo. More...
 
static int getCorrelationCancelAge ()
 Gets the correlation cancel age used to determine when a hypo created by a correlation can be canceled if no other supporting data exists. More...
 
static double getCorrelationMatchingTimeWindow ()
 Gets the time window used to determine whether a correlation can be matched with an existing hypo. More...
 
static double getCorrelationMatchingDistanceWindow ()
 Gets the distance window used to determine whether a correlation can be matched with an existing hypo. More...
 
static double getHypoMergingTimeWindow ()
 Gets the time window used to determine whether a hypo could be merged with an existing hypo. More...
 
static double getHypoMergingDistanceWindow ()
 Gets the distance window used to determine whether a hypo could be merged with an existing hypo. More...
 
static double getDistanceCutoffFactor ()
 Gets the factor used in calculating the association distance cutoff factor for pick data. More...
 
static double getMinDistanceCutoff ()
 Gets the minimum allowed association distance cutoff. More...
 
static double getDistanceCutoffRatio ()
 Gets the percentage used in calculating the association distance cutoff factor for pick data. More...
 
static double getReportingStackThreshold ()
 Gets the minimum bayesian stack threshold needed to report a hypo out of glass. More...
 
static double getNucleationStackThreshold ()
 Gets the minimum bayesian stack threshold required to nucleate an event. More...
 
static double getPickAffinityExpFactor ()
 Gets the exponential pick affinity factor used in association. More...
 
static bool getGraphicsOut ()
 Gets a flag indicating whether to produce graphics files for location tuning. More...
 
static const std::string & getGraphicsOutFolder ()
 Gets a string indicating the desired graphics output folder. More...
 
static double getGraphicsStepKm ()
 Get the size of the step used in generating graphic output files. More...
 
static int getGraphicsSteps ()
 Gets the number steps used in generating graphic output files. More...
 
static int getProcessLimit ()
 Gets the maximum number of times a hypocenter can reprocess without new data being associated to it. More...
 
static bool getMinimizeTTLocator ()
 Gets a flag indicating whether to use the minimizing travel time locator. More...
 
static void setMinimizeTTLocator (bool use)
 Sets a flag indicating whether to use the minimizing travel time locator. More...
 
static int getNumStationsPerNode ()
 Get the maximum number of sites link to a node. More...
 
static int getNucleationDataCountThreshold ()
 Gets the minimum number of data required to nucleate an event. More...
 
static int getReportingDataThreshold ()
 Gets the minimum number of data required to report an event. More...
 
static double getPickDuplicateTimeWindow ()
 Gets the time window used when checking whether an input pick is a duplicate of a pick already in the pick list. More...
 
static double getAssociationSDCutoff ()
 Gets the cutoff threshold in terms of number of standard deviations for associating data (eg. Picks) with a hypocenter. The standard deviation is fixed to 1. More...
 
static double getPruningSDCutoff ()
 Gets the cutoff threshold in terms of number of standard deviations for pruning data (eg. Picks) from a hypocenter. The standard deviation is fixed to 1. More...
 
static double getNonLocatingPhaseCutoffFactor ()
 Gets the multiplicative factor used to expand the SD cutoff to keep data associated to a hypocenter when the Pick phase does not affect the location. More...
 
static double getTeleseismicDistanceLimit ()
 Gets the distance limit in degrees used to designate a phase as teleseismic. More...
 
static int getTeleseismicPhaseCountThreshold ()
 Gets the teleseismic phase count threshold. More...
 
static bool getTestLocator ()
 Gets a flag indicating whether to output locator testing files. More...
 
static bool getTestTravelTimes ()
 Gets a flag indicating whether to test travel times. More...
 
static int getMaxNumPicks ()
 Get the maximum number of picks to store in glass. More...
 
static void setMaxNumPicks (int max)
 Set the maximum number of picks to store in glass. More...
 
static int getMaxNumCorrelations ()
 Get the maximum number of correlations to store in glass. More...
 
static void setMaxNumCorrelations (int max)
 Set the maximum number of correlations to store in glass. More...
 
static void setMaxNumPicksPerSite (int max)
 Set the maximum number of picks to store with a site. More...
 
static int getMaxNumHypos ()
 Get the maximum number of hypos to store in glass. More...
 
static void setMaxNumHypos (int max)
 Set the maximum number of hypos to store in glass. More...
 
static double getEventFragmentDepthThreshold ()
 Gets the depth threshold used for declaring a hypo an event fragment, in combination with m_dEventFragmentAzimuthThreshold. More...
 
static double getEventFragmentAzimuthThreshold ()
 Gets the azimuth threshold used for declaring a hypo an event fragment, in combination with m_dEventFragmentDepthThreshold. More...
 
static bool getAllowPickUpdates ()
 Gets a boolean flag indicating whether to allow picks in the pick list to be updated. More...
 
static double getPickNoiseClassificationThreshold ()
 Gets the optional threshold used for accepting the classification of a pick as noise by an external algorithm. -1 indicates this feature is disabled. More...
 
static double getPickPhaseClassificationThreshold ()
 Gets the optional threshold used for accepting the classification of a pick phase by an external algorithm. -1 indicates this feature is disabled. More...
 
static double getPickDistanceClassificationThreshold ()
 Gets the optional threshold used for accepting the classification of a pick Distance by an external algorithm. -1 indicates this feature is disabled. More...
 
static double getDistanceClassUpperBound (double distClass)
 Gets the upper distance bound for a given distance class. More...
 
static double getDistanceClassLowerBound (double distClass)
 Gets the lower distance bound for a given distance class. More...
 
static double getPickAzimuthClassificationThreshold ()
 Gets the optional threshold used for accepting the classification of a pick Azimuth by an external algorithm. -1 indicates this feature is disabled. More...
 
static double getPickAzimuthClassificationUncertainty ()
 Gets the optional uncertainty used for accepting the classification of a pick Azimuth by an external algorithm. More...
 
static CCorrelationListgetCorrelationList ()
 Gets a pointer to the Correlation list. More...
 
static CDetectiongetDetectionProcessor ()
 Gets a pointer to the CDetection object used to process detections made external to glasscore. More...
 
static CHypoListgetHypoList ()
 Gets a pointer to the Hypo list. More...
 
static CPickListgetPickList ()
 Gets a pointer to the Pick list. More...
 
static CSiteListgetSiteList ()
 Gets a pointer to the Site list. More...
 
static CWebListgetWebList ()
 Gets a pointer to the Web list. More...
 
static std::shared_ptr< traveltime::CTravelTime > & getDefaultNucleationTravelTime ()
 Gets the default nucleation travel time. More...
 
static std::shared_ptr< traveltime::CTTT > & getAssociationTravelTimes ()
 Gets the list of association travel times. More...
 

Static Public Attributes

static const int iMaxQueueLenPerThreadFactor = 10
 The factor used to scale thread count to implement maximum queue lengths for processing. More...
 
static constexpr double k_dAssociationSecondsPerSigma = 1.0
 The seconds per sigma value used for association, intentionally a tighter sigma value than nucleation. More...
 
static constexpr double k_dNucleationSecondsPerSigma = 5.0
 The seconds per sigma value used for nucleation, intentionally a looser sigma value than association. More...
 
static constexpr double k_dMaximumDepth = 800.0
 The maximum allowed depth. More...
 

Detailed Description

glasscore interface class

The CGlass class is the class that sets up and maintains the glass association engine, and acts as the interface between the glasscore library and any clients.

CGlass initializes the traveltime library, allocates the site, pick, and hypo lists, creates and maintains the detection web, and manages communication between glasscore and clients via the dispatch function (receiving) and an IGlassSend interface pointer variable (sending).

CGlass also performs traveltime library testing during initialization, time encoding/decoding as well as calculating the significance functions and normal distributions as needed.

All communication (configuration, input data, or output results ) to / from CGlass is via deserialized json messages as pointers to supereasyjson json::objects.

Constructor & Destructor Documentation

glasscore::CGlass::CGlass ( )

CGlass constructor.

The constructor for the CGlass class. Sets allocated lists and objects to null. Initializes members to default values.

glasscore::CGlass::~CGlass ( )

CGlass destructor.

The destructor for the CGlass class. Cleans up all memory allocated to lists and objects.

Member Function Documentation

void glasscore::CGlass::clear ( )
static

CGlass clear function.

bool glasscore::CGlass::getAllowPickUpdates ( )
static

Gets a boolean flag indicating whether to allow picks in the pick list to be updated.

double glasscore::CGlass::getAssociationSDCutoff ( )
static

Gets the cutoff threshold in terms of number of standard deviations for associating data (eg. Picks) with a hypocenter. The standard deviation is fixed to 1.

Returns
Returns a double containing the standard deviation cutoff used for association
std::shared_ptr< traveltime::CTTT > & glasscore::CGlass::getAssociationTravelTimes ( )
static

Gets the list of association travel times.

Returns
Returns a shared_ptr to the CTTT containing the list of association travel times
double glasscore::CGlass::getBeamMatchingAzimuthWindow ( )
static

Gets the azimuth window used to determine whether a beam can be matched with an existing hypo.

Returns
Returns a double containing the beam matching azimuth window in degrees
double glasscore::CGlass::getBeamMatchingDistanceWindow ( )
static

Gets the distance window used to determine whether a beam can be matched with an existing hypo.

Returns
Returns a double containing the beam matching distance window in degrees
int glasscore::CGlass::getCorrelationCancelAge ( )
static

Gets the correlation cancel age used to determine when a hypo created by a correlation can be canceled if no other supporting data exists.

Returns
Returns an integer containing the correlation cancel age in seconds
CCorrelationList * glasscore::CGlass::getCorrelationList ( )
static

Gets a pointer to the Correlation list.

Returns
Returns a pointer to the correlation list
double glasscore::CGlass::getCorrelationMatchingDistanceWindow ( )
static

Gets the distance window used to determine whether a correlation can be matched with an existing hypo.

Returns
Returns a double containing the correlation matching distance window in degrees
double glasscore::CGlass::getCorrelationMatchingTimeWindow ( )
static

Gets the time window used to determine whether a correlation can be matched with an existing hypo.

Returns
Returns a double containing the correlation matching time window in seconds
std::shared_ptr< traveltime::CTravelTime > & glasscore::CGlass::getDefaultNucleationTravelTime ( )
static

Gets the default nucleation travel time.

Returns
Returns a shared_ptr to the CTravelTime containing the default nucleation travel time
CDetection * glasscore::CGlass::getDetectionProcessor ( )
static

Gets a pointer to the CDetection object used to process detections made external to glasscore.

Returns
Returns a pointer to the detection processor
double glasscore::CGlass::getDistanceClassLowerBound ( double  distClass)
static

Gets the lower distance bound for a given distance class.

double glasscore::CGlass::getDistanceClassUpperBound ( double  distClass)
static

Gets the upper distance bound for a given distance class.

double glasscore::CGlass::getDistanceCutoffFactor ( )
static

Gets the factor used in calculating the association distance cutoff factor for pick data.

Returns
Returns a double containing the distance cutoff factor
double glasscore::CGlass::getDistanceCutoffRatio ( )
static

Gets the percentage used in calculating the association distance cutoff factor for pick data.

Returns
Returns a double containing the distance cutoff percentage
double glasscore::CGlass::getEventFragmentAzimuthThreshold ( )
static

Gets the azimuth threshold used for declaring a hypo an event fragment, in combination with m_dEventFragmentDepthThreshold.

double glasscore::CGlass::getEventFragmentDepthThreshold ( )
static

Gets the depth threshold used for declaring a hypo an event fragment, in combination with m_dEventFragmentAzimuthThreshold.

bool glasscore::CGlass::getGraphicsOut ( )
static

Gets a flag indicating whether to produce graphics files for location tuning.

Returns
Returns a boolean flag indicating whether to output graphics files for location tuning
const std::string & glasscore::CGlass::getGraphicsOutFolder ( )
static

Gets a string indicating the desired graphics output folder.

Returns
Returns a std::string containing the folder to output graphics files to
double glasscore::CGlass::getGraphicsStepKm ( )
static

Get the size of the step used in generating graphic output files.

Returns
Returns a double containing the graphics step size in kilometers
int glasscore::CGlass::getGraphicsSteps ( )
static

Gets the number steps used in generating graphic output files.

Returns
Returns an integer containing the number of graphic steps
CHypoList * glasscore::CGlass::getHypoList ( )
static

Gets a pointer to the Hypo list.

Returns
Returns a pointer to the hypo list
double glasscore::CGlass::getHypoMergingDistanceWindow ( )
static

Gets the distance window used to determine whether a hypo could be merged with an existing hypo.

Returns
Returns a double containing the hypo merging distance window in degrees
double glasscore::CGlass::getHypoMergingTimeWindow ( )
static

Gets the time window used to determine whether a hypo could be merged with an existing hypo.

Returns
Returns a double containing the hypo merging time window in seconds
int glasscore::CGlass::getMaxNumCorrelations ( )
static

Get the maximum number of correlations to store in glass.

Returns
Returns an integer containing the maximum number of correlations
int glasscore::CGlass::getMaxNumHypos ( )
static

Get the maximum number of hypos to store in glass.

Returns
Returns an integer containing the maximum number of hypos
int glasscore::CGlass::getMaxNumPicks ( )
static

Get the maximum number of picks to store in glass.

Returns
Returns an integer containing the maximum number of picks
double glasscore::CGlass::getMinDistanceCutoff ( )
static

Gets the minimum allowed association distance cutoff.

Returns
Returns a double containing the minimum allowed association distance cutoff in degrees
bool glasscore::CGlass::getMinimizeTTLocator ( )
static

Gets a flag indicating whether to use the minimizing travel time locator.

Returns
Returns a boolean flag indicating whether to use the minimizing travel time locator
double glasscore::CGlass::getNonLocatingPhaseCutoffFactor ( )
static

Gets the multiplicative factor used to expand the SD cutoff to keep data associated to a hypocenter when the Pick phase does not affect the location.

Returns
Returns a double containing the multiplicative SD cutoff factor
int glasscore::CGlass::getNucleationDataCountThreshold ( )
static

Gets the minimum number of data required to nucleate an event.

Returns
Returns an integer containing the minimum number of data required to nucleate an event
double glasscore::CGlass::getNucleationStackThreshold ( )
static

Gets the minimum bayesian stack threshold required to nucleate an event.

Returns
Returns a double containing the minimum nucleation stack threshold
int glasscore::CGlass::getNumStationsPerNode ( )
static

Get the maximum number of sites link to a node.

Returns
Returns an integer containing the maximum number of sites link to a node
double glasscore::CGlass::getPickAffinityExpFactor ( )
static

Gets the exponential pick affinity factor used in association.

Returns
Returns a double containing the exponential factor used for pick affinity
double glasscore::CGlass::getPickAzimuthClassificationThreshold ( )
static

Gets the optional threshold used for accepting the classification of a pick Azimuth by an external algorithm. -1 indicates this feature is disabled.

double glasscore::CGlass::getPickAzimuthClassificationUncertainty ( )
static

Gets the optional uncertainty used for accepting the classification of a pick Azimuth by an external algorithm.

double glasscore::CGlass::getPickDistanceClassificationThreshold ( )
static

Gets the optional threshold used for accepting the classification of a pick Distance by an external algorithm. -1 indicates this feature is disabled.

double glasscore::CGlass::getPickDuplicateTimeWindow ( )
static

Gets the time window used when checking whether an input pick is a duplicate of a pick already in the pick list.

Returns
Returns a double containing the pick duplication time window in seconds
CPickList * glasscore::CGlass::getPickList ( )
static

Gets a pointer to the Pick list.

Returns
Returns a pointer to the pick list
double glasscore::CGlass::getPickNoiseClassificationThreshold ( )
static

Gets the optional threshold used for accepting the classification of a pick as noise by an external algorithm. -1 indicates this feature is disabled.

double glasscore::CGlass::getPickPhaseClassificationThreshold ( )
static

Gets the optional threshold used for accepting the classification of a pick phase by an external algorithm. -1 indicates this feature is disabled.

int glasscore::CGlass::getProcessLimit ( )
static

Gets the maximum number of times a hypocenter can reprocess without new data being associated to it.

Returns
Returns an integer containing the limit of hypo processing cycles
double glasscore::CGlass::getPruningSDCutoff ( )
static

Gets the cutoff threshold in terms of number of standard deviations for pruning data (eg. Picks) from a hypocenter. The standard deviation is fixed to 1.

Returns
Returns a double containing the standard deviation cutoff used for pruning
int glasscore::CGlass::getReportingDataThreshold ( )
static

Gets the minimum number of data required to report an event.

Returns
Returns an integer containing the minimum number of data required to report an event
double glasscore::CGlass::getReportingStackThreshold ( )
static

Gets the minimum bayesian stack threshold needed to report a hypo out of glass.

Returns
Returns a double containing the minimum reporting stack threshold
CSiteList * glasscore::CGlass::getSiteList ( )
static

Gets a pointer to the Site list.

Returns
Returns a pointer to the site list
double glasscore::CGlass::getTeleseismicDistanceLimit ( )
static

Gets the distance limit in degrees used to designate a phase as teleseismic.

Returns
Returns a double containing the teleseismic distance limit
int glasscore::CGlass::getTeleseismicPhaseCountThreshold ( )
static

Gets the teleseismic phase count threshold.

Returns
Returns an integer containing the teleseismic phase count threshold
bool glasscore::CGlass::getTestLocator ( )
static

Gets a flag indicating whether to output locator testing files.

Returns
Returns a boolean flag indicating whether to output locator testing files
bool glasscore::CGlass::getTestTravelTimes ( )
static

Gets a flag indicating whether to test travel times.

Returns
Returns a boolean flag indicating whether to test travel times
CWebList * glasscore::CGlass::getWebList ( )
static

Gets a pointer to the Web list.

Returns
Returns a pointer to the web list
bool glasscore::CGlass::healthCheck ( )
static

check to see if each thread is still functional

Checks each thread to see if it is still responsive.

bool glasscore::CGlass::initialize ( std::shared_ptr< json::Object >  com)
static

CGlass initialization function.

The function used by CGlass to initialize the glasscore library. This function loads the earth model, sets the association parameters, sets up the ray path calculator, creates the detection web configures and tests the phase and branch travel times used for association, creates the pick, site, and hypo lists, and sets up the output format

Parameters
com- A pointer to a json::object containing the configuration to use in initialization.
Returns
Returns true if the initialization was successful, false otherwise
bool glasscore::CGlass::receiveExternalMessage ( std::shared_ptr< json::Object >  com)
static

CGlass communication receiving function.

The function used by CGlass to receive communication (such as configuration or input data), from outside the glasscore library.

CGlass will forward the communication on to the pick, site, or hypo lists, or the detection web if CGlass cannot use the communication.

Parameters
com- A pointer to a json::object containing the communication.
Returns
Returns true if the communication was handled by CGlass, false otherwise
bool glasscore::CGlass::sendExternalMessage ( std::shared_ptr< json::Object >  com)
static

CGlass communication sending function.

The function used by CGlass to send communication (such as output data), to outside the glasscore library using an IGlassSend interface pointer.

Parameters
com- A pointer to a json::object containing the communication.
Returns
Returns true if the communication was sent via a valid IGlassSend interface pointer, false otherwise
void glasscore::CGlass::setExternalInterface ( glasscore::IGlassSend newSend)
static

Sets the IGlassSend interface pointer used to send communication (such as output data), to outside the glasscore library.

Parameters
newSend- A pointer to a glasscore::IGlassSend interrace to use to send communication (such as output data), to outside the glasscore library
void glasscore::CGlass::setMaxNumCorrelations ( int  max)
static

Set the maximum number of correlations to store in glass.

Parameters
max- an integer containing the maximum number of correlations
void glasscore::CGlass::setMaxNumHypos ( int  max)
static

Set the maximum number of hypos to store in glass.

Parameters
max- an integer containing the maximum number of hypos
void glasscore::CGlass::setMaxNumPicks ( int  max)
static

Set the maximum number of picks to store in glass.

Parameters
max- an integer containing the maximum number of picks
static void glasscore::CGlass::setMaxNumPicksPerSite ( int  max)
static

Set the maximum number of picks to store with a site.

Parameters
max- an integer containing the maximum number of picks to store with a site
void glasscore::CGlass::setMinimizeTTLocator ( bool  use)
static

Sets a flag indicating whether to use the minimizing travel time locator.

Parameters
use- A boolean flag indicating whether to use the minimizing travel time locator

Member Data Documentation

const int glasscore::CGlass::iMaxQueueLenPerThreadFactor = 10
static

The factor used to scale thread count to implement maximum queue lengths for processing.

constexpr double glasscore::CGlass::k_dAssociationSecondsPerSigma = 1.0
static

The seconds per sigma value used for association, intentionally a tighter sigma value than nucleation.

constexpr double glasscore::CGlass::k_dMaximumDepth = 800.0
static

The maximum allowed depth.

constexpr double glasscore::CGlass::k_dNucleationSecondsPerSigma = 5.0
static

The seconds per sigma value used for nucleation, intentionally a looser sigma value than association.


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