UoA-eResearch / SPOC-Rongowai-L1

Translation of the Matlab L1 files into Python
MIT License
0 stars 1 forks source link

Better handling of "flat" DDMs #12

Closed mike-ivs closed 9 months ago

mike-ivs commented 1 year ago

Unfortunately back processing (and the automation) is tripping up on a small number of files (halting the automation). The issue is caused by L0 files that contain a "DDM" array that has no DDM - instead it contains a single non-NaN value across all 40x5 elements.

These DDMs are causing the coherence function "get_RongowaiWAFRMSD" to break as it calculates the background noise, then subtracts this from the signal DDM, then calculates the SNR ratio in decibels. Unfortunately for the case above (a "flat" DDM of a single value) this means that the noise value is the same as the signal value, the signal_minus_noise becomes 0, and the SNR in decibles takes a log10 which fails for 0 values.

My guess is that it would be better to not process these DDMs at all rather than adjust the SNR calculation (not really DDMs?).

It would be great if someone could take a look and figure out how/where best to ignore these DDMs (or whether to tweak the coherence code which I doubt).

mike-ivs commented 9 months ago

hopefully fixed by d3cf50f

mike-ivs commented 9 months ago

Fixed in 30944f2b7c9761d14153d2f18fc86f99c294e6fe

mike-ivs commented 6 months ago

Properly fixed in a6cb457