sorcha.lightcurves
Submodules
Attributes
Classes
Abstract base class for lightcurve models |
|
!!! THIS SHOULD NEVER BE USED - FOR TESTING ONLY !!! |
Functions
|
This method will identify all of the subclasses of |
|
This function is used to register newly created subclasses of the |
Package Contents
- class AbstractLightCurve(required_column_names: List[str] = [])[source]
Bases:
abc.ABCAbstract base class for lightcurve models
- required_column_names = []
- abstractmethod compute(df: pandas.DataFrame) numpy.array[source]
User implemented calculation based on the input provided by the pandas dataframe
df.- Parameters:
df (Pandas dataframe) -- The
observationsdataframe provided bySorcha.
- _validate_column_names(df: pandas.DataFrame) None[source]
- Private method that checks that the provided pandas dataframe contains
the required columns defined in
self.required_column_names.
- Parameters:
df (Pandas dataframe) -- The
observationsdataframe provided bySorcha.
- _log_exception(exception: Exception) None[source]
Log an error message from an exception to the error log file
- Parameters:
exception (Exception) -- The exception with a string to appended to the error log
- class IdentityLightCurve(required_column_names: List[str] = ['fieldMJD_TAI'])[source]
Bases:
sorcha.lightcurves.base_lightcurve.AbstractLightCurve!!! THIS SHOULD NEVER BE USED - FOR TESTING ONLY !!!
Rudimentary lightcurve model that returns no shift. This class is explicitly created for testing purposes.
- compute(df: pandas.DataFrame) numpy.array[source]
Returns numpy array of 0's with shape equal to the input dataframe time column.
- Parameters:
df (Pandas dataframe) -- The
observationsdataframe provided bySorcha.- Returns:
Numpy array of 0's with shape equal to the input dataframe time column.
- Return type:
np.array
- static name_id() str[source]
Returns the string identifier for this light curve method. It must be unique within all the subclasses of
AbstractLightCurve.We have chosen the name "identity" here because the input brightness will equal the output brightness if this model is applied.
- Returns:
Unique identifier for this light curve calculator
- Return type:
string
- register_lc_subclasses() Dict[str, Callable][source]
This method will identify all of the subclasses of
AbstractLightCurveand build a dictionary that mapsname : subclass.- Returns:
A dictionary of all of subclasses of
AbstractLightCurve. Where the string returned fromsubclass.name_id()is the key, and the subclass is the value.- Return type:
dict
- Raises:
ValueError -- If a duplicate key is found, a
ValueErroris raised. This would likely occur if a user copy/pasted an existing subclass but failed to update the string returned fromname_id().