FlatBase¶
- class sofia_redux.spectroscopy.flats.FlatBase(filename)[source]¶
Bases:
object
Attributes Summary
Methods Summary
adjust_guess_position
(image, order[, ybuffer])Updates guess positions and xranges via image correlation
create_order_mask
(shape, orders, edgecoeffs, ...)Create an ordermask
Sets default guess positions for each order
generate_order_mask
([offset])Generate an order mask based on xranges and edge coefficients
Attributes Documentation
- filename¶
Methods Documentation
- adjust_guess_position(image, order, ybuffer=3)[source]¶
Updates guess positions and xranges via image correlation
The correlation occurs only in the spatial dimension (y).
- Parameters:
- imagearray_like of float
(nrow, ncol) Image with which to perform the correlation.
- orderint
The order from the ordermask with which to perform the correlation.
- ybufferint, optional
The number of pixels to buffer form the top and bottom of the array.
- static create_order_mask(shape, orders, edgecoeffs, xranges)[source]¶
Create an ordermask
- Parameters:
- shape2-tuple
(nrow, ncol) shape of the ordermask
- ordersarray_like of int
(norders,) array of orders
- edgecoeffsarray_like of float
(norders, 2)
- xrangesarray_like of int
(norders, 2)
- Returns:
- ordermasknumpy.ndarray
(nrow, ncol) of int
- default_guess_position()[source]¶
Sets default guess positions for each order
Notes
xranges is also reset to default values
- generate_order_mask(offset=0)[source]¶
Generate an order mask based on xranges and edge coefficients
- Parameters:
- offsetint, optional
If provided, will be added to the x coordinate before generating the edge coefficient polynomials. This is intended to allow reusing edge coordinates for a shifted array in the x-direction.
Notes
No rotation is applied if we’re generating the order mask. The parameters required for order mask generation are already correct.