PRF API Documentation

Pixel Response Function class
PRF class for making Pixel Response Functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flux
|
Array of the flux of the PRF as a function of position. Usually normalized such that the total flux is 1. |
required | |
pixel_size
|
True detector pixel size in dimensions of length/pixel |
required | |
sub_pixel_size
|
PSF file pixel size in dimensions of length/pixel |
required | |
scale
|
How much to scale the PRF by. Scale of 2 makes the PSF 2x broader. Default is 1. |
1
|
|
imshape
|
Tuple of the shape of the true image. If using ROIs, use the shape of the image that each ROI is cut out from. Use format (row, column). |
(2048, 2048)
|
|
imcorner
|
Tuple of the lower left corner of the image, i.e. it's origin. Use this to move the image around on the grid. If using a window mode, make sure to set this to the right corner. Use format (row, column). |
(0, 0)
|
evaluate(location=None, normalize=True, gradients=False)
Evaluate the PRF model for a target at a given location on the detector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
Location of the source on the detector. Use format (row, column). If not set will default to |
None
|
|
normalize
|
Whether to normalize the input data so that the total flux is 1. |
True
|
|
gradients
|
Whether to return gradients. If True, will return an additional 2 arrays that contain the gradients in each axis. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
row_im |
ndarray
|
1D Array of integer row values at which the PRF is evaluated. |
column_im |
ndarray
|
1D Array of integer column values at which the PRF is evaluated. |
prf_im |
ndarray
|
2D Array of PRF values. |
dprf_im |
ndarray
|
2, 2D arrays of the gradient of the PRF values. Only returned if |
from_file(file)
classmethod
Load a PRF object from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
Input file to use. Choose either a string path to the file or an |
required |
from_reference(name='visda')
classmethod
Load a PRF from pandoraref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of detector, choose from VISDA or NIRDA. |
'visda'
|
plot(**kwargs)
Plots the PRF. Use this functon to visually inspect the PRF.
to_sparse3d(location=None, normalize=True, gradients=False)
Converts this PRF object to a Sparse3D object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
Location of the source on the detector. Use format (row, column). If not set will default to |
None
|
|
normalize
|
Whether to normalize the input data so that the total flux is 1. |
True
|
|
gradients
|
Whether to return gradients. If True, will return an additional 2 arrays that contain the gradients in each axis. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
X |
Sparse3D
|
Sparse3D object containing the PRF at a given location. |
dX0 |
Sparse3D
|
Sparse3D object containing the gradient of the PRF in axis 0 at a given location. Only returned if |
dX1 |
Sparse3D
|
Sparse3D object containing the gradient of the PRF in axis 1 at a given location. Only returned if |