iso_splinefm

breads.fm.iso_splinefm(nonlin_paras, cubeobj, planet_f=None, transmission=None, boxw=1, psfw=1.2, nodes=20, badpixfraction=0.75, loc=None, fix_parameters=None, fit_background=False)[source]

For isolated objects. Generate forward model fitting the continuum with a spline. No high pass filter or continuum normalization here. 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 the radial velocity and the position (if loc is not

defined) of the planet in the FOV. [rv,y,x] for 3d cubes (e.g. OSIRIS) [rv,y] for 2d (e.g. KPIC, y being fiber) [rv] for 1d spectra

cubeobj: Data object.

Must inherit breads.instruments.instrument.Instrument.

planet_f: Planet atmospheric model spectrum as an interp1d object. Wavelength in microns. 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.