Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
orm_example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
odmc
orm_example
Commits
cc9fc1f1
Commit
cc9fc1f1
authored
6 years ago
by
Marco Frailis
Browse files
Options
Downloads
Patches
Plain Diff
Cleaning database
parent
2c5829f1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
db.sqlite3
+0
-0
0 additions, 0 deletions
db.sqlite3
imagedb/models.py
+38
-3
38 additions, 3 deletions
imagedb/models.py
with
38 additions
and
3 deletions
db.sqlite3
+
0
−
0
View file @
cc9fc1f1
No preview for this file type
This diff is collapsed.
Click to expand it.
imagedb/models.py
+
38
−
3
View file @
cc9fc1f1
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment