API - Running the tool
For normal use it should suffice to use only the Erebus class. The WrappedFits, PhotometryData, and WrappedMCMC classes give control over each step of the process.
Erebus
erebus.ErebusBases:
erebus.utility.h5_serializable_file.H5SerializableObject instance for running the full pipeline, starting from calints files.
config: ErebusRunConfig = run_cfginstance-attributeThe configuration file used for this instance of the Erebus pipeline.
individual_fits: list[IndividualFit] = []instance-attributeThe individual fit instances of each visit.
joint_fit: JointFit = Noneinstance-attributeThe joint fit instance.
photometry: list[PhotometryData] = []instance-attributeThe photometry data of each visit.
planet = Planet(planet_path)instance-attributeThe planet configuration file used for this instance of the pipeline
visit_names: list[str] = []instance-attributeThe unique names of each visit.
load(path: str)staticmethodHelper method to directly load an Erebus instance cache file.
run(force_clear_cache: bool = False, output_folder='./output_{DATE}/')Performs all individual and joint fits. Results and plots are saved to the given folder. Output folder can optionally include the current time by writing {DATE}
WrappedFits
wrapped_fits.WrappedFitsBases:
erebus.utility.h5_serializable_file.H5SerializableA class wrapping the flux and time data from the calints fits files of a single visit If the star pixel position is not provided we will fit for it Contains the flux in a 127x127 pixel region centered around the star Performs outerlier rejection and interpolation of bad pixels.
Acts as the equivalent to a JWST Stage 3 input to the Erebus pipeline.
frames = []instance-attribute3D array respresenting time series images making up this observation.
raw_frames = []instance-attribute3D array respresenting time series images making up this observation, before performing outlier and nan rejection.
source_folder: str = source_folderinstance-attributeThe directory containing the files this WrappedFits is based on
time: list[float] = []instance-attributeThe time values loaded from the corresponding fits files
visit_name: str = visit_nameinstance-attributeThe unique name of the visit being observed.
load(path: str)staticmethodHelper method to directly load a WrappedFits instance cache file.
PhotometryData
photometry_data.PhotometryDataBases:
erebus.utility.h5_serializable_file.H5SerializableA class representing the photometric data from a single visit loaded from a calints fits file with a specific aperture and annulus
Also prepares frames for FN PCA
Acts as Stage 3 of the Erebus pipeline
annulus_end = annulus[1]instance-attributeOuter pixel radius of the annulus used for background subtraction when doing aperture photometry.
annulus_start = annulus[0]instance-attributeInner pixel radius of the annulus used for background subtraction when doing aperture photometry.
fits_file_location = os.path.abspath(fits_file._cache_file)instance-attributeAbsolute path of the cache file for the fits file that aperture photometry was performed on.
normalized_frames = []instance-attributeNormalized and background subtracted frames used for performing FN-PCA.
radius = radiusinstance-attributePixel radius used for aperture photometry.
raw_flux = []instance-attributeRaw flux from the star after performing background subtraction.
source_folder: str = fits_file.source_folderinstance-attributeThe directory containing the files this WrappedFits is based on
time = fits_file.timeinstance-attributeThe time values loaded from the corresponding fits files.
visit_name: str = fits_file.visit_nameinstance-attributeThe unique name of the visit being observed.
load(path: str)staticmethodHelper method to directly load a PhotometryData instance cache file.
WrappedMCMC
mcmc_model.WrappedMCMCBases:
erebus.utility.h5_serializable_file.H5SerializableWrapper class for emcee User can define a method that is to be fit and parameters with Bayesian priors The model will always fit for a Gaussian noise parameter "y_err"
auto_correlation = 0instance-attributeThe integrated autocorrelation time after the MCMC has finished running
iterations = 0instance-attributeHow many iterations this MCMC ran for before stopping.
model_function: Callable[[Any], float] = Noneinstance-attributeThe function to be fit
params: dict = {}instance-attributeDictionary of parameters. Each is a bayesian_parameter instance.
results: dict = {}instance-attributeDictionary of results after fitting
sampler: emcee.EnsembleSampler | emcee.backends.HDFBackend = Noneinstance-attributeThe emcee EnsembleSampler or HDFBackend which this class wrapped
add_parameter(name: str, param: Parameter)Adds bayesian parameters to our method, must be called before set_method
evaluate_model(x: np.ndarray, *params: list[Parameter]) -> floatEvaluates the model with the given x input and parameters
get_free_params() -> list[Parameter]Returns the keys of any parameter that isn't fixed i.e., will be fitted for
log_likelihood(theta: list[float], x: float, y: float)Given the parameters theta and the x and y values, calculates the Bayesian log likelihood.
run(x, y, max_steps=2000000, walkers=64, force_clear_cache=False) -> tuple[np.ndarray, emcee.EnsembleSampler, float, int]Runs the MCMC, gets the results (with errors), ensemble sampler instance, autocorrelation time, and interation count
set_method(method: Callable[[Any], float])Updates the method which will be fit for, and verifies that the method signature matches the parameters specified First parameter must be 'x' After that the order which parameters were added in must match their positions in the method signature