Commit 5e850c49 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Handle the units for properties in log. Note that currently they cannot be...

Handle the units for properties in log. Note that currently they cannot be saved properly in FITS files due to the format limit.
parent 4c12dc2e
...@@ -13,7 +13,7 @@ results of the analysis with different blocks of models. ...@@ -13,7 +13,7 @@ results of the analysis with different blocks of models.
import ctypes import ctypes
from astropy.table import Table, Column from astropy.table import Table, Column
from astropy.units import Unit from astropy.units import Unit, LogUnit
import numpy as np import numpy as np
from .utils import SharedArray from .utils import SharedArray
...@@ -379,19 +379,23 @@ class ResultsManager(object): ...@@ -379,19 +379,23 @@ class ResultsManager(object):
table.add_column(Column(self.obs.table['id'], name="id")) table.add_column(Column(self.obs.table['id'], name="id"))
for prop in sorted(self.bayes.intmean): for prop in sorted(self.bayes.intmean):
if prop.endswith('_log'):
unit = LogUnit(self.unit[prop[:-4]])
else:
unit = Unit(self.unit[prop])
table.add_column(Column(self.bayes.intmean[prop], table.add_column(Column(self.bayes.intmean[prop],
name="bayes."+prop, name="bayes."+prop, unit=unit))
unit=Unit(self.unit[prop])))
table.add_column(Column(self.bayes.interror[prop], table.add_column(Column(self.bayes.interror[prop],
name="bayes."+prop+"_err", name="bayes."+prop+"_err", unit=unit))
unit=Unit(self.unit[prop])))
for prop in sorted(self.bayes.extmean): for prop in sorted(self.bayes.extmean):
if prop.endswith('_log'):
unit = LogUnit(self.unit[prop[:-4]])
else:
unit = Unit(self.unit[prop])
table.add_column(Column(self.bayes.extmean[prop], table.add_column(Column(self.bayes.extmean[prop],
name="bayes."+prop, name="bayes."+prop, unit=unit))
unit=Unit(self.unit[prop])))
table.add_column(Column(self.bayes.exterror[prop], table.add_column(Column(self.bayes.exterror[prop],
name="bayes."+prop+"_err", name="bayes."+prop+"_err", unit=unit))
unit=Unit(self.unit[prop])))
for band in sorted(self.bayes.fluxmean): for band in sorted(self.bayes.fluxmean):
table.add_column(Column(self.bayes.fluxmean[band], table.add_column(Column(self.bayes.fluxmean[band],
name="bayes."+band, unit=Unit('mJy'))) name="bayes."+band, unit=Unit('mJy')))
......
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