uafgeotools / rtm

A Python package for locating infrasound sources using reverse time migration
https://uaf-rtm.readthedocs.io/
MIT License
38 stars 13 forks source link

Short window length gives Value Error in Semblance stack #29

Closed jwbishop closed 4 years ago

jwbishop commented 4 years ago

Using a short window, e.g. 15 seconds, returns a ValueError when semblance is used as the stack function. The waveform looks like it's 30 seconds long. Using a shorter window of ~15 seconds returns a ValueError related to broadcasting. https://github.com/uafgeotools/rtm/blob/master/rtm/grid.py#L521

liamtoney commented 4 years ago

@davidfee5 is this an easy fix? Not too familiar with the code here.

liamtoney commented 4 years ago

The default regional example fails during grid_search() with a similar (same?) error:

    S = grid_search(processed_st=st_proc, grid=grid, time_method=TIME_METHOD,
  File "/Users/ldtoney/repos/rtm/rtm/grid.py", line 525, in grid_search
    dtmp[k, :] = np.hstack((tr.data[nrem:], nrem_zero))
ValueError: could not broadcast input array from shape (1320) into shape (1321)

Appears to be a simple indexing error.

davidfee5 commented 4 years ago

Yes, one of the stations has less samples than the others (1320 vs 1321). This should be fixed in process_waveform I think. Checking now.

davidfee5 commented 4 years ago

I think the two issues mentioned here are unrelated. The first one seems like a semblance-related window issue.