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

phase_uncertainty() in ApRES tutorial #48

Open
neoshanarayanan opened this issue Sep 18, 2024 · 4 comments
Open

phase_uncertainty() in ApRES tutorial #48

neoshanarayanan opened this issue Sep 18, 2024 · 4 comments

Comments

@neoshanarayanan
Copy link

Hi, I'm using Impdar for the first time and trying to process some ApRES data. In the example notebooks on the Impdar documentation, both the uncertainty and phase coherence sections use the method phase_uncertainty() which is supposed return two values, phi_unc and r_unc. However, phase_uncertainty() doesn't actually return anything (returns NoneType). Has this method been deprecated, or is there another way to do this? Thanks!

@dlilien
Copy link
Owner

dlilien commented Sep 18, 2024

Hi Neosha, We never fully got documentation together for the ApRES side of things. Too many things to do...

phase_uncertainty isn't deprecated, it just now has no returns and instead adds an "uncertainty" property to the object it is called on. So, that example should really just have apres_data.phase_uncertainty(bed_range) where the bed_range is used in estimating the noise floor. then apres_data2.uncertainty will be defined, and will be the phase uncertainty.

For the r_uncertainty, you will want to use apres_data.range_diff(uncertainty = 'CR') or apres_data.range_diff(uncertainty = 'noise_phasor'). Either way, the range uncertainty will then be defined in apres_data.w_err.

Hopefully @benhills can correct anything I screwed up here, since he is the one who wrote these routines.

@benhills
Copy link
Collaborator

I am sorry. This is all a mess. David explained it correctly, it is just that I never updated that notebook.

Neosha, were you able to load the data at least? In some work with another student I realized that BAS had a new data format which I wasn't able to load by default. I had it on my to do list to write a new reader but got caught up in other things.

If you are able to load the data then we can relatively easily do a workaround on the notebook and I can update that soon.

@benhills
Copy link
Collaborator

Hi @neoshanarayanan, sorry I never dealt with this.
A while ago, I moved the demo notebooks to my own repository because the original owner was an undergrad who was working on some of this stuff, but he has since left. To keep it cleaner I forked that tutorial repository and now maintain it here. I am now trying to figure out how to track that repository from the readthedocs without doing a manual change to the rst files.
Anyway, the notebooks there should be more helpful to you.

Otherwise, happy to have a call with you about it.
-Ben

@benhills
Copy link
Collaborator

Yes, the way that I rewrote this is with three separate types of ApRES objects. What I will call the 'base' object is for a single acquisition, that is what you would load and plot in the introductory notebook 'ImpDAR_ApRES_Tutorial'. Then, you can load two of those together for a time_diff object which you would use for interferometry (i.e., vertical velocities and basal melting). If you load two raw files together it tries to do the initial processing automatically, then you can work on it as a time_diff object. Finally, there is a quadpol object for polarimetry as well, but I get the sense that is not what you are concerned with at the moment.

In short, you can load your raw files as a 'base' object, with load_apres() as in the introductory notebook, then you can save them as .mat or .h5 with dat.save(). That is how I got to the .mat.

To be transparent with you, there are several different ApRES libraries (Jonny Kingslake is developing one for instance) and it won't hurt my feelings if another is easier to use. I just wrote this as a grad student because there was nothing else in Python to work with these data at the time.

Happy to have a call as well, if so please email for a time, [email protected]

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

3 participants