InterpolateEfficiencyTable¶
- class marxs.missions.mitsnl.catgrating.InterpolateEfficiencyTable(tab, k=1)[source] [edit on github]¶
Bases:
object
Order Selector for MARXS using a specific kind of data table.
Ralf Heilmann from the SNL typically writes simulated grating efficiencies into Excel tables. Since Excel is hard to read in Python and not very suited to version control with git, those tables are converted to csv files of a certain format. A short summary of this format is given here, to help reading the code. The table contains data in 3-dimensional (wave, n_theta, order) space, flattened into a 2d table.
Row 1 + 2: Column labels. Not used here.
Column A: wavelength in nm.
Column B: blaze angle in deg.
Rest: data
For each wavelength there are multiple blaze angles listed, so Column A contains many duplicates and looks like this: [1,1,1,1,1,1,2,2,2,2,2,2,3,3,3, …]. Column B repeats like this: [1,2,3,4,5,6,1,2,3,4,5,6,1,2,3, …].
Because the wave, theta grid is regular, this class can use the
scipy.interpolate.RectBivariateSpline
for interpolation in each 2-d slice (order
is an integer and not interpolated).- Parameters:
- tab
astropy.table.Table
Table as read in. Useful to access units or other meta data.
- kint
Degree of spline. See
scipy.interpolate.RectBivariateSpline
.
- tab
Methods Summary
__call__
(energies, pol, blaze)Call self as a function.
probabilities
(energies, pol, blaze)Obtain the probabilities for photons to go into a particular order.
Methods Documentation
- __call__(energies, pol, blaze)[source] [edit on github]¶
Call self as a function.
- probabilities(energies, pol, blaze)[source] [edit on github]¶
Obtain the probabilities for photons to go into a particular order.
This has the same parameters as the
__call__
method, but it returns the raw probabilities, while__call__
will draw from these probabilities and assign an order and a total survival probability to each photon.- Parameters:
- energiesnp.array
Energy for each photons
- polnp.array
Polarization for each photon (not used in this class)
- blazenp.array
Blaze angle for each photon
- Returns:
- ordersnp.array
Array of orders
- interpprobsnp.array
This array contains a probability array for each photon to reach a particular order