You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: postgres/drafts/12_hi_schemas.sql
+51Lines changed: 51 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ COMMENT ON SCHEMA lineflux IS 'Catalog of the spectral line fluxes';
9
9
CREATETYPElineflux.HIMethodType AS ENUM ( 'sum', 'fit' ) ;
10
10
COMMENT ON TYPE lineflux.HIMethodType IS '{"sum":"Integrated HI line flux by summing all velocity channels", "fit":"Integrated HI line flux by model line fitting"}' ;
11
11
12
+
12
13
CREATETABLElineflux.hi (
13
14
record_id TextNOT NULLREFERENCESlayer0.records(id) ONUPDATE cascade ON DELETE restrict
14
15
, flux realNOT NULL
@@ -26,13 +27,32 @@ COMMENT ON COLUMN lineflux.hi.e_flux IS '{"description":"Error of the integrated
26
27
COMMENT ON COLUMN lineflux.hi.method IS 'Measurement type (sum, fit)' ;
27
28
28
29
30
+
CREATE OR REPLACEVIEWlineflux.hiview AS
31
+
SELECT
32
+
d.flux
33
+
, d.e_flux
34
+
, d.method
35
+
, r.*
36
+
FROM
37
+
lineflux.hiAS d
38
+
LEFT JOINlayer0.recordviewAS r USING (record_id)
39
+
;
40
+
41
+
COMMENT ON TABLE lineflux.hiview IS 'Catalog of the HI line fluxes' ;
42
+
COMMENT ON COLUMN lineflux.hiview.record_id IS 'Record ID' ;
43
+
COMMENT ON COLUMN lineflux.hiview.flux IS '{"description":"Integrated HI line flux", "unit":"Jy.km/s", "ucd":"phot.flux.density;spect.line"}' ;
44
+
COMMENT ON COLUMN lineflux.hiview.e_flux IS '{"description":"Error of the integrated HI line flux", "unit":"Jy.km/s", "ucd":"stat.error"}' ;
45
+
COMMENT ON COLUMN lineflux.hiview.method IS 'Measurement type (sum, fit)' ;
COMMENT ON TYPE linewidth.WidthMethodType IS '{"max":"Maximal-value-based width", "peak":"Every peak-based width", "w2p":"Mean of peaks double-horn specific width", "mean":"Mean-flux–based width", "int":"Integrated-flux–based width", "edge":"Edge-based width", "model":"Model-based width"}' ;
38
58
@@ -55,4 +75,35 @@ COMMENT ON COLUMN linewidth.data.method IS 'Measurement type' ;
55
75
COMMENT ON COLUMN linewidth.data.level IS 'Measurement level in percent' ;
56
76
57
77
78
+
CREATETABLElinewidth.dataset (
79
+
table_id IntegerPRIMARY KEYREFERENCESlayer0.tables(id) ONUPDATE cascade ON DELETE restrict
80
+
, telescope TextNOT NULL
81
+
, resolution realNOT NULL
82
+
, correction booleanNOT NULL DEFAULT false
83
+
);
84
+
85
+
COMMENT ON TABLE linewidth.dataset IS 'Description of the data on the HI line width' ;
86
+
COMMENT ON COLUMN linewidth.dataset.table_id IS 'Table ID' ;
87
+
COMMENT ON COLUMN linewidth.dataset.telescope IS 'Rdio telescope' ; -- It seems we need a special table on telescopes
88
+
COMMENT ON COLUMN linewidth.dataset.resolution IS '{"description":"Effective spectral resolution for the HI line width correction", "unit":"km/s", "ucd":"spect.resolution"}' ;
89
+
COMMENT ON COLUMN linewidth.dataset.correction IS 'The flag describing if the spectral resolution correction is already applied' ;
0 commit comments