sofia_redux.instruments.forcast: FORCAST Data Reduction Algorithms

The sofia_redux.instruments.forcast package contains data reduction algorithms for the FORCAST instrument. It is designed to be used with the sofia_redux package, so it does not provide its own interfaces or workflows. See the sofia_redux.pipeline documentation for more information on the pipeline interfaces, or the API documentation below for more information on FORCAST algorithms.

Reference/API

sofia_redux.instruments.forcast.background Module

Functions

background(data, section[, header, stat, mask])

Calculate the background of the image

mode(data)

Return the most common data point from discrete or nominal data

sofia_redux.instruments.forcast.calcvar Module

Functions

calcvar(data, header)

Calculate read and poisson noise of the variance from raw FORCAST images

sofia_redux.instruments.forcast.check_readout_shift Module

Functions

check_readout_shift(data, header)

Check data for 16 pixel shift

sofia_redux.instruments.forcast.chopnod_properties Module

Functions

chopnod_properties(header[, update_header])

Returns the chop nod properties in the detector reference frame

sofia_redux.instruments.forcast.clean Module

Functions

clean(data[, badmap, header, variance, ...])

Replaces bad pixels in an image with approximate values

sofia_redux.instruments.forcast.configuration Module

DRIP configuration

Functions

load([config_file, quiet])

Load the DRIP configuration file

sofia_redux.instruments.forcast.distcorr_model Module

Functions

pinhole_defaults()

read_pinhole_file(pinhole_file)

Read the pinhole file and return a dataframe

pinhole_model(xpos, ypos, xid, yid)

Generate the pinhole model from paramters.

view_model(x, y[, fwhm, amplitude, ...])

View the pinhole model and optionally write to FITS file.

distcorr_model([pinhole, viewpin, basehead, ...])

Generate model array of pin holes base on input file

sofia_redux.instruments.forcast.droop Module

Functions

droop(data[, header, frac, variance])

Corrects droop electronic signal

sofia_redux.instruments.forcast.getatran Module

Functions

clear_atran_cache()

Clear all data from the atran cache.

get_atran_from_cache(atranfile, resolution)

Retrieves atmospheric transmission data from the atran cache.

store_atran_in_cache(atranfile, resolution, ...)

Store atran data in the atran cache.

get_atran(header, resolution[, filename, ...])

Retrieve reference atmospheric transmission data.

sofia_redux.instruments.forcast.getcalpath Module

Functions

getcalpath(header[, pathcal])

Return the path of the ancillary files used for the pipeline.

sofia_redux.instruments.forcast.getdetchan Module

Functions

getdetchan(header)

Retrieve DETCHAN keyword value from header as either SW or LW

sofia_redux.instruments.forcast.getmodel Module

Functions

clear_model_cache()

Clear all data from the model cache.

get_model_from_cache(modelfile, resolution)

Retrieves model data from the model cache.

store_model_in_cache(modelfile, resolution, ...)

Store model data in the model cache.

get_model(header, resolution[, filename, ...])

Retrieve reference standard model data.

sofia_redux.instruments.forcast.getpar Module

Functions

getpar(header, parname[, writename, dtype, ...])

Get a header or configuration parameter

sofia_redux.instruments.forcast.hdcheck Module

Functions

validate_condition(header, condition[, dripconf])

Return if a keyword header value meets a condition

validate_compound_condition(header, conditions)

Checks the AND/OR conditions of keyword definitions is met by header

validate_keyrow(header, keyrow[, dripconf])

Check if a header of a FITS file matches a keyword requirement

validate_header(header, keywords[, dripconf])

Validate all keywords in a header against the keywords table

validate_file(filename, keywords[, dripconf])

Validate filename header against keywords table

hdcheck(filelist[, dohdcheck, dripconf, kwfile])

Checks file headers against validity criteria

sofia_redux.instruments.forcast.hdmerge Module

Functions

hdmerge(headers[, reference_header])

Merge input headers.

sofia_redux.instruments.forcast.hdrequirements Module

Functions

parse_condition(condition)

Parse a condition value defined in the keyword table

hdrequirements([kwfile])

Returns a dataframe containing the header requirements

sofia_redux.instruments.forcast.imgnonlin Module

Functions

get_siglev(header)

Return the signal level from the header

get_camera_and_capacitance(header)

Read header and determine camera

get_reference_scale(header, camcap[, update])

Get non-linearity scale from the header based on camera and capacitance

get_coefficients(header, camcap[, update])

Get non-linearity coefficients from the header based on camera and capacitance

get_coeff_limits(header, camcap[, update])

Get non-linearity coefficient limits from the header based on camera and capacitance

imgnonlin(data, header[, siglev, variance])

Corrects for non-linearity in detector response due to general background.

sofia_redux.instruments.forcast.imgshift_header Module

Functions

imgshift_header(header[, chop, nod, dither, ...])

Calculates the shift_image in the pixel frame for merging an image

sofia_redux.instruments.forcast.jbclean Module

Functions

jbfft(data[, bar_spacing])

Remove jailbars with FFT

jbmedian(data[, width, bar_spacing, mode])

Remove jailbars using the median of correlated columns

jbclean(data[, header, variance, ...])

Removes "jailbar" artifacts from images

sofia_redux.instruments.forcast.merge Module

Functions

merge(data, header[, variance, normmap, ...])

Merge positive and negative instances of the source in the images

sofia_redux.instruments.forcast.merge_centroid Module

Functions

merge_centroid(data, header[, variance, ...])

Merge an image using a centroid algorithm

sofia_redux.instruments.forcast.merge_correlation Module

Functions

merge_correlation(data, header[, variance, ...])

Merge an image using a correlation algorithm

sofia_redux.instruments.forcast.merge_shift Module

Functions

merge_shift(data, chopnod[, header, ...])

Merge an image by shifting the input data by the input values

sofia_redux.instruments.forcast.peakfind Module

Functions

peakfind(coadded[, newimage, refine, ...])

Find peaks (stars) in FORCAST images

Classes

PeakFinder(image[, reference, npeaks, fwhm, ...])

Configure and run peak finding algorithm.

sofia_redux.instruments.forcast.read_section Module

Functions

read_section(xdim, ydim)

Read the section in the configuration file and check if it's correct

sofia_redux.instruments.forcast.readfits Module

Functions

addparent(name, header[, comment])

Add an id or file name to a header as PARENTn

readfits(filename[, update_header, key, ...])

Returns the array from the input file

sofia_redux.instruments.forcast.readmode Module

Functions

readmode(header)

Read the chop/nod and instrument mode from the header

sofia_redux.instruments.forcast.register Module

Functions

coadd_centroid(data, reference[, header, ...])

Shift an image for coadding using a centroid algorithm

coadd_correlation(data, reference[, header, ...])

Shift an image for coaddition using a correlation algorithm

coadd_header(data, header[, variance, ...])

Shift an image for coaddition using header information

coadd_user(data, reference, position[, ...])

Shift an image for coaddition using header information

register(data, header[, reference, ...])

Use dither data to shift_image input image to a reference image.

sofia_redux.instruments.forcast.register_datasets Module

Functions

wcs_shift(header, refheader, xy[, wcskey])

Return the pixel offset of a point on header relative to refheader

get_shifts(datasets[, user_shifts, refset, ...])

Returns all shifts relative to the reference set.

expand_array(arr, shape[, missing])

Expands an array to a new shape

shift_set(dataset, offset[, newshape, missing])

Shifts an individual data set

shift_datasets(datasets, shifts, refset[, ...])

Shifts datasets onto common frame

resize_datasets(datasets[, missing])

Resize all datasets to the same shape

register_datasets(datasets[, user_shifts, ...])

Registers multiple sets of data to the same frame

sofia_redux.instruments.forcast.rotate Module

Functions

rotate(data, angle[, header, variance, ...])

Rotate an image by the specified amount

rotate_coordinates_about(coordinates, ...[, ...])

Rotate the coordinates about a center point by a given angle.

rotate_point(y, x, center, angle[, shift, ...])

Rotate a single (y, x) point about a given center.

rotate_image(image, angle[, center, order, ...])

Rotate an image about a point by a given angle.

rotate_image_with_mask(image, angle[, ...])

Rotate an image, using a mask for interpolation and edge corrections.

sofia_redux.instruments.forcast.shift Module

Functions

shift(data, offset[, header, variance, ...])

Shift an image by the specified amount

sofia_redux.instruments.forcast.stack Module

Functions

add_stacks(data, header[, variance])

Add data frames together at the same stack (position)

background_scale(data, header[, mask])

Return frame scale levels

stack_c2nc2(data, header[, variance, ...])

Run the stacking algorithm on C2NC2 data

stack_map(data, header[, variance, bglevel, ...])

Run the stacking algorithm on MAP (Mapping mode) data

stack_c3d(data, header[, variance, extra])

Run the stacking algorithm on C3D data (3 position chop with dither)

stack_cm(data, header[, variance, extra])

Run the stacking algorithm on CM data (multi-position chop)

stack_stare(data, header[, variance])

Run the stacking algorithm on STARE data

convert_to_electrons(data, header[, variance])

Convert data to mega-electrons per seconds

subtract_background(data[, header, mask, stat])

Remove background from data

stack(data, header[, variance, mask, extra, ...])

Subtracts chop/nod pairs to remove astronomical/telescope background

sofia_redux.instruments.forcast.undistort Module

Functions

default_pinpos()

Default values of the model and instrument points to be warped and fitted.

get_pinpos(header[, pinpos, rotate])

Get the pinhole model and coefficients and update header.

find_pixat11(transform, x0, y0[, epsilon, ...])

Calculate the position of x0, y0 after a transformation

update_wcs(header, transform[, eps])

Update the WCS in the header according to the transform

transform_image(data, xin, yin, xout, yout)

Transform an image and update header using coordinte point mapping

rebin_image(image, factor[, header, ...])

Rebin the image to square pixels

frame_image(image, shape[, header, ...])

Frame an image in the center of a new image and add border

find_source(image, header)

Find single peak in image and update SRCPOS in header

undistort(data[, header, pinhole, rotate, ...])

Corrects distortion due to camera optics.