Skip to content
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

scamp offline mode doesn't provide origins to amplitude processors #65

Closed
acarapetis opened this issue Sep 4, 2023 · 3 comments
Closed

Comments

@acarapetis
Copy link
Contributor

Prior to 5.5.0, scamp --ep ... would provide hypocenters to AmplitudeProcessor::setEnvironment(). It seems that when the --picks option was introduced, the behaviour changed so that setEnvironment is now never passed a hypocenter, even when --picks is disabled.

I think the culprit is setting pick here: https://github.com/SeisComP/main/blob/master/apps/processing/scamp/amptool.cpp#L741
This means the if (pick) here will always be true: https://github.com/SeisComP/main/blob/master/apps/processing/scamp/amptool.cpp#L849

@acarapetis acarapetis changed the title scamp offline mode processes amplitudes without origins scamp offline mode doesn't provide origins to amplitude processors Sep 4, 2023
@gempa-jabe
Copy link
Contributor

Thank you, I can confirm the bug and a fix is currently in testing. If you want you can test the following fix yourself and report back:

diff --git a/apps/processing/scamp/amptool.cpp b/apps/processing/scamp/amptool.cpp
index 57cc45bed..fad7f4ec9 100644
--- a/apps/processing/scamp/amptool.cpp
+++ b/apps/processing/scamp/amptool.cpp
@@ -846,14 +846,15 @@ void AmpTool::process(Origin *origin, Pick *pickInput) {
                        proc->setReferencingPickID(pickID);
 
                        int res = -1;
-                       if ( pick ) {
+                       if ( origin ) {
+                               res = addProcessor(proc.get(), origin, pick.get(), distance, depth, (double) origin->time().value());
+                       }
+                       else {
                                SC_FMT_DEBUG("Measuring {} amplitude for pick {} independent of origin",
                                             ait->c_str(), pick->publicID().c_str());
                                res = addProcessor(proc.get(), nullptr, pick.get(), None, None, None);
                        }
-                       else {
-                               res = addProcessor(proc.get(), origin, pick.get(), distance, depth, (double) origin->time().value());
-                       }
+
                        if ( res < 0 ) {
                                // RecordStream not available
                                if ( res == -2 ) {

@filefolder
Copy link

^ can confirm that fixes the issue in 5.5.0. scamp now generates and stores amplitudes via offline processing and scmag reads these properly.

thanks both!

@gempa-jabe
Copy link
Contributor

Fixed in 5.5.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants