krischer / instaseis

Instant high-frequency seismograms from an AxiSEM database
http://instaseis.net
Other
51 stars 23 forks source link

finite sources do not work in GUI #14

Closed martinvandriel closed 8 years ago

martinvandriel commented 9 years ago

Seems to be related to changes in resampling:

Traceback (most recent call last): File "/home/ex/local/src/instaseis/instaseis/gui/instaseis_gui.py", line 721, in on_update_button_released self.update(force=True) File "/home/ex/local/src/instaseis/instaseis/gui/instaseis_gui.py", line 402, in update progress_callback=get_prog_fct()) File "/home/ex/local/src/instaseis/instaseis/base_instaseis_db.py", line 428, in get_seismograms_finite_source a=kernelwidth, window="blackman") File "/home/ex/local/src/instaseis/instaseis/lanczos.py", line 237, in lanczos_interpolation _validate_parameters(data, old_start, old_dt, new_start, new_dt, new_npts) File "/home/ex/local/src/instaseis/instaseis/lanczos.py", line 68, in _validate_parameters raise ValueError("The new array must be fully contained in the old " ValueError: The new array must be fully contained in the old array. No extrapolation can be performed.

martinvandriel commented 9 years ago

well, probably some more things in the interface changed.

krischer commented 9 years ago

What event did you use and does it also happen with the instaseis API?

martinvandriel commented 9 years ago

The USGS files from tides. In the API, there is a test, so I guess you adapted the tests to the new interface but not the GUI? I get a bunch of other errors when I use the GUI with finite sources also when resampling is off. I think these are related to the changes in resampling, source shifting etc.

krischer commented 9 years ago

Yea I guess we just need to adjust settings in the GUI. I'll have a look at it next week. If somebody feels like it we should also write tests for the GUI ;-)

sstaehler commented 9 years ago

Maybe a related problem with a USGS param file for the Okhotsk earthquake: [http://earthquake.usgs.gov/archive/product/finite-fault/usb000h4jh/us/1429394102320/web1/b000h4jh.param]

src = instaseis.FiniteSource.from_usgs_param_file('b000h4jh.param')
for i in range(0, len(names)): 
  print names[i]
  receiver = instaseis.Receiver(
    latitude=lat[i], longitude=lon[i], network="AB", station=names[i][3:7])
  st = db.get_seismograms_finite_source(sources=src, receiver=receiver, components='Z')

(and yes, I know, the loop is not very pythony...)


ValueError Traceback (most recent call last)

in () 4 latitude=lat[i], longitude=lon[i], network="AB", station=names[i][3:7]) 5 ----> 6 st = db.get_seismograms_finite_source(sources=src, receiver=receiver, components='Z') 7 st.write("%s.finite_source.MSEED"%names[i], format="MSEED") /home/staehler/instaseis/instaseis/base_instaseis_db.py in get_seismograms_finite_source(self, sources, receiver, components, kind, dt, kernelwidth, correct_mu, progress_callback) 413 data = self.get_seismograms( 414 source, receiver, components, reconvolve_stf=True, --> 415 return_obspy_stream=False, remove_source_shift=False) 416 417 if correct_mu: /home/staehler/instaseis/instaseis/base_instaseis_db.py in get_seismograms(self, source, receiver, components, kind, remove_source_shift, reconvolve_stf, return_obspy_stream, dt, kernelwidth) 277 278 if abs((source.dt - self.info.dt) / self.info.dt) > 1e-7: --> 279 raise ValueError("dt of the source not compatible") 280 281 stf_conv_f = np.fft.rfft(source.sliprate, ValueError: dt of the source not compatible