Quick tool for spectrally rebinning a FITS file, convolves a triangular
function of bin_width
with the input data and samples it every bin_step
.
NOTE: Supersampling is not done in any special way, so if that is desired,
set bin_width
to the distance between two datapoints and bin_step
to the
supersampling length. This will not preserve the sum, but it should work when
interpolation is required.
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Function | array |
Return the values on an arry such that any indices that are "to the left" return the first entry in the axis, and any that are "to the right" return the last entry in the axis. |
Function | exec |
Undocumented |
Function | go |
Thin wrapper around run() to accept string inputs. As long as the names of the arguments to this function are the same as the names expected from the command line we can do this programatically |
Function | indices |
Give a tuple with N entries indices like ((i_00,i_01,i_02,...,i_0M_0),(i_10,i_11,...,i_1M_1),...,(...,i_NM_N)), where N is the number of entries in shape which is like (s_0, s_1, ..., s_N), and M_0, M_1,... |
Function | lin |
Given data defined at old_points along axis , linearly interpolate at new_points subject to boundary_conditions . Works on N-dimensional arrays, but only over one axis at a time. |
Function | overlap |
Performs convolution over axis of data by the overlap-and-add method with response_1d . Is generally faster for large data and small response_1d . The shape of the output array depends on the mode : |
Function | parse |
Undocumented |
Function | plot |
Undocumented |
Function | rebin |
Undocumented |
Function | run |
Undocumented |
Constant | DEBUG |
Undocumented |
Variable | named |
Undocumented |
Variable | _lgr |
Undocumented |
Return the values on an arry such that any indices that are "to the left" return the first entry in the axis, and any that are "to the right" return the last entry in the axis.
Thin wrapper around run()
to accept string inputs.
As long as the names of the arguments to this function
are the same as the names expected from the command line
we can do this programatically
Give a tuple with N entries indices
like ((i_00,i_01,i_02,...,i_0M_0),(i_10,i_11,...,i_1M_1),...,(...,i_NM_N)), where N is the number of entries in shape
which is like (s_0, s_1, ..., s_N), and M_0, M_1, ..., M_N are the number of indices present for each axis.
Alter the indices so if i_nm < 0, i_nm=0. And if i_nm >= s_n, i_nm=s_n-1. I.e., indices "to the left" are set to the first entry in the axis, and indices "to the right" are set to the last entry in the axis.
np.ndarray[ [ N]]
, old_points: np.ndarray[ [ M]]
, data: np.ndarray[ [ ..., M, ...]]
, axis: int
, boundary_conditions: Literal[ 'constant'] | Literal[ 'reflect'] | Literal[ 'periodic'] | Literal[ 'extrapolate']
= 'constant') -> np.ndarray
:
¶
Given data
defined at old_points
along axis
, linearly interpolate at new_points
subject to boundary_conditions
.
Works on N-dimensional arrays, but only over one axis at a time.
np.ndarray[ [ ..., M, ...]]
, response_1d: np.ndarray[ [ N]]
, axis: int
, mode: Literal[ 'same'] | Literal[ 'full'] | Literal[ 'valid']
= 'same') -> np.ndarray[ [ ..., L, ...]]
:
¶
Performs convolution over axis
of data
by the overlap-and-add method with response_1d
. Is generally faster for large data
and small response_1d
.
The shape of the output array depends on the mode
:
mode | output shape --------|----------------- 'same' | [...,'M',...] 'full' | [...,'M+2N',...] 'valid' | [...,'M-2N',...]
ResponseFunction
, bin_start: float | None
= None, bin_step: float
= 1e-09, axis_unit_conversion_factors: tuple[ float, ...]
= (bool
= True) -> tuple[ np.ndarray, np.ndarray]
:
¶
Undocumented
aph.fits.specifier.FitsSpecifier
, output_path: Path | str
, bin_step: float
= 1e-09, bin_width: float
= 2e-09, operation: Literal[ 'sum'] | Literal[ 'mean'] | Literal[ 'mean_err']
= 'mean', spectral_unit_in_meters: float
= 1, response_function_class: Literal[ SquareResponseFunction] | Literal[ TriangularResponseFunction]
= TriangularResponseFunction, output_unit: u.Unit | None
= None, plot: bool
= False) -> tuple[ np.ndarray, np.ndarray]
:
¶
Undocumented