Reference/API¶
tayph Package¶
Functions¶
|
This program calculates the radial velocity in km/s for the planet in the data sequence provided in dp, the data-path. |
|
This calculates the radial velocity in km/s for the star in the data sequence provided in dp. |
|
This retrieves the SNR tabulated in the obs_times table. |
|
This retrieves the airmass tabulated in the obs_times table. |
|
This converts air wavelengths to vaccuum wavelengths. |
|
This applies a set of telluric spectra (computed by molecfit) for each exposure in our time series that were written to a pickle file by write_telluric_transmission_to_file. |
|
This does the same as berv(dp), but uses astropy to compute the BERV for the dates of observation given a data parameter file. |
|
This retrieves the BERV corrcetion tabulated in the obs_times table. |
|
A simple function to quickly bin a spectrum by a certain number of points. |
|
A simple function to bin a high-res model spectrum (wl,fx) to a lower resolution wavelength grid (wlm), by averaging the points fx inside the lower-resolution wavelength bins set by wlm. |
|
This function takes a spectrum and blurs it using a rotation x Gaussian kernel which has a FWHM width of dv km/s everywhere. |
|
This function computes a box with width w, amplitude A and center c on grid x. |
|
This is a copy of the astropyberv above, but as a function for a single date in mjd. |
|
This is a helper function that checks for the presence of a config file and an obs_times file at path dp. |
|
This allows the user to visually inspect the telluric correction performed by Molecfit, and select individual spectra that need to be refit. |
|
This is a short function that handles file paths when input to other functions. |
|
This quickly cleans a spectral block by performing trimming of zeroes at the edges, setting zeroes and negative values to NaN, normalising the flux along both axes, rejecting outlier values by using a running MAD, and optionally detrending using polynomials. |
|
This function will define a constant-velocity grid that is (optionally) sampled a number of times finer than the SMALLEST velocity difference that is currently in the grid. |
|
It's unbelievable, but I could not find the python equivalent of IDL's /edge_truncate keyword, which truncates the kernel at the edge of the convolution. |
|
This program calculates the change in radial velocity in km/s for the planet in the data sequence provided in dp, the data-path. |
|
This computes the simple numerical derivative of x by convolving with kernel [-1,0,1]. |
|
This function tests the dimensions and shape of the input array var. |
|
Short-hand for ending a timing measurement and printing the elapsed time. |
|
This routine measures the top or bottom envelope of a spectrum (wl,fx), by chopping it up into bins of size binsze (unit of wl), and measuring the mean of the top n-% of values in that bin. |
|
This evaluates a polynomial using fitting coefficients f that were found via np.polyfit(x,y). |
|
This actually calls the molecfit command in bash |
|
This is basically IDL's findgen function. |
|
This fits a rotation broadened profile following Gray (2005), with a polynomial for the continuum. |
|
This is a wrapper around lmfit to fit a Gaussian plus a polynomial continuum using the LM least-squares minimization algorithm. |
|
|
This is the central place where the location of the molecfit configuration file is defined. |
|
|
Download a PHOENIX model atmosphere spectrum for a star with given properties. |
|
Download a PHOENIX model atmosphere's wavelength grid |
|
|
|
This is a wrapper for LAD regression with sklego, implemented in a way such that it returns the linear coefficients a,b from y=ax+b. |
|
This function tests the length of the input list. |
|
This is the rigid-body, circular-orbt approximation of the local velocity occulted by the planet as it goes through transit, as per Cegla et al. 2016. |
|
|
|
This returns the indices of the maximum of a 2D array, similar to np.argmax for 1D arrays. |
|
This returns the indices of the minimum of a 2D array, similar to np.argmin for 1D arrays. |
|
|
|
This is the main wrapper for molecfit that pipes a list of s1d spectra and executes it. |
|
Helper function to handle indices and logical indices of NaNs. |
|
This function tests for the presence of NaNs and infinites. |
|
If deg is set to 1, this function will normalise based on the mean flux in each order. |
|
This function tests that all elements in the input variable are zero or positive. |
|
This code queries a planet system parameter from a config file located in the folder specified by the path dp; or run configuration parameters from a file speciefied by the full path dp, if full_path is set to True. |
|
Calculates the orbital phase of the planet in the data sequence provided using the parameters in dp/config and the timings in dp/obstimes. |
|
This fits a polynomial modulated by a sine-wave to a 1D array of points. |
|
This function tests that all elements in the input variable are strictly positive. |
|
This reads a binary model spectrum (those created by Daniel Kitzmann) located at path inpath. |
|
This is the workhorse for reading in a time-series of archival 2D echelle spectra from a couple of instrument pipelines that produce a standard output, and formatting these into the order-wise FITS format that Tayph uses. |
|
This reads the wavelength solution from the HARPS header keywords that encode the coefficients as a 4-th order polynomial. |
|
This is a replacement for fits.getdata, closing the file after reading to prevent too many open file errors. |
|
This works like the rebin(reform()) trick in IDL, where you use fast array manipulation operations to transform a 1D array into a 2D stack of itself, to be able to do operations on another 2D array by multiplication/addition/division without having to loop through the second dimension of said array. |
|
This cleans the molecfit project folder |
|
This collects the actual transmission model created after a pass through molecfit is completed |
|
|
|
This runs the entire cross correlation analysis cascade. |
|
Computers a running standard deviation of a 1-dimensional array z. |
|
Computers a running standard deviation of a 2-dimensional array z. |
|
This computes a running mean on a 2D array in a window with width w that slides over the array in the horizontal (x) direction. |
|
This computes a running median on a 2D array in a window with width w that slides over the array in the horizontal (x) direction. |
|
This computes a running standard deviation on a 2D array in a window with width w that slides over the array in the horizontal (x) direction. |
|
This code saves a stack of fits-files to a 3D cube, that you can play through in DS9. |
|
This is used to make a sub-selection of a 2D numpy array based on conditions (limits) of the X and Y axes of the array. |
|
This program returns the p (fraction btw 0 and 1) highest points in y, ignoring the very top fraction s (default zero, i.e. no points ignored), for the purpose of outlier rejection. |
|
|
|
|
|
This returns the n-sigma boundaries of an array, mainly used for scaling plots. |
|
This function takes a spectrum, and blurs it using either a Gaussian kernel or a box kernel, which have a FWHM width of w px everywhere. |
|
Short-hand for starting a timing measurement. |
|
This is the main command-line initializer of the cross-correlation routine provided by Tayph. |
|
This provides a little status indicator for use in long forloops. |
|
This function computes the rolling window over a rectangular (i.e. |
|
This runs Sysrem on a 2D frame of spectra; i.e. a time series of spectra or of a spectral order or of a cross-correlation function. |
|
This function computes the mass and radius of a star given its mass and radius relative to solar. |
|
Run the tests for the package. |
|
This tests whether an alias exists on the system. |
|
This tests the existence and integrity of the system-wide molecfit configuration folder. |
|
This code uses Ians astro python routines for the approximate Mandel & Agol transit lightcurve to produce the predicted transit lightcurve for the planet described by the configfile located at dp/config. |
|
This function tests the type of var against a requested variable type and raises an exception if either varname is not a string, or if type(var) is not equal to vartype. |
|
This function tests the types of the elements in the array or list var against a requested variable type and raises an exception if either varname is not a string, type(var) is not equal to numpy.array or list, or the elements of var are not ALL of a type equal to vartype. |
|
This program calculates the orbital velocity in km/s for the planet in the data sequence provided in dp, the data-path. |
|
This converts vaccuum wavelengths to air wavelengths. |
|
Return the Voigt line shape at x with Lorentzian component HWFM gamma and Gaussian sigma. |
|
This is a wrapper for writing a spectrum from a list to molecfit format. |
|
This saves a list of wl arrays and a corresponding list of transmission-spectra to a pickle file, to be read by the function below. |
|
This is a fast wrapper for fits.writeto, with overwrite enabled. |
Classes¶
|
This class defines most of the behaviour of the GUI to inspect the molecfit output. |