QC data filtering and non-standard product loading#79
Conversation
📚 Documentation Preview Ready!🌐 Live PreviewURL: https://xopr-pr-79.surge.sh/xopr/ Preview updates automatically with new commits while the 📦 Download ArtifactYou can also download the docs for local viewing. Commit: To trigger a preview, add the |
|
Direct links to relevant notebooks to look at: |
|
The qc_heading_change doesn't seem to be working correctly (at least not for 2008_Antarctica_ BaslerJKB). Heading is in radians (and is for a lot of seasons).... might be the problem Edit: this actually looks like it's coming from a problem with the heading field in a lot of the data |
|
@elizadawson I added a notebook (https://xopr-pr-79.surge.sh/xopr/repicking/) showing a couple of ways of doing surface and bed repicking. After looking at this a bit, I'm not sure we need to actually add anything to xOPR. I think it can be expressed pretty cleanly with just a helper function expressing the logic you want ( |
This reverts commit cc2a55c.
ba83123 to
db41c4f
Compare
|
I rebased this off main since there have been a lot of changes there. @elizadawson How has the QC workflow been going for you? Should we get this merged into main? |
|
Yes, merging this branch into main would be great! |
|
/preview |
✅ Documentation Preview Ready!🌐 Live PreviewURL: https://xopr-pr-79.surge.sh/xopr/ Commit: Preview deployed via |
There was a problem hiding this comment.
This looks good-- some minor comments / suggestions on a few lines and notebook outputs.
Out of scope for this PR, but the repicking notebook could be made cooler if we were to fold in the tool we did for Michael as a way to manually repick the bed...
There was a problem hiding this comment.
The :::{info} block directive isn't valid and doesn't render properly -- we need either:
tip, warning, important, caution, danger, error, hint, attention, seealso, or the generic admonition (with a user-supplied title). Guessing either {note} or {tip}...
There was a problem hiding this comment.
The output from the flight track map would be a bit easier to read if we were filling in the ocean like we do for the background map here.
| noise_floor = np.nanmean(data[:, -noise_region_samples:], axis=1) | ||
|
|
||
| with np.errstate(divide="ignore", invalid="ignore"): | ||
| snr_db = 10.0 * np.log10(bed_power / noise_floor) |
There was a problem hiding this comment.
claude seems to think that we're calculating amplitude here rather than bed power-- no idea if this is correct, but worth double checking...
snr_bed_pick dB scaling (line 225): data is np.abs(Data) → amplitude, not power. For amplitude the convention is 20·log10(...); for power it's 10·log10(...). Current code labels the intermediate bed_power but feeds amplitude through the 10× formula, so reported SNRs are half of what users probably expect. Worth reconciling (either square first, or change the factor).
There was a problem hiding this comment.
Data is an "Nt by Nx single or double array containing the radar echogram in linear power units" (Echogram File Guide), so I think Claude is wrong here. It's assuming that Data is amplitude but it's actually power.
|
|
||
| n_traces = data.shape[0] | ||
| bed_power = np.full(n_traces, np.nan) | ||
| for i in range(n_traces): |
There was a problem hiding this comment.
Could be vectorized:
idx = np.clip(np.searchsorted(twtt, bottom_twtt), 0, data.shape[1] - 1)
bed_power = np.where(np.isnan(bottom_twtt), np.nan, data[np.arange(n_traces), idx])
This PR is intended to address two feature requests:
This is a work in progress, but I wanted to share something so that we could get feedback from everyone on it.
The best thing is to look at the two new docs notebooks added. They are called
qc_demo.ipynbandnonstandard_data_products.ipynband should be available in the rendered docs preview shortly.A few specific questions:
And the most important question: For @elizadawson, does this meet the needs of your workflow?