ldeo-glaciology / XApRES_old

A package for collecting data from the British Antarctic Survey's Autonomous Phase-Sensitive Radar (ApRES) in Xarrays and processing it
MIT License
2 stars 1 forks source link

Add calculations for vertical velocities #5

Closed glugeorge closed 1 year ago

glugeorge commented 1 year ago

Loosely adapt ImpDAR's phase2range function and assign to a class in ApRESDefs

jkingslake commented 1 year ago

Yes! This would be great! Do you think it makes sense to add this to the FormProfile method of the ChirpObject class here. -- so that when you form a profile you also always compute the fine range.

It would also be nice to have a simple way of applying this to the data once it is already stored in an xarray --- a method of the xapres class that calls ChirpObject.FormProfile with a xarray contained the ApRES data as an input.

glugeorge commented 1 year ago

I'm quite close to adding this, the math is all there (adapted from ImpDAR), and it is nearly incorporated properly into the xarray. How do you envision the final structure to look? I.e., should the fine range adjustment be built into the profile_range dimension, or should it be its own? Here's a screenshot of the structure I have so far: image

As of now, even though the shape of the profile_fine variable is the same as the shape of profile_range inside the _burst_to_xarray function, when everything gets concatenated together, it is extended. I'm in the midst of investigating this (I think I'm missing a single operation in the function calling the burst_to_xarray function), but it would be nice to get an agreement on the envisioned strucutre first.

jkingslake commented 1 year ago

nice work.

The profiles get cropped here to a given depth are you doing the same cropping for the profile fine?

I think profile_range and 'profile_fine` should have the same length in the end, right?

glugeorge commented 1 year ago

Summarizing takeaways from yesterday's discussion. The new plan for adding in phase2range will be as an external function outside of class objects. The reasoning behind this is that it can operate on the xarray after it has been generated to determine velocities from phase differences between time steps. It can also be repurposed to use for calculating fine range adjustments for range calculations. Regardless, it was determined that it'd be most flexible to leave it outside of the classes and focus on setting up the xarrays properly for the phase2range function to operate on.

glugeorge commented 1 year ago

Updated title to be more relevant to what I'm trying to address. My latest commit to my fork now has the code for calculating the range_difference/velocity between two individual bursts. It doesn't quite work for an xarray dataset containing multiple bursts quite yet. Here is my example notebook for progress thus far: https://nbviewer.org/github/glugeorge/XApRES/blob/main/notebooks/tests/usingXApRES_velocities.ipynb

9

jkingslake commented 1 year ago

should we move this discussion over to the new repo https://github.com/ldeo-glaciology/xapres_package, if that is where we are doing the work now?

I am thinking that we should try to archive this repo, so we dont get confused between this one and the one we are working on now.

glugeorge commented 1 year ago

Yeah that sounds good. I'll add it in!