GaiaDBInterface/models.py

84 lines
2.6 KiB
Python

from django.db import models
import uuid
class CatalogFile(models.Model):
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length=32)
STATUS_CHOICES = [
('PENDING', 'Pending'),
('IN_PROGRESS', 'In Progress'),
('INGESTED', 'Ingested'),
('INDEX_IN_PROGRESS', 'Index in progress'),
('INDEXED', 'Indexed')
]
status = models.CharField(max_length=17, choices=STATUS_CHOICES, default='PENDING')
class GaiaSource(models.Model):
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
catalog_file = models.ForeignKey(
CatalogFile, on_delete=models.CASCADE,
related_name='sources', null=True
)
#solution_id = models.CharField(blank=True, default='', max_length=19)
#solution identifier
#why charfield and not integerfield?
#designation = models.CharField(max_length=30, blank=True, default='')
#unique source designation across all DR
#source_id = models.CharField(max_length=19, blank=True, default='')
#unique id within DR again why not integer
#ref_epoch = models.FloatField(default=0.0, null=True)
#reference epoch julian years
ra = models.FloatField(default=0.0, null=True)
ra_error = models.FloatField(default=0.0, null=True)
#barycentric ra in icrs at ref epoch
#error in mas
dec = models.FloatField(default=0.0, null=True)
dec_error = models.FloatField(default=0.0, null=True)
#barycentric dec in icrs at ref epoch
#error in mas
#parallax = models.FloatField(default=0.0, null=True)
#parallax_error = models.FloatField(default=0.0, null=True)
#parallax and error at ref epoch in mas
#pmra = models.FloatField(default=0.0, null=True)
#pmra_error = models.FloatField(default=0.0, null=True)
#proper motion over ra mas/yr
#pmdec = models.FloatField(default=0.0, null=True)
#pmdec_error = models.FloatField(default=0.0, null=True)
#proper motion over dec mas/yr
#phot_g_mean_mag = models.FloatField(default=0.0, null=True)
#mean g band magnitude, vega scale
#phot_bp_mean_mag = models.FloatField(default=0.0, null=True)
#mean bp magnitude, vega scale
#phot_rp_mean_mag = models.FloatField(default=0.0, null=True)
#mean rp magnitude, vega scale
healpix_ring_index = models.BigIntegerField(null=True, blank=True)
healpix_nested_index = models.BigIntegerField(null=True, blank=True)
#healpix_nside = models.IntegerField(null=True, blank=True)
#additional field storing nside value