[yam]ZeroDivisionError: division by zero

Tom Eulenfeld tom.eulenfeld at uni-jena.de
Thu Aug 9 11:22:23 CEST 2018


Dear Blaž,

please double-check your configuration. It is possible to set downsample 
option to null (None) or the target frequency or to delete the option 
entirely.

I can reproduce the reported behavior if I set downsample to false which 
is interpreted as a target frequency of zero.

Did this solve the issue?

Best,
Tom



On 09.08.2018 10:04, Blaž Vičič wrote:
> Dear all.
> I am trying to process some data using yam. Prior to the correlation, I 
> removed the response of the data and downsampled it to 20Hz.
>   when I call yam correlate 1, this is the error I get:
> 
> (obspy) pb-vicic:proc_2 bvicic$ yam correlate 1
> 
> 0%| | 0/730 [00:00<?, ?it/s]multiprocessing.pool.RemoteTraceback:
> 
> """
> 
> Traceback (most recent call last):
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/multiprocessing/pool.py", 
> line 119, in worker
> 
> result = (True, func(*args, **kwds))
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/correlate.py", 
> line 549, in correlate
> 
> **preprocessing_kwargs)
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/correlate.py", 
> line 392, in preprocess
> 
> stream.traces = start_parallel_jobs_inner_loop(stream, do_work, njobs)
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/correlate.py", 
> line 26, in start_parallel_jobs_inner_loop
> 
> results = [do_work(task) for task in tasks]
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/correlate.py", 
> line 26, in <listcomp>
> 
> results = [do_work(task) for task in tasks]
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/correlate.py", 
> line 310, in _prep1
> 
> interpolate_options=interpolate_options)
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/correlate.py", 
> line 266, in _downsample_and_shift
> 
> dt = 1 / target_sr
> 
> ZeroDivisionError: division by zero
> 
> """
> 
> 
> The above exception was the direct cause of the following exception:
> 
> 
> Traceback (most recent call last):
> 
> File "/Users/bvicic/anaconda3/envs/obspy/bin/yam", line 11, in <module>
> 
> sys.exit(run_cmdline())
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/main.py", 
> line 388, in run_cmdline
> 
> run(**args)
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/main.py", 
> line 147, in run
> 
> run2(command, **args)
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/main.py", 
> line 211, in run2
> 
> yam.commands.start_correlate(io, **args)
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/yam/commands.py", 
> line 101, in start_correlate
> 
> total=len(tasks)):
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/tqdm/_tqdm.py", 
> line 930, in __iter__
> 
> for obj in iterable:
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/multiprocessing/pool.py", 
> line 735, in next
> 
> raise value
> 
> ZeroDivisionError: division by zero
> 
> Exception ignored in: <bound method tqdm.__del__ of 0%| | 0/730 
> [00:00<?, ?it/s]>
> 
> Traceback (most recent call last):
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/tqdm/_tqdm.py", 
> line 882, in __del__
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/tqdm/_tqdm.py", 
> line 1087, in close
> 
> File 
> "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/site-packages/tqdm/_tqdm.py", 
> line 439, in _decr_instances
> 
> File "/Users/bvicic/anaconda3/envs/obspy/lib/python3.6/_weakrefset.py", 
> line 109, in remove
> 
> KeyError: <weakref at 0x10dd03b88; to 'tqdm' at 0x10dd13cf8>
> 
> 
> any idea whats going on here? I changed the data with the originals and 
> added remove response and downsample to config, but the error is same.
> 
> the example works though.
> 
> Thanks,
> blaz
> 
> 
> _______________________________________________
> seistools mailing list
> seistools at listserv.uni-jena.de
> https://lserv.uni-jena.de/mailman/listinfo/seistools
> 


More information about the seistools mailing list