swiss-seismological-service / scrtdd

Double Difference Relocator for SeisComP
27 stars 10 forks source link

Profile initialization step? #58

Closed cjhopp closed 2 years ago

cjhopp commented 2 years ago

Hello, just a quick question on offline multi-event relocation. I created a simple profile "patua" via scconfig, basically just pointing to a velocity model used successfully by scanloc. Is there a separate initialization step that I missed? Or maybe my installation of scrtdd is incorrect?

I ran the following line: scrtdd --ep testing/Patua_scanloc/events.xml --profile patua -d localhost --verbosity=3 --console=1 --log-file scrtdd.log --xmlout > events-relocated-dd.xml

and this is a snippet of the output:

10:48:29 [info] Relocating origin Origin/20220204222744.27972.945682 using profile patua
10:48:29 [info] Loading profile patua
10:48:29 [error] Cannot load profile patua (File  does not exist)
10:48:29 [info] Unloading profile patua
10:48:29 [error] Cannot relocate origin Origin/20220204222744.27972.945682 (Cannot relocate origin, profile patua not initialized)

happy to provide input files or other output that would help diagnose the issue (log file scrtdd.log isn't being written, though).

Thanks! Chet

luca-s commented 2 years ago

What version of scrtdd are you using? (scrtdd --version).

luca-s commented 2 years ago

Ah, I believe I understand the issue. The command you used tries to relocate in single-event mode every origin within testing/Patua_scanloc/events.xml, so it first loads the profile background catalog and I believe that's where you got the error: the background catalog is probably missing because you want to relocate in multi-event mode. To do so you need to also add the option --reloc-catalog myCatalog.csv.

# events.xml contais the events data (scxmldump command)
# myCatalog.csv contains the origin ids inside events.xml we want relocate
scrtdd --reloc-catalog myCatalog.csv --ep events.xml --profile myProfile \
       --verbosity=3 --console=1 [db options] 
cjhopp commented 2 years ago

Ah, okay, good to know (and thanks for the speedy reply!). I'll have a look through the docs again to see about creating myCatalog.csv from the database and then report back.

Because I already copied it, here's the version info:

sysop@fracture:~$ scrtdd --version
scrtdd: 1.6.1+
Framework: 4.8.2 Release
API version: 14.4.0
Data schema version: 0.11
GIT HEAD: 
Compiler: c++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Build system: Linux 4.15.0-20-generic
OS: Ubuntu 18.04 LTS / Linux
luca-s commented 2 years ago

Honestly I find counter-intuitive to add myCatalog.csv, but I had to distinguish the single-event vs multi-event mode somehow. The only advantage with that is that you can specify a subset of origins to relocate within myCatalog.csv, which might be useful in some occasions.

By the way, to create myCatalog.csv, just use the command grep on testing/Patua_scanloc/events.xml to fetch the publicID of the origins you want to relocate. You know, every origin has the property publicID:

<origin publicID="Origin/20181214107387.056851.253104">

Example myCatalog.csv:

seiscompId
Origin/20181214107387.056851.253104
Origin/20180053105627.031726.697885
Origin/20190121103332.075405.6234534
Origin/20190223103327.031726.346363
[...]

However, if you have multiple origins per event, then you want to relocate only the preferred origin, then change grep to find only the preferredOriginID tag

     <event publicID="smi:ch.ethz.sed/sc3a/2020wtaffs">                                                                                                                                                       
       <preferredOriginID>smi:ch.ethz.sed/sc3a/origin/NLL.20201118112353.99971.127031</preferredOriginID>
       <preferredMagnitudeID>smi:ch.ethz.sed/sc3a/Magnitude/20201118112401.025917.127042</preferredMagnitudeID>
       <type>earthquake</type>
    ....
cjhopp commented 2 years ago

Works like a charm, thanks for the quick help! The single-vs-multi mode solution makes sense to me, now that you mention it.

Chet

luca-s commented 2 years ago

I am glad it worked well!