Skip to content

Commit

Permalink
move corv help_text to glossary
Browse files Browse the repository at this point in the history
  • Loading branch information
andycasey committed Oct 30, 2024
1 parent 3bc42d6 commit f6fe614
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions src/astra/models/corv.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,42 @@
import datetime
from peewee import (
FloatField,
DateTimeField,
TextField,
ForeignKeyField,
AutoField,
IntegerField
)
from astra import __version__
from astra.fields import (AutoField, DateTimeField, FloatField, TextField, IntegerField, ForeignKeyField)
from astra.models.base import BaseModel
from astra.models.source import Source
from astra.models.spectrum import Spectrum
from astra.models.pipeline import PipelineOutputMixin

from astra.glossary import Glossary


class Corv(BaseModel, PipelineOutputMixin):

"""A result from the `corv` pipeline."""

source_pk = ForeignKeyField(Source, null=True, index=True, lazy_load=False)
spectrum_pk = ForeignKeyField(
Spectrum,
index=True,
lazy_load=False,
help_text=Glossary.spectrum_pk
)
spectrum_pk = ForeignKeyField(Spectrum, index=True, lazy_load=False)

#> Astra Metadata
task_pk = AutoField(help_text=Glossary.task_pk)
v_astra = TextField(default=__version__, help_text=Glossary.v_astra)
created = DateTimeField(default=datetime.datetime.now, help_text=Glossary.created)
t_elapsed = FloatField(null=True, help_text=Glossary.t_elapsed)
t_overhead = FloatField(null=True, help_text=Glossary.t_overhead)
tag = TextField(default="", index=True, help_text=Glossary.tag)
task_pk = AutoField()
v_astra = TextField(default=__version__)
created = DateTimeField(default=datetime.datetime.now)
modified = DateTimeField(default=datetime.datetime.now)
t_elapsed = FloatField(null=True)
t_overhead = FloatField(null=True)
tag = TextField(default="", index=True)

#> Radial Velocity (corv)
v_rad = FloatField(null=True, help_text=Glossary.v_rad)
e_v_rad = FloatField(null=True, help_text=Glossary.e_v_rad)
v_rad = FloatField(null=True)
e_v_rad = FloatField(null=True)

#> Stellar Parameters
teff = FloatField(null=True, help_text=Glossary.teff)
e_teff = FloatField(null=True, help_text=Glossary.e_teff)
logg = FloatField(null=True, help_text=Glossary.logg)
e_logg = FloatField(null=True, help_text=Glossary.e_logg)
teff = FloatField(null=True)
e_teff = FloatField(null=True)
logg = FloatField(null=True)
e_logg = FloatField(null=True)

#> Initial values
initial_teff = FloatField(null=True, help_text=Glossary.initial_teff)
initial_logg = FloatField(null=True, help_text=Glossary.initial_logg)
initial_v_rad = FloatField(null=True, help_text="Initial radial velocity [km/s]")
initial_teff = FloatField(null=True)
initial_logg = FloatField(null=True)
initial_v_rad = FloatField(null=True)

#> Summary Statistics
rchi2 = FloatField(null=True, help_text=Glossary.rchi2)
result_flags = IntegerField(null=True, help_text=Glossary.result_flags)
rchi2 = FloatField(null=True)
result_flags = IntegerField(null=True)

0 comments on commit f6fe614

Please sign in to comment.