Skip to content
Snippets Groups Projects
Commit 4eb35f86 authored by Stefano Covino's avatar Stefano Covino
Browse files

180524 commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 379 additions and 0 deletions
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
dist/*
Docs/*
Misc/*
Copyright (c) 2016 The Python Packaging Authority (PyPA)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Include the README
include ./README.md
# Include the license file
include ./LICENSE.txt
# Include all python files
recursive-include . *.py
# Exclude MacOS files
recursive-exclude . .DS_Store
# Swift Reduction Package: ELT
The Swift Reduction Package (hereafter SRP) is a packet of command line tools to solve problems (e.g. basic reduction and analysis tasks of optical/NIR astronomical data, quick cosmological computations, units conversions, etc.) often met in astronomical research activities.
This library contains functions and classes to work with the ELT.
Metadata-Version: 2.1
Name: SRPAstro.ELT
Version: 0.1.0b5
Summary: Tools for handling the ELT optical system under SRP
Home-page: UNKNOWN
Author: Stefano Covino
Author-email: stefano.covino@inaf.it
License: UNKNOWN
Description: # Swift Reduction Package: ELT
Background
The Swift Reduction Package (hereafter SRP) is a packet of command line tools to solve problems (e.g. basic reduction and analysis tasks of optical/NIR astronomical data, quick cosmological computations, units conversions, etc.) often met in astronomical research activities.
This library contains functions and classes to work with the ELT.
Keywords: astronomy data analysis
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3
Description-Content-Type: text/markdown
LICENSE.txt
MANIFEST.in
README.md
setup.cfg
setup.py
./setup.py
./Misc/segm_centers.py
./Misc/uni_aspher_old.py
./SRPELT/M1.py
./SRPELT/M2.py
./SRPELT/MuellerMetallicMirrorMatrixLayer.py
./SRPELT/__init__.py
./SRPELT/aspheric.py
./SRPELT/aspheric_polar.py
./SRPELT/aspheric_polar_der.py
./SRPELT/mirror_matrix.py
./SRPELT/segm_centers.py
./SRPELT/uni_aspher.py
./SRPELT/uni_sphere.py
./SRPELT/unit_vector.py
./build/lib/SRPELT/M1.py
./build/lib/SRPELT/M2.py
./build/lib/SRPELT/MuellerMetallicMirrorMatrixLayer.py
./build/lib/SRPELT/__init__.py
./build/lib/SRPELT/aspheric.py
./build/lib/SRPELT/aspheric_polar.py
./build/lib/SRPELT/aspheric_polar_der.py
./build/lib/SRPELT/mirror_matrix.py
./build/lib/SRPELT/segm_centers.py
./build/lib/SRPELT/uni_aspher.py
./build/lib/SRPELT/uni_sphere.py
./build/lib/SRPELT/unit_vector.py
SRPAstro.ELT.egg-info/PKG-INFO
SRPAstro.ELT.egg-info/SOURCES.txt
SRPAstro.ELT.egg-info/dependency_links.txt
SRPAstro.ELT.egg-info/requires.txt
SRPAstro.ELT.egg-info/top_level.txt
SRPELT/M1.py
SRPELT/M2.py
SRPELT/MuellerMetallicMirrorMatrixLayer.py
SRPELT/__init__.py
SRPELT/aspheric.py
SRPELT/aspheric_polar.py
SRPELT/aspheric_polar_der.py
SRPELT/mirror_matrix.py
SRPELT/segm_centers.py
SRPELT/uni_aspher.py
SRPELT/uni_sphere.py
SRPELT/unit_vector.py
\ No newline at end of file
SRPAstro>=4.2
pynverse
SRPELT
This diff is collapsed.
""" Utility functions and classes for SRP
Context : SRP
Module : SRPELT
Version : 1.0.0
Author : Stefano Covino
Date : 06/04/2017
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage :
Remarks :
History : (06/04/2017) First version.
"""
import numpy as np
from astropy.table import Table, Column
import SRPELT
from SRPELT.segm_centers import segm_centers
from SRPELT.aspheric_polar_der import aspheric_polar_der
from SRPELT.aspheric_polar import aspheric_polar
import collections
class M1:
def __init__(self, cr=SRPELT.M1_CR, k=SRPELT.M1_k):
self.CR = cr
self.K = k
def grid (self):
t = segm_centers()
#
r = np.sqrt(t['x']**2+t['y']**2)
t['z_asph'] = aspheric_polar(r,self.CR,self.K)
#
th = aspheric_polar_der(r,self.CR,self.K)
t['theta'] = np.degrees(np.arctan(th))
#
return t
def xy (self, x, y):
r = np.sqrt(x**2+y**2)
z = aspheric_polar(r,self.CR,self.K)
th = aspheric_polar_der(r,self.CR,self.K)
theta = np.degrees(np.arctan(th))
t = Table()
if isinstance(x,collections.Iterable):
t['x'] = Column(x)
t['y'] = Column(y)
t['z'] = Column(z)
t['theta'] = Column(theta)
else:
t['x'] = Column([x])
t['y'] = Column([y])
t['z'] = Column([z])
t['theta'] = Column([theta])
return t
def asph (self, r):
return aspheric_polar(r,self.CR,self.K)
def dasph (self, r):
return aspheric_polar_der(r,self.CR,self.K)
""" Utility functions and classes for SRP
Context : SRP
Module : SRPELT
Version : 1.0.0
Author : Stefano Covino
Date : 06/04/2017
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage :
Remarks :
History : (06/04/2017) First version.
"""
import numpy as np
import SRPELT
from SRPELT.aspheric_polar import aspheric_polar
from SRPELT.aspheric_polar_der import aspheric_polar_der
from SRPELT.uni_aspher import uni_aspher
from astropy.table import Table, Column
import collections
class M2:
def __init__(self, cr=SRPELT.M2_CR, k=SRPELT.M2_k, r4=SRPELT.M2_r4, r_min=SRPELT.M2_min_r, r_max=SRPELT.M2_max_r):
self.CR = cr
self.K = k
self.R4 = r4
self.R_MIN = r_min
self.R_MAX = r_max
def grid(self):
x,y,z = uni_aspher(10,50,self.R_MIN,self.R_MAX,self.CR,self.K,0.,self.R4)
r = np.sqrt(x**2+y**2)
t = Table([x,y,z],names=['x','y','z'])
th = aspheric_polar_der(r,self.CR,self.K,0.,self.R4)
t['theta'] = np.degrees(np.arctan(th))
return t
def xy (self, x, y):
r = np.sqrt(x**2+y**2)
z = aspheric_polar(r,self.CR,self.K,0.,self.R4)
th = aspheric_polar_der(r,self.CR,self.K,0.,self.R4)
theta = np.degrees(np.arctan(th))
t = Table()
if isinstance(x,collections.Iterable):
t['x'] = Column(x)
t['y'] = Column(y)
t['z'] = Column(z)
t['theta'] = Column(theta)
else:
t['x'] = Column([x])
t['y'] = Column([y])
t['z'] = Column([z])
t['theta'] = Column([theta])
return t
def asph (self, r):
return aspheric_polar(r,self.CR,self.K,0.,self.R4)
def dasph (self, r):
return aspheric_polar_der(r,self.CR,self.K,0.,self.R4)
""" Utility functions and classes for SRP
Context : SRP
Module : Polarimetry
Version : 1.0.0
Author : Stefano Covino
Date : 04/04/2017
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage : to be imported
Remarks : angle is in radians, df with the same units as wave,
real and imaginary part of the refraction index
can be found at: http://refractiveindex.info/
ambri, metri, layri sono gli indici di rifrazione dell'ambiente,
del mezzo e del layer.
History : (04/04/2017) First version.
"""
import numpy as np
import cmath
def MuellerMetallicMirrorMatrixLayer (ambri, metri, layri, wave, df, angle=np.radians(45.0)):
thetaf = np.arcsin(np.sin(angle)/layri)
thetab = np.arcsin(layri*np.sin(thetaf)/metri)
deltaf = (2*np.pi/wave)*layri*df*np.cos(thetaf)
#
# p-polarization
etabp = metri*np.cos(thetab)
etafp = layri*np.cos(thetaf)
etamp = ambri*np.cos(angle)
# s-polarization
etabs = metri/np.cos(thetab)
etafs = layri/np.cos(thetaf)
etams = ambri/np.cos(angle)
#
Emp = complex(np.cos(deltaf),(etabp/etafp)*np.sin(deltaf))
Hmp = complex(etabp*np.cos(deltaf),etafp*np.sin(deltaf))
Ems = complex(np.cos(deltaf),(etabs/etafs)*np.sin(deltaf))
Hms = complex(etabs*np.cos(deltaf),etafs*np.sin(deltaf))
#
rp = (etamp*Emp-Hmp)/(etamp*Emp+Hmp)
rs = (etams*Ems-Hms)/(etams*Ems+Hms)
#
RP = abs(rp)
RS = abs(rs)
DLT = cmath.phase(rp)-cmath.phase(rs)
#
r1 = [0.5*(RP**2+RS**2), 0.5*(RS**2-RP**2), 0., 0.]
r2 = [0.5*(RS**2-RP**2), 0.5*(RP**2+RS**2), 0., 0.]
r3 = [0., 0., RP*RS*np.cos(DLT), RP*RS*np.sin(DLT)]
r4 = [0., 0., -RP*RS*np.sin(DLT), RP*RS*np.cos(DLT)]
return np.matrix([r1, r2, r3, r4])
#
"""
Context : SRP
Module : ELT
Version : 1.0.0
Author : Stefano Covino
Date : 14/06/2017
E-mail : stefano.covino@brera.inaf.it
URL : http://www.me.oa-brera.inaf.it/utenti/covino
Usage : to be imported
Remarks :
History : (14/06/2017) First version.
"""
__version__ = '0.1.0b5'
datadir = 'Data'
segmfile = 'SegmentVertices.txt'
# Mirror data (m)
#
M1_k = -0.996473
M2_k = -2.208857
M1_Diam = 38542/1e3
M2_Diam = 4101.065/1e3
M1_CR = 68685/1e3
M2_CR = 8810/1e3
M1_min_r = 4709/1e3
M1_max_r = 19573/1e3
M2_min_r = 475/1e3
M2_max_r = 2077.5/1e3
M2_r4 = -5.1981957e-016/1e3
M1toM2 = 30829.45/1e3
__all__ = ['aspheric_polar', 'aspheric_polar_der', 'aspheric', 'M1', 'M2',
'MuellerMetallicMirrorMatrixLayer', 'mirror_matrix', 'segm_centers',
'uni_aspher', 'uni_sphere', 'unit_vector']
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment