-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |