API

This is the API documentation for PIPE.

pipe Package

Functions

aperture(shape[, radius, xc, yc])

Returns a boolean 2D-array of the same dimensions as frame with True inside radius from (xc, yc), and False outside.

attitude(filename)

Reads the CHEOPS attitude file and puts the data into a N-by-4 array with spacecraft mjd, ra, dev, and roll angle.

cent_flux(cube)

Compute center of pixel values for cube of rectangular frames.

check_low(val[, clip, niter])

Filters values lower more than clip from the average (iterates niter times).

check_mask(mask_cube, apt[, clip, niter])

Checks the number of masked pixels for each mask of an array, and de-selects those frames that deviate more than clip sigma from the average.

check_motion(xc[, lowfrac])

Selects frames with positions after and before that are fairly consistent, with the goal to select frames with little motion blur.

check_pos(xc, yc[, clip, niter])

Filters positions deviating more than clip from the median (iterates niter times).

check_val(val[, clip, niter])

Filters values in array deviating more than clip from the average (iterates niter times).

clean_cube2D(data_cube, mask, apt)

Cleans all bad pixels as defined by mask (2D or 3D) inside aperture apt, by averaging neighbouring pixels in spatial dimensions (not time).

cube_apt(shape, radius, xc, yc)

Returns a cube with apertures for each plane along 0-axis defined by 1D-arrays xc and yc and constant radius.

datacube(filename[, frame_range])

Read CHEOPS datacube format, either subarray or imagettes.

derotate_position(xroll, yroll, rolldegs)

Function that de-rotates coordinates according to roll angle (in degrees)

flatfield(filename, Teff, offset, size)

Reads the flatfield cube and interpolates the flatfield temperatures to the given temperature.

gain(file_hk, file_gain)

Compute gain using HK parameters and the gain reference table Returns gain in units of e/ADU

imagette_offset(filename[, frame_range])

Returns the first imagette offset from an imagette fits-file cube; first offset is relative to full array, second offset is relative to subarray

integrate_psf(psf_fun[, radius])

Computes the flux of the psf inside radius.

interp_cube(t, t0, datacube0)

Resample planes from datacube, no extrapolation

interp_cube_ext(t, t0, datacube0)

Resample planes from datacube, with extrapolation

mad(series)

Compute normalised mean absolute deviation (MAD) for an array, return in ppm

make_maskcube(data_cube, noise_cube, model_cube)

Find pixels that deviate too much from fitted models, and produce a cube of masks.

mjd2bjd(filename)

multi_cent_binary_psf(psf_spline, cube, ...)

Use a PSF to find the best matching centres in a cube.

multi_cent_binary_psf_fix(psf_spline, cube, ...)

Use a PSF to find the best matching centres in a cube, using initial guessed positions and a fixed separation (dx, dy).

multi_cent_psf(psf_spline, cube, noise_cube, ...)

Use a PSF to find the best matching centres in a cube.

multi_psf_fit(psf_list, data_cube, ...[, ...])

Fit a defined PSF to a frame by constructing a matrix of offsets.

multi_psf_fit_binary(psf_list0, psf_list1, ...)

Fit two PSFs independently to both components of a binary, in a similar way as the regular multi_psf.fit function described above.

noise(debias, ron_elec[, e_per_ADU])

Computes the photon + read-out noise of a bias subtracted frame (or cube).

nonlinear(filename)

Reads the non-linear correction from a text file with ADU vs multiplicative correction.

pix_mat(datacube, noisecube, xc, yc, mask[, ...])

Turn a data cube into a pixel matrix with columns y-coordinate, x-coordinate, pixel value, pixel value noise the mask can either be a 2D plane or 3D cube (True = select, False mask out).

psf_noise(source_model, ron_elec[, e_per_ADU])

Uses a source model (PSF*scale+background) of the source to compute the photon + read-out noise.

psf_phot_cube(data_cube, noise_cube, ...)

Use defined PSF to integrate flux and derive error.

read_dark(darkpath, mjd, offset, size)

Traverses darkpath directory, looking for all dark current files and picks the one closest in time

read_mask(filename)

Reads a predefined mask saved as a fits file, returns numpy array

read_ron(filename)

Reads the readout noise table entry from the CHEOPS calibratared subarray cube file.

resample_attitude(obs_mjd, exp_time, attitude)

Resamples table of attitude data (RA, DEC, ROLL, DROLL) to the midtimes of the observations of duration exp_time Note: exptime in seconds, mjd in days, DROLL is change in roll angle during exposure

resample_imagette_time(sa_time, nexp)

Equidistantly distributes nexp exposures over the sa_time data points.

rotate_position(x, y, rolldeg)

Function that rotates coordinates according to roll angle (in degrees)

rough_contrast(cube[, radius, mask])

Computes a rouch contrast (flux difference) between pixels inside aperture and outside aperture, for each frame.

save_binary_eigen_fits(filename, t, bjd, ...)

Save lightcurve data from both componentes of a binary, as defined by arguments to fits table in binary format.

save_eigen_fits(filename, t, bjd, sc, err, ...)

Save lightcurve data as defined by arguments to fits table in binary format.

sigma_clip(data[, clip, niter])

A simple 1D sigma-clipping routine that returns a boolean array of indices to non-clipped data

starcat(filename, colstr[, entry])

Reads star catalogue file and returns value for column string colstr and entry row

sub_image_indices(offset, size)

Helper function that computes index ranges given a 2D offset and a 2D size

thermFront_2(filename)

Reads frontTemp_2 sensor data from the CHEOPS raw file.

Classes

PipeControl(pipe_params)

PipeLog([logfile, verbosity])

Keeps track of tima and messages to the logfile

PipeParam(name, visit[, version, outdir, ...])

PipeParam keeps all parameters relevant for the extraction, with default values given for most.

star_bg(starcatfile[, maxrad, shape])

Reads catalogue data on background stars and produces images of stars, to be removed from observations.

Class Inheritance Diagram

Inheritance diagram of pipe.pipe_control.PipeControl, pipe.pipe_log.PipeLog, pipe.pipe_param.PipeParam, pipe.syntstar.star_bg