Skip to content

[scautoloc] Export secondaryAzimuthalGap in OriginQuality#116

Draft
comoglu wants to merge 1 commit intoSeisComP:mainfrom
comoglu:fix/scautoloc-secondary-azimuthal-gap
Draft

[scautoloc] Export secondaryAzimuthalGap in OriginQuality#116
comoglu wants to merge 1 commit intoSeisComP:mainfrom
comoglu:fix/scautoloc-secondary-azimuthal-gap

Conversation

@comoglu
Copy link
Copy Markdown
Contributor

@comoglu comoglu commented Apr 16, 2026

Problem

scautoloc computes the secondary azimuthal gap internally via determineAzimuthalGaps() and uses it as a rejection criterion, but the value was never written into OriginQuality when exporting the origin to SeisComP. As a result, scautoloc origins always have secondaryAzimuthalGap unset — unlike stdloc and scrtdd which both populate it.

This was confirmed as an oversight by @jsaul:

"Certainly an oversight. There is determineAzimuthalGaps() and geoProperties(); the latter was implemented by someone else."

Fix

Call determineAzimuthalGaps() in convertToSC() (sc3adapters.cpp) and set secondaryAzimuthalGap on the exported OriginQuality. The function was already available and correct — it just wasn't called at export time.

Related

Companion PR in SeisComP/common adds a standalone computeAzimuthalGaps(azimuths, primary*, secondary*) library function so the algorithm has a single home, as @jsaul suggested: SeisComP/common#193

@cla-bot cla-bot Bot added the cla-signed The CLA has been signed by all contributors label Apr 16, 2026
scautoloc computes the secondary azimuthal gap internally via
determineAzimuthalGaps() and uses it as a rejection criterion, but the
value was not written into OriginQuality when exporting the origin to
SeisComP. This caused scautoloc origins to always have
secondaryAzimuthalGap unset, unlike stdloc and scrtdd which both
populate it.

Call determineAzimuthalGaps() in convertToSC() and set
secondaryAzimuthalGap on the exported origin.
@comoglu comoglu force-pushed the fix/scautoloc-secondary-azimuthal-gap branch from 9130cc4 to 1c32d36 Compare April 16, 2026 22:41
@gempa-jabe
Copy link
Copy Markdown
Contributor

Now the azimuthal gap will be computed two times in geoProperties and in determineAzimuthalGaps? Wouldn't it make sense to fix both methods or find a common strategy? Both methods were implemented back in 2008 and even fixed in 2024 ...

@jsaul
Copy link
Copy Markdown
Contributor

jsaul commented Apr 17, 2026

This is the exact idea, to get rid of redundant code by using the compile().

@gempa-jabe
Copy link
Copy Markdown
Contributor

So this PR is a draft and not about to be merged?

@comoglu
Copy link
Copy Markdown
Contributor Author

comoglu commented Apr 17, 2026

One thing I'd like to understand better: in the autoloc context, are DataModel::Pick objects registered in the global public object store at the point convertToSC() is called? compile() relies on Pick::Find() for station counts, and I noticed the Pick::Find() block in convertFromSC() was commented out with a note (german) . Wondering if that affects the station count fields if we go the compile() route.

@comoglu comoglu marked this pull request as draft April 17, 2026 08:53
@comoglu
Copy link
Copy Markdown
Contributor Author

comoglu commented Apr 17, 2026

I converted the PR to Draft until I understand that part better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The CLA has been signed by all contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants