-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWI bug in get_surface #24
Comments
Patched in the awi_fix_surface branch. Smoothing is now available to deal with outliers. It uses a median filter with a prescribed window. Seems to handle the outlier end traces and NaN traces (with additional handling) pySnowRadar/pySnowRadar/snowradar.py Lines 191 to 192 in 591df7c
For now we need additional handling where the entire trace is nan. The exception triggers infilling of the radar data with 0 values. This does not modify the snow radar object and must be used in conjunction with the smoothing to create a decent surface. It will displace a warning when this happens. pySnowRadar/pySnowRadar/snowradar.py Lines 191 to 192 in 591df7c
This is all a bit too temporary and needs to be addressed in the long term as part of #2 I'd rather not roll these into master until the QA is finalized. |
Great, this indeed partly fixes the special surface issues with AWI data. Unfortunately, there's (at least) a third case, where due to descend/ascend of the plane the |
Huh, and I guess smoothing doesn't do really well if the weird |
Long term solution for this is to change the way processing.py handles individual radar traces. This will require it to drop np.nan values and evaluate only the valid data. The problem here is that we need a method to track how we are manipulating the arrays so that the picker index returns make sense. We'll tackle this before the alpha is done. Masking might be the key. |
@kingjml & @m9brady, something that I noticed this afternoon. I guess the null space removal in the function pySnowRadar/pySnowRadar/snowradar.py Lines 187 to 208 in 5a2100d
That's because of zero-patching all-NaN traces in pySnowRadar/pySnowRadar/snowradar.py Lines 176 to 196 in 591df7c
That got me thinking, could we then just ignore the zero
This should cover many cases, if not all? Or is this too simple to work? As it seems that backflipping (pun intended) nyquist zone crossings in connection to the EM-Bird ascends/descends in AWI data might cause bigger all-NaN patches, smoothing But in essence, would this make sense? If/when switching to dynamic handling of individual radar traces this becomes obsolete, right? |
This emails an AWI issue with calibration flights. Will move to close as a general issue. |
AWI data in its current state includes All-NaN traces and random traces where the last value has the highest value. That screws up the function
get_surface
, which in turn messes upget_bounds
. Therefore theradar_subset
has wrong boundaries, which allows radar data with NaN values to emerge, which in turn ends up ruining the interface picker.So far my hack has been using the elevation compensation, assigning 0 values for NaNs
surf_bin = np.nanargmax(np.nan_to_num(self.data_radar), axis=0)
, and finding the approximate modal value of the surface bin and using a threshold around it for boundariesThe text was updated successfully, but these errors were encountered: