philusnarh / PROJECT

1 stars 0 forks source link

P-Links #3

Open philusnarh opened 6 years ago

philusnarh commented 6 years ago
  1. model_zernike https://github.com/ratt-ru/beam-me-up/blob/master/meerkat/notebooks/model_zernike.ipynb

  2. meerkat_model_spline_fit

https://github.com/ratt-ru/beam-me-up/blob/master/meerkat/notebooks/meerkat_model_spline_fit.ipynb

  1. New Scaled Beams

https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/m4gjyv8ypg4eu0k/new_scale_beam_parameters.ipynb

  1. Compare Coefficients & Produce Mean Coefficients

https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/1b21vqy8bebols5/more_scaled_beams.ipynb

  1. find missng elements

https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/w4zdmde75o0fm59/missing_elements.ipynb

  1. SPH Beams (by KMBA) https://github.com/ratt-ru/beam-me-up/blob/master/meerkat/notebooks/model_sh.ipynb
philusnarh commented 6 years ago
  1. Numpy Code https://scipython.com/book/chapter-6-numpy/

  2. 2D Interpolation Scipy https://stackoverflow.com/questions/37872171/how-can-i-perform-two-dimensional-interpolation-using-scipy

philusnarh commented 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)

philusnarh commented 6 years ago

GRSP_TRUE FOR BAND 2 https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/dizp0bi4q8y6cvd/spherical_grid_true.ipynb

https://nbviewer.jupyter.org/urls/dl.dropbox.com/s/pajdhk178jrf2bg/grasp_plots.ipynb

philusnarh commented 6 years ago

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

philusnarh commented 6 years ago

subplots options!!! https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.subplots.html

philusnarh commented 6 years ago

contour plots

https://www.python-course.eu/matplotlib_contour_plot.php

philusnarh commented 6 years ago

image