From @CelsoReyes on August 1, 2015 22:38
from Mike West's email:
TRACKED WAVEFORM LOADING
The rebuild should provide a way to know which waveforms were successfully loaded and which were skipped. Currently, a call for 50 traces will return however many elements were successfully found in the datasource. This may be 50. It may be 43. Though this sounds like minor, it has huge implications for the non-waveform data being managed concurrently in the script. Here is sample pseudo-code to demonstrate the issue:
- read a catalog of 50 events
- choose a preferred scnl
- read in waveforms for these 50 events on the preferred scnl
- insert the event information as added fields in the waveforms
This last step will fail unless all 50 waveforms were successfully loaded. Worse, it is not possible to tell which waveform(s) were unable to be loaded.
Solution 1
If a waveform call requests 50 traces, the waveform object that is returned should contain 50 elements, even if some of the requested data do not exist. The non-existant traces would appear as empty waveforms.
Solution 2
Provide an optional output argument that indexes which requested trace were (or were not) successfully loaded. This index array could be used against other matrices intended to mirror the waveform object in shape and size.
I find solution 1 to be the more elegant approach. But I could live with either. This is a huge issue for me however. There are hundreds of lines of code in GISMO, and entire functions, written to allow waveform loads that can be validated against the original request. The way waveform and datasource are currently written this is not a trivial retrofit (I tried it). But if this were built into the architecture of a rebuild, I am sure it would be much easier to include.
Copied from original issue: giseislab/gismotools#42
From @CelsoReyes on August 1, 2015 22:38
from Mike West's email:
Copied from original issue: giseislab/gismotools#42