distcorr_model

sofia_redux.instruments.forcast.distcorr_model.distcorr_model(pinhole=None, viewpin=False, basehead=None, order=None)[source]

Generate model array of pin holes base on input file

Read the positions of the pinholes and average the distance between positions; creates a model where the pinholes are regularly spaced. The model is then shifted and rotated in order to match the observed pinhole mask.

Parameters:
pinholestr or pandas.dataframe

File path to a text file containing a list of the positions of the pinholes or dataframe object. Columns are xid, yid, xpos, ypos.

viewpinbool or str, optional

If set to True, will display the pin model. If a string is provided, it will be interpreted as a filename, and the model will be written to the file instead of shown.

baseheadastropy.io.fits.header.Header, optional

Header array to update with pin model array (PIN_MOD=[dx,dy,angle,order]).

orderint, optional

Order of distortion model. If not provided, the default value of 4 will be used.

Returns:
dict
model -> numpy.ndarray

N(x, y) model reference positions of shape (N, 2)

pins -> numpy.ndarray

N(x, y) pin positions of shape (N, 2)

nx, ny -> int

define number of pixels for both pins and image in x and y

dx, dy -> float

model x, y spacing

angle -> float

clockwise rotation of the model about the center in degrees.

order -> int

order to be used if using the “polynomial” method in sofia_redux.instruments.forcast.undistort based upon this model.

Notes

A value of None for pinhole or order will cause default values specified in the drip configuration file to be used.