59 explicit CWeb(
int numThreads = 0,
int sleepTime = 100,
int checkInterval =
103 CWeb(std::string name,
double thresh,
int numDetect,
int numNucleate,
104 int resolution,
bool update,
bool save,
bool allowControllingWebs,
105 std::shared_ptr<traveltime::CTravelTime> firstTrav,
106 std::shared_ptr<traveltime::CTravelTime> secondTrav,
107 int numThreads = 0,
int sleepTime = 100,
int checkInterval = 300,
108 double aziTaper = 360.0,
double maxDepth = 800.0,
109 double aSeismicThresh = -1.0,
int numASeismicNucleate = -1);
123 void clear()
override;
176 bool initialize(std::string name,
double thresh,
int numDetect,
177 int numNucleate,
int resolution,
bool update,
bool save,
178 bool allowControllingWebs,
179 std::shared_ptr<traveltime::CTravelTime> firstTrav,
180 std::shared_ptr<traveltime::CTravelTime> secondTrav,
181 double aziTaper = 360.0,
double maxDepth = 800.0,
182 double aSeismicThresh = -1.0,
int numASeismicNucleate = -1);
253 bool loadFilters(std::shared_ptr<json::Object> gridConfiguration);
311 std::shared_ptr<CNode>
generateNode(
double lat,
double lon,
double z,
322 bool addNode(std::shared_ptr<CNode> node);
342 void addSite(std::shared_ptr<CSite> site);
375 bool isSiteAllowed(std::shared_ptr<CSite> site,
bool checkEnabled =
true);
385 void addJob(std::function<
void()> newjob);
466 const std::string&
getName()
const;
565 double isWithin(
double dLat,
double dLon);
578 std::vector<std::string> m_vNetworksFilter;
585 std::vector<std::string> m_vSitesFilter;
592 std::vector<std::string> m_vSourcesFilter;
599 std::atomic<bool> m_bUseOnlyTeleseismicStations;
608 std::vector<std::pair<double, std::shared_ptr<CSite>>>m_vSitesSortedForCurrentNode;
614 std::vector<std::shared_ptr<CNode>> m_vNode;
619 mutable std::mutex m_vNodeMutex;
629 std::atomic<double> m_dMinLatitude;
634 std::atomic<double> m_dMinLongitude;
639 std::atomic<double> m_dHeight;
644 std::atomic<double> m_dWidth;
651 std::atomic<int> m_iNumStationsPerNode;
658 std::atomic<int> m_iNucleationDataCountThreshold;
665 std::atomic<double> m_dNucleationStackThreshold;
671 std::atomic<double> m_dNodeResolution;
677 std::atomic<double> m_dAzimuthTaper;
683 std::atomic<double> m_dMaxDepth;
690 std::atomic<double> m_dQualityFilter;
696 std::atomic<double> m_dMaxSiteDistanceFilter;
701 std::atomic<double> m_dDepthResolution;
707 std::atomic<bool> m_bUpdate;
713 std::atomic<bool> m_bSaveGrid;
719 std::atomic<bool> m_bAllowControllingWebs;
725 std::atomic<double> m_dASeismicNucleationStackThreshold;
731 std::atomic<double> m_iASeismicNucleationDataCountThreshold;
737 std::shared_ptr<traveltime::CTravelTime> m_pNucleationTravelTime1;
743 std::shared_ptr<traveltime::CTravelTime> m_pNucleationTravelTime2;
748 std::mutex m_vSiteMutex;
753 std::queue<std::function<void()>> m_JobQueue;
758 std::mutex m_QueueMutex;
764 std::string m_sZoneStatsFileName;
768 std::shared_ptr<traveltime::CZoneStats> m_pZoneStats;
777 mutable std::recursive_mutex m_WebMutex;
783 std::atomic<int> m_tLastUpdated;
788 static constexpr
double k_dAzimuthTaperDefault = 360.0;
793 static constexpr
double k_dDepthResolutionUndefined = -1.0;
800 static constexpr
double k_dFibonacciRatio = 1.6180339888;
805 static const int k_iNodeLatitudeIndex = 0;
810 static const int k_iNodeLongitudeIndex = 1;
815 static const int k_iNodeDepthIndex = 2;
821 static constexpr
double k_dMinimumMaxNodeDepth = 50.0;
bool loadWebSiteList()
Load web site list.
Definition: Web.cpp:1474
void sortSiteListForNode(double lat, double lon, double depth)
Sort site list.
Definition: Web.cpp:1542
bool receiveExternalMessage(std::shared_ptr< json::Object > com)
CWeb communication recieveing function.
Definition: Web.cpp:201
bool nodesHaveSite(std::shared_ptr< CSite > site)
Check if the nodes in this web has a site This function checks to see if the given site is used by an...
Definition: Web.cpp:2296
bool getSaveGrid() const
Gets a flag indicating whether this web supports saving its nodes to an external file.
Definition: Web.cpp:2344
glass3::util::WorkState work() override
Web work function.
Definition: Web.cpp:2261
std::shared_ptr< CNode > generateNode(double lat, double lon, double z, double resol)
Create new node.
Definition: Web.cpp:1629
bool getZoneStatsAseismic(double dLat, double dLon)
zone stats aseismic retrieval function
Definition: Web.cpp:2415
glasscore site list class
Definition: SiteList.h:40
bool addSiteToSiteList(std::shared_ptr< CSite > site)
Add site to this web's sitelist This function adds the given site to the site list local to this web...
Definition: Web.cpp:1568
int getNucleationDataCountThreshold() const
Gets the nucleation data minimum threshold used for this web.
Definition: Web.cpp:2369
const std::shared_ptr< traveltime::CTravelTime > & getNucleationTravelTime2() const
Gets the secondary nucleation travel time for this web.
Definition: Web.cpp:2385
int getASeismicNucleationDataCountThreshold() const
Gets the aseismic nucleation data (picks) minimum threshold used for this web.
Definition: Web.cpp:2452
bool loadGridConfiguration(std::shared_ptr< json::Object > gridConfiguration)
Load the common grid configuration.
Definition: Web.cpp:877
const std::shared_ptr< traveltime::CTravelTime > & getNucleationTravelTime1() const
Gets the primary nucleation travel time for this web.
Definition: Web.cpp:2379
int getNumStationsPerNode() const
Gets the number of stations to link to each node in this web.
Definition: Web.cpp:2364
double isWithin(double dLat, double dLon)
is coordinate within web function
Definition: Web.cpp:2457
std::shared_ptr< CNode > generateNodeSites(std::shared_ptr< CNode > node)
Create list of sites for node.
Definition: Web.cpp:1696
void setSiteList(CSiteList *siteList)
Set the CSiteList pointer used by this web for site lookups.
Definition: Web.cpp:2333
bool addNode(std::shared_ptr< CNode > node)
Add node to list.
Definition: Web.cpp:1683
bool loadTravelTimes(json::Object *gridConfiguration)
Load the travel times for this web.
Definition: Web.cpp:1068
double getZoneStatsMaxDepth(double dLat, double dLon)
zone stats max depth retrieval function
Definition: Web.cpp:2433
WorkState
glass3::util::WorkState enumeration
Definition: workstate.h:25
bool getAllowControllingWebs() const
Gets a boolean flag that stores whether this web will allow other (smaller) webs to override it's nuc...
Definition: Web.cpp:2349
void addSite(std::shared_ptr< CSite > site)
Add site to this web This function adds the given site to the list of nodes linked to this web and re...
Definition: Web.cpp:1802
const CSiteList * getSiteList() const
Get the CSiteList pointer used by this web for site lookups.
Definition: Web.cpp:2327
bool generateGlobalGrid(std::shared_ptr< json::Object > gridConfiguration)
Generate a global detection grid.
Definition: Web.cpp:237
int getNetworksFilterSize() const
Get the number of network filters for this web.
Definition: Web.cpp:2391
bool removeSiteFromSiteList(std::shared_ptr< CSite > site)
Remove site from this web's sitelist This function Removes the given site to the site list local to t...
Definition: Web.cpp:1592
void removeSite(std::shared_ptr< CSite > site)
Remove site from this web This function removes the given site to the list of nodes linked to this we...
Definition: Web.cpp:2024
void clear() override
CWeb clear function.
Definition: Web.cpp:83
int size() const
Get the number of nodes in this web.
Definition: Web.cpp:2409
const std::string & getName() const
Gets the name of this web.
Definition: Web.cpp:2374
bool generateLocalGrid(std::shared_ptr< json::Object > gridConfiguration)
Generate a local detection grid.
Definition: Web.cpp:426
double getASeismicNucleationStackThreshold() const
Gets the aseismic nucleation minimum stack threshold used for this web.
Definition: Web.cpp:2447
The namespace containing the core algorithm.
Definition: Correlation.h:17
bool getUpdate() const
Gets a flag indicating whether this web supports updates.
Definition: Web.cpp:2339
CWeb(int numThreads=0, int sleepTime=100, int checkInterval=300)
CWeb constructor.
Definition: Web.cpp:50
double getNodeResolution() const
Gets the node resolution of this web.
Definition: Web.cpp:2354
double getMaxDepth() const
Get the maximum depth used for this web.
Definition: Web.cpp:2322
bool isSiteAllowed(std::shared_ptr< CSite > site, bool checkEnabled=true)
Check to see if site allowed This function checks to see if a given site is allowed in the web by che...
Definition: Web.cpp:1417
double getAzimuthTaper() const
Get the azimuth taper used for this web.
Definition: Web.cpp:2317
bool getUseOnlyTeleseismicStations() const
Gets the flag indicating whether this web should only use sites flagged as UseForTeleseismic.
Definition: Web.cpp:2397
bool generateExplicitGrid(std::shared_ptr< json::Object > gridConfiguration)
Generate a detection grid with explicit nodes.
Definition: Web.cpp:676
~CWeb()
CWeb destructor.
Definition: Web.cpp:79
glass3::util::ThreadBaseClass class
Definition: threadbaseclass.h:34
bool initialize(std::string name, double thresh, int numDetect, int numNucleate, int resolution, bool update, bool save, bool allowControllingWebs, std::shared_ptr< traveltime::CTravelTime > firstTrav, std::shared_ptr< traveltime::CTravelTime > secondTrav, double aziTaper=360.0, double maxDepth=800.0, double aSeismicThresh=-1.0, int numASeismicNucleate=-1)
CWeb initialization function.
Definition: Web.cpp:151
double getNucleationStackThreshold() const
Gets the nucleation minimum stack threshold used for this web.
Definition: Web.cpp:2359
void addJob(std::function< void()> newjob)
add a job
Definition: Web.cpp:2240
int getSitesFilterSize() const
Get the number of site filters for this web.
Definition: Web.cpp:2403
bool loadFilters(std::shared_ptr< json::Object > gridConfiguration)
Load web filters.
Definition: Web.cpp:1266
glasscore detection web class
Definition: Web.h:46