data_manager
- class QhX.data_manager.DataManager[source]
Bases:
object
A class for managing and processing astronomical data sets.
This class provides methods to load and process forced source data and object data, specifically focusing on time-domain objects and quasars.
- fs_df
DataFrame containing forced source data.
- Type:
pd.DataFrame or None
- fs_gp
GroupBy object with forced source data grouped by object ID.
- Type:
pd.core.groupby.DataFrameGroupBy or None
- object_df
DataFrame containing object data.
- Type:
pd.DataFrame or None
- td_objects
DataFrame containing time-domain objects.
- Type:
pd.DataFrame or None
- get_qso(object_ids: list, min_points: int = 100) list [source]
Get QSOs with complete u,g,r,i light curves with at least ‘min_points’ points.
- Parameters:
object_ids (list) – List of object IDs to check.
min_points (int, optional) – Minimum number of points required in each light curve (default is 100).
- Returns:
List of QSO IDs that meet the criteria.
- Return type:
list
Examples
>>> dm = DataManager() >>> dm.load_fs_df('path_to_fs_df.parquet') >>> dm.group_fs_df() >>> dm.load_object_df('path_to_object_df.parquet') >>> object_ids = ['id1', 'id2', 'id3'] >>> quasar_ids = dm.get_qso(object_ids)
- group_fs_df() DataFrameGroupBy [source]
Group forced source data by object ID.
- Returns:
The grouped DataFrame or None if fs_df is not available.
- Return type:
pd.core.groupby.DataFrameGroupBy or None
Examples
>>> dm = DataManager() >>> dm.load_fs_df('path_to_fs_df.parquet') >>> dm.group_fs_df() Forced source data grouped successfully.
- load_fs_df(path_source: str) DataFrame [source]
Load forced source data from a file.
- Parameters:
path_source (str) – The path to the source data file.
- Returns:
The loaded DataFrame or None in case of an error.
- Return type:
pd.DataFrame or None
Examples
>>> dm = DataManager() >>> dm.load_fs_df('path_to_fs_df.parquet') Forced source data loaded successfully.
- load_object_df(path_obj: str) DataFrame [source]
Load object data and filter for time-domain objects.
- Parameters:
path_obj (str) – The path to the object data file.
- Returns:
The filtered DataFrame or None in case of an error.
- Return type:
pd.DataFrame or None
Examples
>>> dm = DataManager() >>> dm.load_object_df('path_to_object_df.parquet') Object data loaded and processed successfully.