stanford-futuredata / FAST

End-to-end earthquake detection pipeline via efficient time series similarity search
Apache License 2.0
145 stars 55 forks source link

Generating Fingerprint #23

Open sf-wilbur opened 3 years ago

sf-wilbur commented 3 years ago

Hi, I'm trying to replicate what you all have done to generate fingerprints but I'm running into an issue. I have generated a .json file for several .sac files containing the data to be used for generating the fingerprints. I edited a global_indices file to contain these fpinput.json files as well a the config.json file. When running the code the same way you all do in the tutorial, "python run_fp.py -c config.json" I'm given an error saying there is no such directory. The specific error is as follows, "IOError: [Errno 2] No such file or directory: u'../data/waveforms02/Deci5.Pick.20200413000000.01.02.DPZ.sac'" Do we need to direct it to the waveform file and not the .sac file?

Thanks for the help,

Spencer

kexinrong commented 3 years ago

Hi Spencer,

Thanks for reaching out. This sounds like a config error, maybe due to relative path. Are your sac files under FAST/data/waveforms02/? The wrapper script (run_fp) basically cds in to the fingerprint folder, and run python gen_fp.py [fp_input_.json] from there. You can try the gen_fp script first, and if it gives the same error, you can start debugging from there.

Kexin

sf-wilbur commented 3 years ago

Thanks for getting back to me. Right now the sac files are under FAST/data/waveforms02/. We are currently only looking at a day's worth of data so we have eight different waveform folders and within each waveform there are three sac files, one for each channel. Are you suggesting moving the fpinput.json files to the fingerprint folder or the subdirectory fingerprint folder under parameters?

Best,

Spencer

On Nov 19, 2020, at 11:47 PM, Kexin Rong notifications@github.com wrote:

Hi Spencer,

Thanks for reaching out. This sounds like a config error, maybe due to relative path. Are your sac files under FAST/data/waveforms02/? The wrapper script (run_fp) basically cds in to the fingerprint folder, and run python gen_fp.py [fpinput.json] from there. You can try the gen_fp script first, and if it gives the same error, you can start debugging from there.

Kexin

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stanford-futuredata/FAST/issues/23#issuecomment-730926804, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSRCUQCF6HDJQLYQ3QOFFLSQYGHXANCNFSM4T4AGAUQ.

kexinrong commented 3 years ago

It's a bit hard for me to debug with only the provided information, but here is what I was suggesting: ~/FAST$ cd fingerprint/ ~/FAST/fingerprint$ python gen_fp.py ../parameters/fingerprint/fp_input_*.json Of course, you should replace the path with the actual path of your fpinput*.json file. If the above fails, it means that there are probably problems with your fp_input files.

I also suggest that you change the relative path ../data/waveforms02/ to an absolute path in the fp_input files. The location of fp_input files should not matter.