-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[scfinder] processing input origins #38
base: master
Are you sure you want to change the base?
Conversation
e60cf8f
to
0c66882
Compare
apps/eew/scfinder/main.cpp
Outdated
long event_id = (long)time(NULL); | ||
|
||
// make constructor take a Coordinate designated by *cit...it will increment Nfinder | ||
_finderList.push_back(new Finder(Coordinate(org->latitude().value(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use my own separate local FinDer() object directly with .process() (it's a pointer)
apps/eew/scfinder/main.cpp
Outdated
int neppgas = 0; | ||
for ( int i=-1*_nPtsPGA;i<(_nPtsPGA+1);i++ ) { | ||
for ( int j=-1*_nPtsPGA;j<(_nPtsPGA+1);j++ ) { | ||
_latestMaxPGAs.push_back( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to make a separate local .copy() and append to this one instead (make sure it's a deep copy).
apps/eew/scfinder/main.cpp
Outdated
bool _processOrigins; | ||
double _defaultEpPGA; | ||
int _nPtsPGA; | ||
bool _finderScanProcOrg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
Adds origin input to scfinder. Default delay warning threshold changed from 3s to 5s.
174a205
to
9070d21
Compare
…in-based process, following advice from @jenrandrews
Core::Time(pga.get_timestamp()).iso().c_str(), | ||
pga.get_value()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jenrandrews: is this the best way to copy the _latestMaxPGAs data ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Fred, since PGA_Data_List objects are just vectors containing objects of PGA_Data class, I believe you can just do A = B, and A will be a deep copy of B. This may (or may not) be more efficient than your explicit copy loop, since it may not involve vector resizing. However, there is no copy constructor defined for the PGA_Data class, so something may go awry. My suggestion would be to do a quick test: try the originBasedLatestMaxPGAs = _latestMaxPGAs method, change something in one of the PGA_Data objects, and see if it shows up in the other list. If it doesn't, you're golden, otherwise keep what you have.
} | ||
SEISCOMP_DEBUG("sendFinder(originBasedFinder)..."); | ||
sendFinder(originBasedFinder); | ||
SEISCOMP_DEBUG("sendFinder(originBasedFinder) is Done"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jenrandrews @ sceylan : is it correct that originBasedFinder and originBasedLatestMaxPGAs will be destroyed once this method exits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at the full file and I think originBasedLatestMaxPGAs is truly locally scoped and will be destroyed. For originBasedFinder you are creating it with a "new" which means you should also call "delete" when done. So just add the line "delete originBasedFinder;" whenever in the function/code you are finished with the object (looks like line 647). The object looks locally scoped though, so you could also just create it with "Finder originBasedFinder = Finder(...);" and switch to "originBasedFinder.process()" and "sendFinder(&originBasedFinder)". Either approach should work =)
Adds origin input to scfinder.
Default delay warning threshold changed from 3s to 5s.