|
neic-glass3
1.4.6
|
glasscore site (station) class More...
#include <Site.h>

Public Member Functions | |
| CSite () | |
| CSite default constructor. More... | |
| CSite (std::string sta, std::string comp, std::string net, std::string loc, double lat, double lon, double elv, double qual, bool enable, bool useTele) | |
| CSite advanced constructor. More... | |
| CSite (std::shared_ptr< json::Object > site) | |
| CSite advanced constructor. More... | |
| ~CSite () | |
| CSite destructor. More... | |
| void | clear () |
| CSite clear function. More... | |
| void | update (CSite *site) |
| CSite update function. More... | |
| bool | initialize (std::string sta, std::string comp, std::string net, std::string loc, double lat, double lon, double elv, double qual, bool enable, bool use, bool useTele) |
| CSite initialization function. More... | |
| void | setLocation (double lat, double lon, double z) |
| Set the site's location This function sets the geographic location of the site to the provided latitude, longitude, and depth. More... | |
| double | getDelta (glass3::util::Geo *geo2) |
| Get the distance to the site This function calculates the distance between this site and the given geographic location in radians. More... | |
| double | getDistance (std::shared_ptr< CSite > site) |
| Get the distance between this site and another in km. More... | |
| void | addPick (std::shared_ptr< CPick > pck) |
| Add pick to this site This function adds the given pick to the list of picks made at this site. More... | |
| void | removePick (std::shared_ptr< CPick > pck) |
| Remove pick from this site This function removes the given pick from the list of picks made at this site. More... | |
| std::vector< std::shared_ptr< CPick > > | getPicks (double t1, double t2) |
| Get a vector of picks that fall within a time window. More... | |
| void | addNode (std::shared_ptr< CNode > node, double distDeg, double travelTime1, std::string phase1, double travelTime2=-1, std::string phase2="") |
| Add node to this site This function adds the given pick to the list of nodes serviced by this site. More... | |
| void | removeNode (std::string nodeID) |
| Remove pick from this site This function removes the given node from the list of nodes linked to this. More... | |
| std::vector< std::shared_ptr< CTrigger > > | nucleate (double tpick, CPickList *parentThread) |
| Try to nucleate a new event at nodes linked to site This function cycles through each node linked to this site, computes the PDF at each node, and identifies the node with the best PDF. More... | |
| void | addTriggerToList (std::vector< std::shared_ptr< CTrigger >> *vTrigger, std::shared_ptr< CTrigger > trigger) |
| Add triggering node to triggered node list if value exceeds current value of if named node's web is not yet present. More... | |
| int | getNodeLinksCount () const |
| Gets the number of nodes linked to this site. More... | |
| bool | getEnable () const |
| Gets whether this site is enabled. Enable represents whether this site should be used according to sources outside glasscore. More... | |
| void | setEnable (bool enable) |
| Sets whether this site is enabled. Enable represents whether this site should be used according to sources outside glasscore. More... | |
| bool | getIsUsed () const |
| Gets whether this site should be used for picks and nucleation. (m_bUse && m_bEnable) Use represents whether the site should be used according to glasscore's internal metrics. More... | |
| bool | getUse () const |
| Gets whether this site is used. More... | |
| void | setUse (bool use) |
| Sets whether this site should be used for picks and nucleation. Use represents whether the site should be used according to glasscore's internal metrics. More... | |
| bool | getUseForTeleseismic () const |
| Gets whether this site should be used for nucleation web generation where UseOnlyTeleseismicStations is set for a web. More... | |
| void | setUseForTeleseismic (bool useForTele) |
| Sets whether this site should be used for nucleation web generation where UseOnlyTeleseismicStations is set for a web. More... | |
| double | getQuality () const |
| Get the station quality metric. More... | |
| void | setQuality (double qual) |
| Set the station quality metric. More... | |
| double | getRawLatitude () const |
| Get the station raw latitude. More... | |
| double | getRawLongitude () const |
| Get the station raw longitude. More... | |
| double | getRawElevation () const |
| Get the station raw elevation. More... | |
| glass3::util::Geo & | getGeo () |
| Get the combined site location (latitude, longitude, elevation) as a CGeo object. More... | |
| const std::string & | getSCNL () const |
| Get the SCNL identifier for this site. More... | |
| const std::string & | getSite () const |
| Get the Site (station) name for this site. More... | |
| const std::string & | getComponent () const |
| Get the component code for this site. More... | |
| const std::string & | getNetwork () const |
| Get the network code for this site. More... | |
| const std::string & | getLocation () const |
| Get the location code for this site. More... | |
| time_t | getTLastPickAdded () const |
| Get the time the last pick was added to this site. More... | |
| double * | getUnitVectors (double *vec) |
| Get the location unit vectors. More... | |
| int | getPickCountSinceCheck () const |
| Get the count of picks added to this site since the last check. More... | |
| void | setPickCountSinceCheck (int count) |
| Set the count of picks added to this site since the last check. More... | |
| int | getPickCount () const |
| Gets the number of picks made at this site. More... | |
| std::multiset< std::shared_ptr< CPick >, SitePickCompare >::iterator | getLower (double min) |
| Gets the lower bound of the pick multiset at the provided time. More... | |
| std::multiset< std::shared_ptr< CPick >, SitePickCompare >::iterator | getUpper (double max) |
| Gets the upper bound of the pick multiset at the provided time. More... | |
| std::multiset< std::shared_ptr< CPick >, SitePickCompare >::iterator | getEnd () |
| Gets the end iterator of the pick multiset. More... | |
| std::mutex & | getPickMutex () |
| Gets pick multiset mutex. More... | |
| void | updatePosition (std::shared_ptr< CPick > pick) |
| A PickList function that updates the position of the given pick in the multiset. More... | |
glasscore site (station) class
The CSite class is the class that encapsulates everything necessary to represent a seismic station (site), including geographic location identifier (SCNL), and use/nouse flag. The CSite class is also a node in the detection graph database.
CSite maintains graph database links between it and one or more detection nodes
CSite maintains a list of picks made at the site
CSite contains function to support nucleation of a new event based on a potential origin time and each of the detection nodes linked to the site.
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
CSite uses smart pointers (std::shared_ptr).
| glasscore::CSite::CSite | ( | ) |
| glasscore::CSite::CSite | ( | std::string | sta, |
| std::string | comp, | ||
| std::string | net, | ||
| std::string | loc, | ||
| double | lat, | ||
| double | lon, | ||
| double | elv, | ||
| double | qual, | ||
| bool | enable, | ||
| bool | useTele | ||
| ) |
CSite advanced constructor.
An advanced constructor for the CSite class. This function initializes members to the provided SCNL, Lat/Lon/elv, qual, and use-flags values
| sta | - A string containing the station name for this site. |
| comp | - A string containing the component code for this site. |
| net | - A string containing the network code for this site. |
| loc | - A string containing the location code for this site. |
| lat | - A double value containing the geographic latitude of this site in degrees |
| lon | - A double value containing the geographic longitude of this site in degrees |
| elv | - A double value containing the geographic elevation of this site in meters |
| qual | - A double value containing a station quality estimate |
| enable | - A boolean flag indicating whether the site is to be enabled or not |
| useTele | - A boolean flag indicating whether the site is to be used for teleseismic or not |
|
explicit |
| glasscore::CSite::~CSite | ( | ) |
CSite destructor.
| void glasscore::CSite::addNode | ( | std::shared_ptr< CNode > | node, |
| double | distDeg, | ||
| double | travelTime1, | ||
| std::string | phase1, | ||
| double | travelTime2 = -1, |
||
| std::string | phase2 = "" |
||
| ) |
Add node to this site This function adds the given pick to the list of nodes serviced by this site.
| node | - A shared_ptr to a CNode object containing the node to add |
| distDeg | - A double value containing the distance between the node and this site in degrees |
| travelTime1 | - A double value containing the first travel time to use |
| phase1 | - A std::string containing the first travel time phase code |
| travelTime2 | - A double value containing the optional second travel |
| phase2 | - A std::string containing the second travel time phase code, defaults to "" (no travel time) time to use for the link, defaults to -1 (no travel time) |
| void glasscore::CSite::addPick | ( | std::shared_ptr< CPick > | pck | ) |
Add pick to this site This function adds the given pick to the list of picks made at this site.
| pck | - A shared_ptr to a CPick object containing the pick to add |
| void glasscore::CSite::addTriggerToList | ( | std::vector< std::shared_ptr< CTrigger >> * | vTrigger, |
| std::shared_ptr< CTrigger > | trigger | ||
| ) |
Add triggering node to triggered node list if value exceeds current value of if named node's web is not yet present.
| vTrigger | - a pointer to a vector of shared_ptr's containing the current list of triggers |
| trigger | - a shared_ptr to the new CTrigger to add to the list |
| void glasscore::CSite::clear | ( | ) |
CSite clear function.
| const std::string & glasscore::CSite::getComponent | ( | ) | const |
Get the component code for this site.
| double glasscore::CSite::getDelta | ( | glass3::util::Geo * | geo2 | ) |
Get the distance to the site This function calculates the distance between this site and the given geographic location in radians.
| geo2 | - A pointer to a CGeo object containing the geographic location |
| double glasscore::CSite::getDistance | ( | std::shared_ptr< CSite > | site | ) |
Get the distance between this site and another in km.
| site | - A pointer to another site |
| bool glasscore::CSite::getEnable | ( | ) | const |
Gets whether this site is enabled. Enable represents whether this site should be used according to sources outside glasscore.
| std::multiset< std::shared_ptr< CPick >, SitePickCompare >::iterator glasscore::CSite::getEnd | ( | ) |
Gets the end iterator of the pick multiset.
| glass3::util::Geo & glasscore::CSite::getGeo | ( | ) |
Get the combined site location (latitude, longitude, elevation) as a CGeo object.
| bool glasscore::CSite::getIsUsed | ( | ) | const |
Gets whether this site should be used for picks and nucleation. (m_bUse && m_bEnable) Use represents whether the site should be used according to glasscore's internal metrics.
| const std::string & glasscore::CSite::getLocation | ( | ) | const |
Get the location code for this site.
| std::multiset< std::shared_ptr< CPick >, SitePickCompare >::iterator glasscore::CSite::getLower | ( | double | min | ) |
Gets the lower bound of the pick multiset at the provided time.
| min | - a double value containing the desired time to generate the lower value at in Gregorian seconds |
| const std::string & glasscore::CSite::getNetwork | ( | ) | const |
Get the network code for this site.
| int glasscore::CSite::getNodeLinksCount | ( | ) | const |
Gets the number of nodes linked to this site.
| int glasscore::CSite::getPickCount | ( | ) | const |
Gets the number of picks made at this site.
| int glasscore::CSite::getPickCountSinceCheck | ( | ) | const |
Get the count of picks added to this site since the last check.
| std::mutex & glasscore::CSite::getPickMutex | ( | ) |
Gets pick multiset mutex.
| std::vector< std::shared_ptr< CPick > > glasscore::CSite::getPicks | ( | double | t1, |
| double | t2 | ||
| ) |
Get a vector of picks that fall within a time window.
Get a vector of picks that fall within the provided time window from t1 to t2
| t1 | - A double value containing the beginning of the time window in Gregorian seconds |
| t2 | - A double value containing the end of the time window in Gregorian seconds |
| double glasscore::CSite::getQuality | ( | ) | const |
Get the station quality metric.
| double glasscore::CSite::getRawElevation | ( | ) | const |
Get the station raw elevation.
| double glasscore::CSite::getRawLatitude | ( | ) | const |
Get the station raw latitude.
| double glasscore::CSite::getRawLongitude | ( | ) | const |
Get the station raw longitude.
| const std::string & glasscore::CSite::getSCNL | ( | ) | const |
Get the SCNL identifier for this site.
| const std::string & glasscore::CSite::getSite | ( | ) | const |
Get the Site (station) name for this site.
| time_t glasscore::CSite::getTLastPickAdded | ( | ) | const |
Get the time the last pick was added to this site.
| double * glasscore::CSite::getUnitVectors | ( | double * | vec | ) |
Get the location unit vectors.
| std::multiset< std::shared_ptr< CPick >, SitePickCompare >::iterator glasscore::CSite::getUpper | ( | double | max | ) |
Gets the upper bound of the pick multiset at the provided time.
| max | - a double value containing the desired time to generate the upper value at in Gregorian seconds |
| bool glasscore::CSite::getUse | ( | ) | const |
Gets whether this site is used.
| bool glasscore::CSite::getUseForTeleseismic | ( | ) | const |
Gets whether this site should be used for nucleation web generation where UseOnlyTeleseismicStations is set for a web.
| bool glasscore::CSite::initialize | ( | std::string | sta, |
| std::string | comp, | ||
| std::string | net, | ||
| std::string | loc, | ||
| double | lat, | ||
| double | lon, | ||
| double | elv, | ||
| double | qual, | ||
| bool | enable, | ||
| bool | use, | ||
| bool | useTele | ||
| ) |
CSite initialization function.
Initializes site class to provided values.
| sta | - A string containing the station code for this site. |
| comp | - A string containing the component code for this site. |
| net | - A string containing the network code for this site. |
| loc | - A string containing the location code for this site. |
| lat | - A double value containing the geographic latitude of this site in degrees |
| lon | - A double value containing the geographic longitude of this site in degrees |
| elv | - A double value containing the geographic elevation of this site in meters |
| qual | - A double value containing a station quality estimate |
| enable | - A boolean flag indicating whether the site is to be enabled or not |
| use | - A boolean flag indicating whether the site is to be used (internally) or not |
| useTele | - A boolean flag indicating whether the site is to be used for teleseismic or not |
| std::vector< std::shared_ptr< CTrigger > > glasscore::CSite::nucleate | ( | double | tpick, |
| CPickList * | parentThread | ||
| ) |
Try to nucleate a new event at nodes linked to site This function cycles through each node linked to this site, computes the PDF at each node, and identifies the node with the best PDF.
The function uses addTrigger to keep track of triggering nodes
| tpick | - A double value containing the pick time to nucleate with in Gregorian seconds |
| 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 |
| void glasscore::CSite::removeNode | ( | std::string | nodeID | ) |
Remove pick from this site This function removes the given node from the list of nodes linked to this.
| nodeID | - A string with the id of the node to remove |
| void glasscore::CSite::removePick | ( | std::shared_ptr< CPick > | pck | ) |
Remove pick from this site This function removes the given pick from the list of picks made at this site.
| pck | - A shared_ptr to a CPick object containing the pick to remove |
| void glasscore::CSite::setEnable | ( | bool | enable | ) |
Sets whether this site is enabled. Enable represents whether this site should be used according to sources outside glasscore.
| enable | - A boolean flag indicating whether the site is enabled, true if enabled, false otherwise |
| void glasscore::CSite::setLocation | ( | double | lat, |
| double | lon, | ||
| double | z | ||
| ) |
Set the site's location This function sets the geographic location of the site to the provided latitude, longitude, and depth.
| lat | - A double value containing the latitude in degrees to use. |
| lon | - A double value containing the longitude in degrees to use. |
| z | - A double value containing the surface depth in km to use. |
| void glasscore::CSite::setPickCountSinceCheck | ( | int | count | ) |
Set the count of picks added to this site since the last check.
| count | - an integer containing the count of picks added to this site since the last check |
| void glasscore::CSite::setQuality | ( | double | qual | ) |
Set the station quality metric.
| qual | - a double value containing the station quality metric |
| void glasscore::CSite::setUse | ( | bool | use | ) |
Sets whether this site should be used for picks and nucleation. Use represents whether the site should be used according to glasscore's internal metrics.
| use | - a boolean flag indicating whether the site is used, true if enabled, false otherwise |
| void glasscore::CSite::setUseForTeleseismic | ( | bool | useForTele | ) |
Sets whether this site should be used for nucleation web generation where UseOnlyTeleseismicStations is set for a web.
| useForTele | - a boolean flag indicating whether the site is used for nucleation web generation, true if enabled, false otherwiseg |
| void glasscore::CSite::update | ( | CSite * | site | ) |
| void glasscore::CSite::updatePosition | ( | std::shared_ptr< CPick > | pick | ) |
A PickList function that updates the position of the given pick in the multiset.
| pick | - A shared_ptr to the pick that needs a position update |
1.8.11