Skip to content
Snippets Groups Projects
Commit cc9fc1f1 authored by Marco Frailis's avatar Marco Frailis
Browse files

Cleaning database

parent 2c5829f1
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -47,6 +47,13 @@ class ImageType(CompositeField): ...@@ -47,6 +47,13 @@ class ImageType(CompositeField):
) )
class ImageStatistics(models.Model):
min = models.FloatField()
max = models.FloatField()
mean = models.FloatField()
stddev = models.FloatField()
median = models.FloatField()
class ImageBaseFrame(models.Model): class ImageBaseFrame(models.Model):
exposureTime = models.FloatField() exposureTime = models.FloatField()
...@@ -54,6 +61,12 @@ class ImageBaseFrame(models.Model): ...@@ -54,6 +61,12 @@ class ImageBaseFrame(models.Model):
naxis1 = models.PositiveIntegerField() naxis1 = models.PositiveIntegerField()
naxis2 = models.PositiveIntegerField() naxis2 = models.PositiveIntegerField()
imageType = ImageType() imageType = ImageType()
stats = models.OneToOneField(
ImageStatistics,
models.SET_NULL,
blank=True,
null=True,
)
class Meta: class Meta:
abstract = True abstract = True
...@@ -67,12 +80,16 @@ class Instrument(models.Model): ...@@ -67,12 +80,16 @@ class Instrument(models.Model):
class Pointing(CompositeField): class Pointing(CompositeField):
rightAscension = models.FloatField() rightAscension = models.FloatField()
declination = models.FloatField() declination = models.FloatField()
pointingAngle = models.FloatField() orientation = models.FloatField()
class ImageSpaceFrame(ImageBaseFrame): class ImageSpaceFrame(ImageBaseFrame):
observationDateTime = models.DateTimeField() observationDateTime = models.DateTimeField()
instrument = models.ForeignKey(Instrument, on_delete=models.CASCADE) observationId = models.PositiveIntegerField()
ditherNumber = models.PositiveSmallIntegerField()
instrument = models.ForeignKey(Instrument,
on_delete=models.CASCADE,
related_name='+')
commandedPointing = Pointing() commandedPointing = Pointing()
class Meta: class Meta:
...@@ -161,6 +178,21 @@ NISP_GRISM_WHEEL = ( ...@@ -161,6 +178,21 @@ NISP_GRISM_WHEEL = (
'CLOSE' 'CLOSE'
) )
class DataContainer(models.Model):
fileFormat = models.CharField(
max_length=10
)
formatIdentifier = models.CharField(
max_length=20
)
formatVersion = models.CharField(
max_length=20
)
url = models.URLField()
class NispRawFrame(ImageSpaceFrame): class NispRawFrame(ImageSpaceFrame):
filterWheelPosition = models.CharField( filterWheelPosition = models.CharField(
max_length=10, max_length=10,
...@@ -171,6 +203,9 @@ class NispRawFrame(ImageSpaceFrame): ...@@ -171,6 +203,9 @@ class NispRawFrame(ImageSpaceFrame):
max_length=10, max_length=10,
choices = [(d,d) for d in NISP_GRISM_WHEEL] choices = [(d,d) for d in NISP_GRISM_WHEEL]
) )
frameFile = models.OneToOneField(DataContainer,
on_delete=models.CASCADE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment