Open philusnarh opened 6 years ago
create a zip of list in python
def npzfunc(n, keyword, outfil, data=None):
""" n: integer value
keyword: string, key name for the dictionary
outfil: string, outfile name"""
product = {}
key = []
if data is None:
u = np.arange(n)
else: u = np.array(data)
for ii in xrange(n):
key.append('%s%d' %(keyword, ii))
product.update(zip(key, u))
np.savez('%s' %outfil, **product)
return None
example:: npzfunc(n = 1, keyword='lst', outfil='diana', data)
Check out for amplitude \& phase
the output of the beam FITS file is the amplitude i.e. A=sqrt(re^2 + im^2) for each beam X_theta,X_phi,Y_theta,Y_phi. There is also an option to output the phase instead, i.e. psi=atan2(im, re).You can use those two outputs to reverse back to the complex:
Re[X_theta] = A[X_theta] cos psi[X_theta] Im[X_theta] = A[X_theta] sin psi[X_theta]
Then for each pixel you have a vector of 4 complex values [X_theta,X_phi,Y_theta,Y_phi]. To compute the Stokes parameters you need to compute the complex beams:
xx=X_thetanp.conj(X_theta)+X_phinp.conj(X_phi) yy=Y_thetanp.conj(Y_theta)+Y_phinp.conj(X_phi) xy=X_thetanp.conj(Y_theta)+X_phinp.conj(Y_phi) yx=Y_thetanp.conj(X_theta)+Y_phinp.conj(X_phi)
The conversion to Stokes is then:
I=(xx+yy).real Q=(xx-yy).real U=(xy+yx).real V=(xy-yx).imag
subplots options!!! https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.subplots.html
contour plots
model_zernike https://github.com/ratt-ru/beam-me-up/blob/master/meerkat/notebooks/model_zernike.ipynb
meerkat_model_spline_fit
https://github.com/ratt-ru/beam-me-up/blob/master/meerkat/notebooks/meerkat_model_spline_fit.ipynb
https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/m4gjyv8ypg4eu0k/new_scale_beam_parameters.ipynb
https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/1b21vqy8bebols5/more_scaled_beams.ipynb
https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/w4zdmde75o0fm59/missing_elements.ipynb