iso_atmgrid_hpffm

breads.fm.iso_atmgrid_hpffm(nonlin_paras, cubeobj, atm_grid=None, atm_grid_wvs=None, transmission=None, boxw=1, psfw=1.2, badpixfraction=0.75, hpf_mode=None, res_hpf=50, cutoff=5, fft_bounds=None, loc=None, fix_parameters=None)[source]

For high-contrast companions (planet + speckles). Generate forward model removing the continuum with a fourier based high pass filter.

Args:
nonlin_paras: Non-linear parameters of the model, which are first the parameters defining the atmopsheric grid

(atm_grid). The following parameters are the spin (vsini), the radial velocity, and the position (if loc is not defined) of the planet in the FOV.

[atm paras ….,vsini,rv,y,x] for 3d cubes (e.g. OSIRIS) [atm paras ….,vsini,rv,y] for 2d (e.g. KPIC, y being fiber) [atm paras ….,vsini,rv] for 1d spectra

cubeobj: Data object.

Must inherit breads.instruments.instrument.Instrument.

atm_grid: Planet atmospheric model grid as a scipy.interpolate.RegularGridInterpolator object. Make sure the

wavelength coverage of the grid is just right and not too big as it will slow down the spin broadening.

atm_grid_wvs: Wavelength sampling on which atm_grid is defined. Wavelength needs to be uniformly sampled. transmission: Transmission spectrum (tellurics and instrumental).

np.ndarray of size the number of wavelength bins.

boxw: size of the stamp to be extracted and modeled around the (x,y) location of the planet.

Must be odd. Default is 1.

psfw: Width (sigma) of the 2d gaussian used to model the planet PSF. This won’t matter if boxw=1 however. badpixfraction: Max fraction of bad pixels in data. hpf_mode: choose type of high-pass filter to be used.

“gauss”: the data is broaden to the resolution specified by “res_hpf”, which is then subtracted. “fft”: a fft based high-pass filter is used using a cutoff frequency specified by “cutoff”.

This should not be used for (highly) non-uniform wavelength sampling or with gaps.

res_hpf: float, if hpf_mode=”gauss”, resolution of the continuum to be subtracted. cutoff: int, if hpf_mode=”fft”, the higher the cutoff the more agressive the high pass filter.

See breads.utils.LPFvsHPF().

fft_bounds: [l1,l2,..ln] if hpf_mode is “fft”, divide the spectrum into n chunks [l1,l2],..[..,ln] on which the

fft high-pass filter is run separately.

loc: Deprecated, Use fix_parameters.

(x,y) position of the planet for spectral cubes, or fiber position (y position) for 2d data. When loc is not None, the x,y non-linear parameters should not be given.

fix_parameters: List. Use to fix the value of some non-linear parameters. The values equal to None are being

fitted for, other elements will be fixed to the value specified.

Returns:

d: Data as a 1d vector with bad pixels removed (no nans) M: Linear model as a matrix of shape (Nd,1) with bad pixels removed (no nans). Nd is the size of the data

vector.

s: Noise vector (standard deviation) as a 1d vector matching d.