# Utilities¶

Coordinates Summary

 dist_image(image[, pixscale, center, …]) Pixel distances xy_to_rtheta(x, y) Convert (x,y) to (r,theta) rtheta_to_xy(r, theta) Convert (r,theta) to (x,y) xy_rot(x, y, ang) Rotate (x,y) positions to new coords det_to_V2V3(image, detid) Same as det_to_sci V2V3_to_det(image, detid) Same as sci_to_det plotAxes(ax[, position, label1, label2, …]) Compass arrows

Image Manipulation Summary

 hist_indices(values[, bins, return_more]) Histogram indices binned_statistic(x, values[, func, bins]) Binned statistic frebin(image[, dimensions, scale, total]) Fractional rebin fshift(image[, delx, dely, pad, cval]) Fractional image shift fourier_imshift(image, xshift, yshift[, …]) Fourier shift image shift_subtract(params, reference, target[, …]) Shift and subtract image align_LSQ(reference, target[, mask, pad, …]) Find best shift value scale_ref_image(im1, im2[, mask, …]) Reference image scaling optimal_difference(im_sci, im_ref, scale[, …]) Optimize subtraction of ref PSF pad_or_cut_to_size(array, new_shape[, fill_val]) Resize an array to a new shape by either padding with zeros or trimming off rows and/or columns. fix_nans_with_med(im[, niter_max, verbose]) Iteratively fix NaNs with surrounding Real data

Polynomial Fitting Summary

 jl_poly_fit(x, yvals[, deg, QR, robust_fit, …]) Fast polynomial fitting jl_poly(xvals, coeff[, dim_reorder]) Evaluate polynomial

Robust Summary

 biweightMean(inputData[, axis, dtype, iterMax]) Biweight Mean checkfit(inputData, inputFit, epsilon, delta) Determine the quality of a fit and biweights. linefit(inputX, inputY[, iterMax, Bisector, …]) Outlier resistance two-variable linear regression function. mean(inputData[, Cut, axis, dtype, …]) Robust Mean medabsdev(data[, axis, keepdims, nan]) Median Absolute Deviation mode(inputData[, axis, dtype]) Robust estimator of the mode of a data set using the half-sample mode. polyfit(inputX, inputY, order[, iterMax]) Outlier resistance two-variable polynomial function fitter. std(inputData[, Zero, axis, dtype, …]) Robust Sigma

NIRCam Tools Summary

 read_filter(filter[, pupil, mask, module, …]) Read filter bandpass. psf_coeff(filter_or_bp[, pupil, mask, …]) Generate PSF coefficients gen_image_coeff(filter_or_bp[, pupil, mask, …]) Generate PSF from coefficient bg_sensitivity(filter_or_bp[, pupil, mask, …]) Sensitivity Estimates sat_limit_webbpsf(filter_or_bp[, pupil, …]) Saturation limits pix_noise([ngroup, nf, nd2, tf, rn, ktc, …]) Noise per pixel Select wavelength channel grism_res([pupil, module, m]) Grism information

Spectral Tools Summary

 stellar_spectrum(sptype, *renorm_args, **kwargs) Stellar spectrum BOSZ_spectrum(Teff, metallicity, log_g[, …]) BOSZ stellar atmospheres (Bohlin et al 2017). planets_sb12([atmo, mass, age, entropy, …]) Exoplanet spectrum from Spiegel & Burrows (2012) sp_accr(mmdot[, rin, dist, truncated, …]) Exoplanet accretion flux values (Zhu et al., 2015). zodi_spec([zfact, ra, dec, thisday]) Zodiacal light spectrum. zodi_euclid(locstr, year, day[, …]) IPAC Euclid Background Model bp_2mass(filter) 2MASS Bandpass bin_spectrum(sp, wave[, waveunits]) Rebin spectrum

Speckle Noise Summary

 OPD_extract(opd, header[, seg_terms, verbose]) Decompose OPD to Zernike/Hexike coefficients opd_extract_mp(opds, header[, nproc]) Generate multiple OPD_extract objects OPD image for science observation opd_sci_gen_mp(opds_all[, nproc]) Multiple OPD images for science observations opd_ref_gen(args[, verbose]) Generate a drifted OPD image ODP_drift_all(wfe_drift, opds_all, …) Drift list of OPDs get_psf(opd, header[, filter, mask, pupil, …]) Generate PSF gen_psf_ref_all(opd_ref_list_all, …[, verbose]) Calculate a series of reference PSFs get_contrast(speckle_noise_image, planet_psf) Output single contrast curve residual_speckle_image(psf_star_all, psf_ref_all) Create residual speckle images speckle_noise_image(psf_star_all, psf_ref_all) Create a speckle noise image map read_opd_file(opd_file[, opd_path, header]) Read in the OPD file data and header (optional) read_opd_slice(pupilopd[, opd_path, header]) Get only a specified OPD slice from file.