Commit 793aa346 authored by  Hector Salas's avatar Hector Salas

Add observations class to observations.py

parent 1da063f6
...@@ -25,6 +25,23 @@ class ObservationsManager(object): ...@@ -25,6 +25,23 @@ class ObservationsManager(object):
return ObservationsManagerVirtual(config, **kwargs) return ObservationsManagerVirtual(config, **kwargs)
class Observation(object):
"""Class to take one row of the observations table and extract the list of
fluxes, intensive properties, extensive properties and their errors, that
are going to be considered in the fit.
"""
def __init__(self, row, cls):
self.redshift = row['redshift']
self.fluxes = np.array([row[band] for band in cls.bands])
self.fluxes_err = np.array([row[band + '_err'] for band in cls.bands])
self.intprops = np.array([row[prop] for prop in cls.intprops])
self.intprops_err = np.array([row[prop + '_err'] for prop in
cls.intprops])
self.extprops = np.array([row[prop] for prop in cls.extprops])
self.extprops_err = np.array([row[prop + '_err'] for prop in
cls.extprops])
class ObservationsManagerPassbands(object): class ObservationsManagerPassbands(object):
"""Class to generate a manager for data files providing fluxes in """Class to generate a manager for data files providing fluxes in
passbands. passbands.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment