-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
64 lines (48 loc) · 1.73 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"""
GAVIP Example AVIS: Gaia DR1 AVI
Django models used by the AVI pipeline
"""
from django.db import models
from pipeline.models import AviJob
class GaiaDr1Job(AviJob):
class Meta:
abstract = True
output_path = models.CharField(max_length=100, null=True, blank=True)
def get_absolute_url(self):
return "%i/" % self.pk
class HrJob(GaiaDr1Job):
"""
All parameters required to generate the HR diagrams in a pipeline.
"""
query = models.CharField(max_length=2000, default="""SELECT gaia.source_id, gaia.hip,
gaia.phot_g_mean_mag+5*log10(gaia.parallax)-10 as g_mag_abs_gaia,
gaia.phot_g_mean_mag+5*log10(hip.plx)-10 as g_mag_abs_hip,
hip.b_v
FROM gaiadr1.tgas_source AS gaia
INNER JOIN public.hipparcos as hip
ON gaia.hip = hip.HIP
WHERE gaia.parallax/gaia.parallax_error >= 5 AND
hip.plx/hip.e_plx >= 5 AND
hip.e_b_v > 0.0 and hip.e_b_v <= 0.05 AND
(2.5/log(10))*(gaia.phot_g_mean_flux_error/gaia.phot_g_mean_flux) <= 0.05
""")
"""
This is a modified version of the T. Boch query, which has been updated to use the GACS names.
"""
pipeline_task = 'GenerateHrDiagrams'
"""
The associated pipeline task name.
"""
class VariableSourceJob(GaiaDr1Job):
"""
All parameters required to generate the variable source visualisations in a pipeline.
"""
RANDOM_SOURCE_ID = "<select random source id>"
source_id = models.CharField(max_length=2000, default=RANDOM_SOURCE_ID)
"""
Id of source to be visualised.
"""
pipeline_task = 'VisualiseVariableSource'
"""
The associated pipeline task name.
"""