iso_atmgrid_splinefm

breads.fm.iso_atmgrid_splinefm(nonlin_paras, cubeobj, atm_grid=None, atm_grid_wvs=None, transmission=None, boxw=1, psfw=1.2, nodes=20, badpixfraction=0.75, loc=None, fix_parameters=None)[source]

For characterization of isolated objects, so no speckle. Generate forward model fitting the continuum with a spline. No high pass filter or continuum normalization here. Fitting for a grid of atmospheric models. The spline are defined with a linear model. Each spaxel (if applicable) is independently modeled which means the number of linear parameters increases as N_nodes*boxw^2+1.

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. nodes: If int, number of nodes equally distributed. If list, custom locations of nodes [x1,x2,..].

To model discontinous functions, use a list of list [[x1,…],[xn,…]].

badpixfraction: Max fraction of bad pixels in data. 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,Np) with bad pixels removed (no nans). Nd is the size of the data

vector and Np = N_nodes*boxw^2+1 is the number of linear parameters.

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