Skip to content
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

depth trimming using a surface following algorithm #36

Open
mmartini-usgs opened this issue Oct 17, 2018 · 5 comments
Open

depth trimming using a surface following algorithm #36

mmartini-usgs opened this issue Oct 17, 2018 · 5 comments

Comments

@mmartini-usgs
Copy link
Contributor

This is something we have done in the past for up-looking ADCP profiles. Now that we are moving on to python, do we still want this? Or do we trim to a depth bin that guarantees all data are included? I'm asking because I don't see such a method here in stglib, maybe I missed it.

If so, there are two approaches:

  1. Use pressure to determine the surface location. assumes the pressure measurement is good. Note that older ADCP data will not have pressure. Maybe that data is old enough we don't care.
  2. Use backscatter peak, preferably from the center beam. This has been written in MATLAB already. Does it exist in python? Should it be written?
@dnowacki-usgs
Copy link
Member

Hi Marinna, check out:
https://github.com/dnowacki-usgs/stglib/blob/bd869605ea36a31ea1f28197d1b2915bb2d9f273/stglib/aqd/qaqc.py#L248
This implements approach 1 in your post. So far only implemented for Aquadopp data; should be able to use the same code for RDI data.

@mmartini-usgs
Copy link
Contributor Author

Thanks, I did see this code. It uses pressure or water level, the issue of profilers without integral pressure data may come up later - or not. Ellyn says it's really preference, a straight trim at one bin that includes the highest tide would satisfy BBV requirements for us in Woods Hole. It should work on the V and Signature as those instruments do have pressure, if it doesn't I'll comment here.

Where pressure is not available, detecting a peak in acoustic backscatter has been the method to determine the location of the surface. We may end up writing this in python anyway for wave statistics from the center beam of the V and altimeter data from the Signature.

@mmartini-usgs
Copy link
Contributor Author

It failed right off because the variable names are different for the Aquadopp, I'm working on an EPIC compliant file with u_1205, v_1206 etc.

@dnowacki-usgs
Copy link
Member

dnowacki-usgs commented Oct 18, 2018

Commit df821da should fix this issue and allow you to pass arbitrary values to trim using the data_vars argument. If you have code to detect a backscatter peak, I'd welcome a PR.

https://github.com/dnowacki-usgs/stglib/blob/df821daded5d0669a00dccb3d5edaa6831ec684c/stglib/aqd/qaqc.py#L248

@mmartini-usgs
Copy link
Contributor Author

OK, while I was waiting I wrote a variant that simply looked up what variables had 'depth' coordinate. Using the statements in your method it trimmed nicely surface following.
Now what is the trick for keeping NaNs out of the final written file when it is trimmed down to the highest bin that still contains data? Setting the _FillValues in the new Dataset object to be trimmed back to 1E35 before doing the trim operation did not do the trick. I think you are going to have to explicitly us the _FillValue in the trim operation here: ds = ds.isel(bindist=slice(0, lastbin))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants