From 9a3cfaf5b393717918573fe59aaae10d96dde475 Mon Sep 17 00:00:00 2001 From: Steph Merritt Date: Tue, 5 Mar 2024 14:13:44 +0000 Subject: [PATCH] Initial commit of AdlerData class. --- src/adler/dataclasses/AdlerData.py | 21 +++++++++++++++++++++ src/adler/dataclasses/AdlerPlanetoid.py | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 src/adler/dataclasses/AdlerData.py diff --git a/src/adler/dataclasses/AdlerData.py b/src/adler/dataclasses/AdlerData.py new file mode 100644 index 0000000..1137857 --- /dev/null +++ b/src/adler/dataclasses/AdlerData.py @@ -0,0 +1,21 @@ +from dataclasses import dataclass, field +import numpy as np + + +@dataclass +class AdlerData: + """ + Class for storing Adler-calculated values. + + Note that for all per-filter attributes, the type is an array in order u, g, r, i, z, y. + + """ + + phaseAngle_min_adler: field(default_factory=np.zeros(6)) + phaseAngle_range_adler: field(default_factory=np.zeros(6)) + nobs_adler: field(default_factory=np.zeros(6)) + arc_adler: field(default_factory=np.zeros(6)) + H_P16_adler: field(default_factory=np.zeros(6)) + G12_P16_adler: field(default_factory=np.zeros(6)) + HErr_P16_adler: field(default_factory=np.zeros(6)) + G12Err_P16_adler: field(default_factory=np.zeros(6)) diff --git a/src/adler/dataclasses/AdlerPlanetoid.py b/src/adler/dataclasses/AdlerPlanetoid.py index 820d4c3..0d79da6 100644 --- a/src/adler/dataclasses/AdlerPlanetoid.py +++ b/src/adler/dataclasses/AdlerPlanetoid.py @@ -1,4 +1,5 @@ from adler.dataclasses.DataSchema import Observations, MPCORB, SSObject +from adler.dataclasses.AdlerData import AdlerData from adler.science.DummyScience import DummyScience @@ -23,6 +24,9 @@ def __init__(self, ssObjectId, population_location="RSP", sql_filename=None): self.sql_filename = sql_filename # can also include date ranges at some point + # create empty AdlerData dataclass object + self.AdlerData = AdlerData() + # this creates the AdlerPlanetoid.Observations, AdlerPlanetoid.MPCORB and # AdlerPlanetoid.SSObject objects. self.populate_observations()