astronomy-laboratory / pyoof

pyoof is a Python package which performs out-of-focus (OOF) holography on astronomical beam maps for single-dish radio telescopes.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Format wavefront aberration distribution #17

Open tcassanelli opened 1 year ago

tcassanelli commented 1 year ago

We now know that the wavefront aberration distribution, $W(x, y)$ is a function with dimensions, there could be many conventions but what I think we should adopt is the following: $$W(x, y) = \sum K_{n\ell} U^\elln \quad \Rightarrow \varphi = \frac{2\pi}{\lambda} W(x, y)$$ then the fill phase of the aperture distribution (a.k.a., the pupil function) is given by the factor $\frac{2\pi}{\lambda}$, hence for the phase to be in radians, the aberration must have units of length, not important what value are since that information will be absorbed by. $K{n\ell}$ set.

tcassanelli commented 1 year ago

Then I suggest to do the following:

phi = (W / wavel.to_value(apu.m) + delta / wavel) * 2 * np.pi * apu.rad

instead of

https://github.com/astronomy-laboratory/pyoof/blob/0c42031452327384d656ba0c3ff8ca55b46def5e/pyoof/aperture/aperture.py#L431

so we expose the constant wavel.

tcassanelli commented 1 year ago

You should also include the key parameter wavel in the phase function

https://github.com/astronomy-laboratory/pyoof/blob/0c42031452327384d656ba0c3ff8ca55b46def5e/pyoof/aperture/aperture.py#L256

or equivalently, you could force the system to return $W(x,y)$ with units of length, i.e.

https://github.com/astronomy-laboratory/pyoof/blob/0c42031452327384d656ba0c3ff8ca55b46def5e/pyoof/aperture/aperture.py#L247-L252

hence,

return W * apu.m

whatever you think is more elegant, requires less modifications, and solves the problem. I agree that there's no clear solution path here ... in the future we should come up with a better way of defining the coefficients.

VicentePenaLet commented 1 year ago
K error

I made fits taking different amount of wavelengths from 250, 350 and 450 um. And compared the resulting Zernike Coefficients with the Real Zernike Coefficients of the simulation. In this graph I'm plotting the error in each of the K for the different test. it seems like the best fit is taking a single frequency of 450. Taking different frequencies seems to average to performance of the single frequency fits. below are the mean square errors for each of the wavelength combinations

tcassanelli commented 1 year ago

What do you mean with:

I'm plotting the error in each of the K for the different test.

Are taking the covariance matrix diagonal to obtain this value or is this something else?

Not sure if this is the best way to evaluate this. I would have done the following:

That way you are comparing the overall fit and not only a few parameters isolated. Remember that even if this is a simulation the aperture is not super orthonormal and correlation among parameters will exist.

tcassanelli commented 1 year ago

Maybe there's a relationship between the pr and the observing frequency?