Reference/API¶
threadcount.procedures¶
Open a fits data cube and de-redshift it, as well as any continuum cube. |
|
This funtion put everything together. |
threadcount.models Module¶
Custom Models that should function just like lmfit’s models.
Functions¶
|
Return constraint expression for line flux. |
|
Return a 1-dimensional Gaussian function. |
|
Estimate starting values from 1D peak data and return (height,center,sigma). |
|
Add the 2 arguments and return the log10 of result. |
|
Compute the mean of the outer points of y. |
|
Classes¶
|
Constant + 1 Gaussian Model. |
|
Constant + 2 Gaussians Model. |
|
Constant + 3 Gaussians Model. |
|
A model heavily based on lmfit's |
|
Log10 of double exponential decay Model. |
|
Quadratic + 1 Gaussian Model. |
|
Quadratic + 2 Gaussians Model. |
|
Quadratic + 3 Gaussians Model. |
Variables¶
int([x]) -> integer int(x, base=10) -> integer |
|
Convert a string or number to a floating point number, if possible. |
threadcount.lines Module¶
Library of line wavelengths.
Classes¶
|
Line object containing center and wavelength range. |
Variables¶
= 4861.333 # Hβ |
|
= 4101.742 # Hδ |
|
= 4340.471 # Hγ |
|
Line instance, Hb4861 +/- 15 |
|
Line instance, Hdelta +/- 15 |
|
Line instance, Hgamma +/- 15 |
|
Line instance, NeIII +/- 15 |
|
Line instance, (OII3726 + OII3729)/2 +/- 16 |
|
Line instance, OIII4363 +/- 15 |
|
Line instance, OIII4959 +/- 15 |
|
Line instance, OIII5007 +/- 15 |
|
= 3868.760 # [Ne III] 3869 |
|
= 3726.032 # [O II] 3727 doublet, line 1 |
|
= 3728.815 # [O II] 3727 doublet, line 2 |
|
= 4363.210 # [O III] 4363 |
|
= 4958.911 # [O III] 4959 |
|
= 5006.843 # [O III] 5007 |
threadcount.fit Module¶
main threadcount module.
Functions¶
|
Broadcast |
|
Determine best modelresult in a list, chosen by computing \({\Delta}aic\). |
|
Collect the information from one model_result. |
|
De-redshift the WaveCoord in-place. |
|
Extract ModelResult attributes into numpy array. |
|
Compute the average and standard deviation of the information requested. |
|
|
|
Create Image of signal to noise ratio in a given bandwidth. |
|
Determine the wavelength indices containing signal. |
|
Return the aic_real of a successful fit. |
Determine component comparison to this highest flux gaussian. |
|
|
Collect list of column names, suitable for a header row. |
|
Determine the index of 'array' which is closest to value. |
|
Retrieve the names of parameters from model results. |
|
Determine the number of gaussians in a |
|
Retrieve parameter value by name from lmfit objects. |
|
Create kernel image from list of pixels. |
|
Select pixels in ellipse of radius rx, ry from (0,0). |
|
Create plot and interact with user to determine the lower threshold for valid data. |
|
Choose best model from a display of all model fits to a pixel. |
|
Create an iterator over the spaxels of successive image pixels in a 2d numpy array. |
|
Determine which fits should be inspected by hand. |
|
Load a fits file using |
|
Create a multipanel figure comparing fits to the same data. |
|
|
|
Combine the default settings with any user settings. |
|
Combine the default settings with any user settings. |
|
|
|
Compile fit choice and parameter summary, and save to file. |
|
Compile fit parameter summary and save to file. |
|
Save plots of each spaxel fit as separate page in 1 pdf file. |
|
Convience wrapper of csv.writer. |
|
Apply kernel image smoothing on every spatial image in a cube. |
|
Interactively choose a new redshift. |
Classes¶
|
Subclass of list which distributes attribute and function calls recursively. |
|
Container for ordered dict of numpy ndarrays with save/load functionality. |
Variables¶
Define typical ModelResult information we might want. |
|
A header["BUNIT"] value we have. |
|
Default formatting for floats in output files. |
|
Vectorized |
|
Retrieve parameter value by name from lmfit objects. |
threadcount.mpdaf_ext Module¶
Functions to extend Spectrum, Image, and Cube from package mpdaf.
Functions¶
|
Return the cross-correlation of the image with an array. |
|
Fit model to |
threadcount.lmfit_ext Module¶
Functions to extend classes Model, ModelResult, Parameters from package lmfit.
Functions¶
|
Chisqr + 2 * nvarys. |
|
Chisqr + np.log(ndata) * nvarys. |
|
|
|
ModelResult extension to change the data related to sigma and refit. |
|
|
|
Plot the fit results and residuals using matplotlib. |
|
|
|
Set param hints for all model params names ending in name. |
|
Return an ordered dictionary of parameter stderrs. |
|
|
|
Return a dictionary of parameter [value, stderr]. |