From 16ead3d4d3b7693cda3e7d8adac468a670dd4fe5 Mon Sep 17 00:00:00 2001 From: Dmitry Makarov Date: Tue, 17 Mar 2026 10:03:08 +0300 Subject: [PATCH 1/4] First attempt to the HI flux & width shcemas --- postgres/drafts/12_hi_schemas.sql | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 postgres/drafts/12_hi_schemas.sql diff --git a/postgres/drafts/12_hi_schemas.sql b/postgres/drafts/12_hi_schemas.sql new file mode 100644 index 00000000..a2d0f987 --- /dev/null +++ b/postgres/drafts/12_hi_schemas.sql @@ -0,0 +1,58 @@ +BEGIN; + +---------------------------------------------------- +-------------- Line Flux schema -------------------- +---------------------------------------------------- +CREATE SCHEMA IF NOT EXISTS lineflux ; +COMMENT ON SCHEMA lineflux IS 'Catalog of the spectral line fluxes'; + +CREATE TYPE lineflux.HIMethodType AS ENUM ( 'sum', 'fit' ) ; +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"}' ; + +CREATE TABLE lineflux.hi ( + record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict +, flux real NOT NULL +, e_flux real +, method lineflux.HIMethodType NOT NULL DEFAULT 'sum' +, PRIMARY KEY (record_id, method) +); +CREATE INDEX ON lineflux.data (record_id) ; +CREATE INDEX ON lineflux.data (method) ; + +COMMENT ON TABLE lineflux.hi IS 'Catalog of the HI line fluxes' ; +COMMENT ON COLUMN lineflux.hi.record_id IS 'Record ID' ; +COMMENT ON COLUMN lineflux.hi.flux IS '{"description":"Integrated HI line flux", "unit":"Jy.km/s", "ucd":"phot.flux.density;spect.line"}' ; +COMMENT ON COLUMN lineflux.hi.e_flux IS '{"description":"Error of the integrated HI line flux", "unit":"Jy.km/s", "ucd":"stat.error"}' ; +COMMENT ON COLUMN lineflux.hi.method IS 'Measurement type (sum, fit)' ; + + + +---------------------------------------------------- +-------------- Line Width schema ------------------- +---------------------------------------------------- +CREATE SCHEMA IF NOT EXISTS linewidth ; +COMMENT ON SCHEMA linewidth IS 'Catalog of the HI line width' ; + +CREATE TYPE linewidth.WidthMethodType AS ENUM ( 'max', 'peak', 'w2p', 'mean', 'int', 'edge', 'model' ) ; +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"}' ; + +CREATE TABLE linewidth.data ( + record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict +, width real NOT NULL +, e_width real +, method linewidth.WidthMethodType NOT NULL DEFAULT 'peak' +, level real NOT NULL DEFAULT 50 +, PRIMARY KEY (record_id, method, level) +); +CREATE INDEX ON lineflux.data (record_id) ; +CREATE INDEX ON lineflux.data (method) ; + +COMMENT ON TABLE linewidth.data IS 'Catalog of the HI line width' ; +COMMENT ON COLUMN linewidth.data.record_id IS 'Record ID' ; +COMMENT ON COLUMN linewidth.data.flux IS '{"description":"HI line width", "unit":"km/s", "ucd":"spect.line.width"}' ; +COMMENT ON COLUMN linewidth.data.e_flux IS '{"description":"Error of the HI line width", "unit":"km/s", "ucd":"stat.error"}' ; +COMMENT ON COLUMN linewidth.data.method IS 'Measurement type' ; +COMMENT ON COLUMN linewidth.data.level IS 'Measurement level in percent' ; + + +COMMIT; \ No newline at end of file From 6560122f66e0e1c5fe3c4fee6b017ea4926e5e6f Mon Sep 17 00:00:00 2001 From: Dmitry Makarov Date: Tue, 17 Mar 2026 12:20:03 +0300 Subject: [PATCH 2/4] Linewidth schema --- postgres/drafts/12_hi_schemas.sql | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/postgres/drafts/12_hi_schemas.sql b/postgres/drafts/12_hi_schemas.sql index a2d0f987..a9372bf8 100644 --- a/postgres/drafts/12_hi_schemas.sql +++ b/postgres/drafts/12_hi_schemas.sql @@ -9,6 +9,7 @@ COMMENT ON SCHEMA lineflux IS 'Catalog of the spectral line fluxes'; CREATE TYPE lineflux.HIMethodType AS ENUM ( 'sum', 'fit' ) ; 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"}' ; + CREATE TABLE lineflux.hi ( record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict , flux real NOT NULL @@ -26,6 +27,24 @@ COMMENT ON COLUMN lineflux.hi.e_flux IS '{"description":"Error of the integrated COMMENT ON COLUMN lineflux.hi.method IS 'Measurement type (sum, fit)' ; +CREATE OR REPLACE VIEW lineflux.hiview AS +SELECT + d.flux +, d.e_flux +, d.method +, r.* +FROM + lineflux.hi AS d + LEFT JOIN layer0.recordview AS r USING (record_id) +; + +COMMENT ON TABLE lineflux.hiview IS 'Catalog of the HI line fluxes' ; +COMMENT ON COLUMN lineflux.hiview.record_id IS 'Record ID' ; +COMMENT ON COLUMN lineflux.hiview.flux IS '{"description":"Integrated HI line flux", "unit":"Jy.km/s", "ucd":"phot.flux.density;spect.line"}' ; +COMMENT ON COLUMN lineflux.hiview.e_flux IS '{"description":"Error of the integrated HI line flux", "unit":"Jy.km/s", "ucd":"stat.error"}' ; +COMMENT ON COLUMN lineflux.hiview.method IS 'Measurement type (sum, fit)' ; + + ---------------------------------------------------- -------------- Line Width schema ------------------- @@ -33,6 +52,7 @@ COMMENT ON COLUMN lineflux.hi.method IS 'Measurement type (sum, fit)' ; CREATE SCHEMA IF NOT EXISTS linewidth ; COMMENT ON SCHEMA linewidth IS 'Catalog of the HI line width' ; + CREATE TYPE linewidth.WidthMethodType AS ENUM ( 'max', 'peak', 'w2p', 'mean', 'int', 'edge', 'model' ) ; 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"}' ; @@ -55,4 +75,35 @@ COMMENT ON COLUMN linewidth.data.method IS 'Measurement type' ; COMMENT ON COLUMN linewidth.data.level IS 'Measurement level in percent' ; +CREATE TABLE linewidth.dataset ( + table_id Integer PRIMARY KEY REFERENCES layer0.tables(id) ON UPDATE cascade ON DELETE restrict +, telescope Text NOT NULL +, resolution real NOT NULL +, correction boolean NOT NULL DEFAULT false +); + +COMMENT ON TABLE linewidth.dataset IS 'Description of the data on the HI line width' ; +COMMENT ON COLUMN linewidth.dataset.table_id IS 'Table ID' ; +COMMENT ON COLUMN linewidth.dataset.telescope IS 'Rdio telescope' ; -- It seems we need a special table on telescopes +COMMENT ON COLUMN linewidth.dataset.resolution IS '{"description":"Effective spectral resolution for the HI line width correction", "unit":"km/s", "ucd":"spect.resolution"}' ; +COMMENT ON COLUMN linewidth.dataset.correction IS 'The flag describing if the spectral resolution correction is already applied' ; + + + +CREATE OR REPLACE VIEW linewidth.dataview AS +SELECT + d.width +, d.e_width +, d.method +, d.level +, s.telescope +, s.resolution +, s.correction +, r.* +FROM + linewidth.data AS d + LEFT JOIN layer0.recordview AS r USING (record_id) + LEFT JOIN linewidth.dataset AS s USING (table_id) +; + COMMIT; \ No newline at end of file From 9a7fc304a7c01710245acd6fa985e783dc20340e Mon Sep 17 00:00:00 2001 From: Dmitry Makarov Date: Thu, 19 Mar 2026 11:45:45 +0300 Subject: [PATCH 3/4] Radio schema reworked --- postgres/drafts/12_hi_schemas.sql | 220 ++++++++++++++++++------------ 1 file changed, 135 insertions(+), 85 deletions(-) diff --git a/postgres/drafts/12_hi_schemas.sql b/postgres/drafts/12_hi_schemas.sql index a9372bf8..238bf088 100644 --- a/postgres/drafts/12_hi_schemas.sql +++ b/postgres/drafts/12_hi_schemas.sql @@ -1,109 +1,159 @@ BEGIN; ---------------------------------------------------- --------------- Line Flux schema -------------------- +-------------- Radio Observations schema ----------- ---------------------------------------------------- -CREATE SCHEMA IF NOT EXISTS lineflux ; -COMMENT ON SCHEMA lineflux IS 'Catalog of the spectral line fluxes'; +CREATE SCHEMA IF NOT EXISTS radio ; +COMMENT ON SCHEMA radio IS 'Catalog of the radio observations'; -CREATE TYPE lineflux.HIMethodType AS ENUM ( 'sum', 'fit' ) ; -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"}' ; +CREATE TYPE radio.FluxMethodType AS ENUM ( 'sum', 'fit' ) ; +COMMENT ON TYPE radio.FluxMethodType IS '{"sum":"Integrated radio line flux by summing all velocity channels", "fit":"Integrated radio line flux by model line fitting"}' ; +CREATE TYPE radio.VelConventionType AS ENUM ( 'optical', 'radio', 'relativistic' ) ; +COMMENT ON TYPE radio.VelConventionType IS '{"optical":"Voptical=c(λ-λ0)/λ0=cz", "radio":"Vradio=c(ν0-ν)/ν0; cz=Vradio/(1-Vradio/c)", "relativistic":"Relativistic Doppler effect: V=c(ν0^2-ν^2)/(ν0^2+ν^2)=c(λ^2-λ0^2)/(λ^2+λ0^2)=c[(1+z)^2-1]/[(1+z)^2+1]"}' ; -CREATE TABLE lineflux.hi ( - record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict -, flux real NOT NULL -, e_flux real -, method lineflux.HIMethodType NOT NULL DEFAULT 'sum' -, PRIMARY KEY (record_id, method) -); -CREATE INDEX ON lineflux.data (record_id) ; -CREATE INDEX ON lineflux.data (method) ; - -COMMENT ON TABLE lineflux.hi IS 'Catalog of the HI line fluxes' ; -COMMENT ON COLUMN lineflux.hi.record_id IS 'Record ID' ; -COMMENT ON COLUMN lineflux.hi.flux IS '{"description":"Integrated HI line flux", "unit":"Jy.km/s", "ucd":"phot.flux.density;spect.line"}' ; -COMMENT ON COLUMN lineflux.hi.e_flux IS '{"description":"Error of the integrated HI line flux", "unit":"Jy.km/s", "ucd":"stat.error"}' ; -COMMENT ON COLUMN lineflux.hi.method IS 'Measurement type (sum, fit)' ; - - -CREATE OR REPLACE VIEW lineflux.hiview AS -SELECT - d.flux -, d.e_flux -, d.method -, r.* -FROM - lineflux.hi AS d - LEFT JOIN layer0.recordview AS r USING (record_id) -; +CREATE TYPE radio.WidthMethodType AS ENUM ( 'max', 'peak', 'w2p', 'mean', 'int', 'edge', 'model' ) ; +COMMENT ON TYPE radio.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"}' ; -COMMENT ON TABLE lineflux.hiview IS 'Catalog of the HI line fluxes' ; -COMMENT ON COLUMN lineflux.hiview.record_id IS 'Record ID' ; -COMMENT ON COLUMN lineflux.hiview.flux IS '{"description":"Integrated HI line flux", "unit":"Jy.km/s", "ucd":"phot.flux.density;spect.line"}' ; -COMMENT ON COLUMN lineflux.hiview.e_flux IS '{"description":"Error of the integrated HI line flux", "unit":"Jy.km/s", "ucd":"stat.error"}' ; -COMMENT ON COLUMN lineflux.hiview.method IS 'Measurement type (sum, fit)' ; ----------------------------------------------------- --------------- Line Width schema ------------------- ----------------------------------------------------- -CREATE SCHEMA IF NOT EXISTS linewidth ; -COMMENT ON SCHEMA linewidth IS 'Catalog of the HI line width' ; +------------ Radio lines ------------------- +CREATE TABLE radio.lines ( + id Text PRIMARY KEY +, species Text NOT NULL +, transition Text NOT NULL +, frequency Real NOT NULL +, UNIQUE (species,transition) +); + +COMMENT ON TABLE radio.lines IS 'List of radio lines' ; +COMMENT ON COLUMN radio.lines.id IS 'Line ID' ; +COMMENT ON COLUMN radio.lines.species IS 'Designation of atoms and molecules' ; +COMMENT ON COLUMN radio.lines.transition IS 'Transition' ; +COMMENT ON COLUMN radio.lines.frequency IS '{"description":"Line frequency", "unit":"Hz", "ucd":"em.freq"}' ; + +INSERT INTO radio.lines (id,species,transition,frequency) VALUES + ('HI', 'HI', '21 cm', 1420.4058e6) +, ('CO(1-0)', 'CO', '(1-0)', 115.271) +, ('CO(2-1)', 'CO', '(2-1)', 230.538) +, ('OH 1612 MHz', 'OH', '1612 MHz', 1612.231e6) +, ('OH 1665 MHz', 'OH', '1665 MHz', 1665.402e6) +, ('OH 1667 MHz', 'OH', '1667 MHz', 1667.359e6) +, ('OH 1720 MHz', 'OH', '1612 MHz', 1720.530e6) +; + +------------- Telescopes -------------------- +CREATE TABLE radio.telescopes ( + id Text PRIMARY KEY +, description Text NOT NULL +) ; + +COMMENT ON TABLE radio.telescopes IS 'List of radio lines' ; +COMMENT ON COLUMN radio.telescopes.id IS 'Telescope ID' ; +COMMENT ON COLUMN radio.telescopes.description IS 'Telescope description' ; + +INSERT INTO radio.telescopes (id,description) VALUES + ('Nancay', 'Large radio telescope of the Nançay Radio Observatory') +, ('WSRT', 'Westerbork Synthesis Radio Telescope') +, ('GB140ft', 'NRAO Green Bank (43m, 140ft)') +, ('GB300ft', 'NRAO Green Bank (91m, 300ft)') +, ('GBT', 'Robert C. Byrd Green Bank Telescope (100m)') +, ('Effelsberg', 'Effelsberg Radio Telescope (100m)') +, ('Arecibo', 'Arecibo Telescope (305m, 1000ft)') +, ('Parkes', 'Murriyang, Parkes 64m Radio Telescope') +, ('ATCA', 'Australia Telescope Compact Array') +, ('GMRT', 'Giant Metrewave Radio Telescope') +, ('FAST', 'Five-hundred-meter Aperture Spherical Telescope') +, ('VLA', 'Karl G. Jansky Very Large Array') +, ('VLA A', 'A-configuration of the Karl G. Jansky Very Large Array') +, ('VLA B', 'B-configuration of the Karl G. Jansky Very Large Array') +, ('VLA C', 'C-configuration of the Karl G. Jansky Very Large Array') +, ('VLA D', 'A-configuration of the Karl G. Jansky Very Large Array') +; -CREATE TYPE linewidth.WidthMethodType AS ENUM ( 'max', 'peak', 'w2p', 'mean', 'int', 'edge', 'model' ) ; -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"}' ; -CREATE TABLE linewidth.data ( +------------- Data sets --------------------- +CREATE TABLE radio.datasets ( + id Integer PRIMARY KEY +, table_id Integer NOT NULL REFERENCES layer0.tables (id) ON DELETE restrict ON UPDATE cascade +, telescope_id Text NOT NULL REFERENCES radio.telescopes (id) ON DELETE restrict ON UPDATE cascade +, line_id Text NOT NULL DEFAULT 'HI' +, resolution real NOT NULL +, velocity_convention radio.VelConventionType NOT NULL DEFAULT 'optical' +, flux_correction boolean NOT NULL DEFAULT false +, resolution_correction boolean NOT NULL DEFAULT false +, redshift_correction boolean NOT NULL DEFAULT false +) ; + +COMMENT ON TABLE radio.datasets IS 'Dataset description' ; +COMMENT ON COLUMN radio.datasets.id IS 'Dataset ID' ; +COMMENT ON COLUMN radio.datasets.table_id IS 'Original data table ID' ; +COMMENT ON COLUMN radio.datasets.telescope_id IS 'Telescope ID' ; +COMMENT ON COLUMN radio.datasets.line_id IS 'Spectral line ID' ; +COMMENT ON COLUMN radio.datasets.resolution IS '{"description":"Effective spectral resolution", "unit":"km/s", "ucd":"spect.resolution"}' ; +COMMENT ON COLUMN radio.datasets.flux_correction IS 'Indication if the flux was corrected for the beam filling factor' ; +COMMENT ON COLUMN radio.datasets.resolution_correction IS 'Indication if the line width was corrected for the spectral resolution' ; +COMMENT ON COLUMN radio.datasets.redshift_correction IS 'Indication if the line width was corrected for the cosmological broadening' ; + + +------------- Line flux --------------------- +CREATE TABLE radio.line_flux ( + record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict +, flux real NOT NULL +, e_flux real +, method radio.line_fluxMethodType NOT NULL DEFAULT 'sum' +, PRIMARY KEY (record_id, method) +); +CREATE INDEX ON radio.line_flux (record_id) ; +CREATE INDEX ON radio.line_flux (method) ; + +COMMENT ON TABLE radio.line_flux IS 'Catalog of the radio line fluxes' ; +COMMENT ON COLUMN radio.line_flux.record_id IS 'Record ID' ; +COMMENT ON COLUMN radio.line_flux.flux IS '{"description":"Integrated radio line flux", "unit":"Jy.km/s", "ucd":"phot.flux.density;spect.line"}' ; +COMMENT ON COLUMN radio.line_flux.e_flux IS '{"description":"Error of the integrated radio line flux", "unit":"Jy.km/s", "ucd":"stat.error"}' ; +COMMENT ON COLUMN radio.line_flux.method IS 'Measurement type (sum, fit)' ; + + +------------- Line flux --------------------- +-- CREATE TABLE radio.continuum_flux ( +-- record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict +-- , flux real NOT NULL +-- , e_flux real +-- , frequency real NOT NULL +-- , bandwidth real NOT NULL +-- , PRIMARY KEY (record_id, frequency) +-- ); +-- CREATE INDEX ON radio.data (record_id) ; +-- CREATE INDEX ON radio.data (method) ; +-- +-- COMMENT ON TABLE radio.continuum_flux IS 'Catalog of the radio continuum fluxes' ; +-- COMMENT ON COLUMN radio.continuum_flux.record_id IS 'Record ID' ; +-- COMMENT ON COLUMN radio.continuum_flux.flux IS '{"description":"Flux density", "unit":"Jy", "ucd":"phot.flux.density;spect.line"}' ; +-- COMMENT ON COLUMN radio.continuum_flux.e_flux IS '{"description":"Error of the flux density", "unit":"Jy", "ucd":"stat.error"}' ; +-- COMMENT ON COLUMN radio.continuum_flux.frequency IS '{"description":"Frequency", "unit":"Hz", "ucd":"em.freq"}' ; +-- COMMENT ON COLUMN radio.continuum_flux.frequency IS '{"description":"Bandwidth", "unit":"Hz", "ucd":"em.freq"}' ; + + +------------- Line Width --------------------- +CREATE TABLE radio.line_width ( record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict , width real NOT NULL , e_width real -, method linewidth.WidthMethodType NOT NULL DEFAULT 'peak' +, method radio.WidthMethodType NOT NULL DEFAULT 'peak' , level real NOT NULL DEFAULT 50 , PRIMARY KEY (record_id, method, level) ); -CREATE INDEX ON lineflux.data (record_id) ; -CREATE INDEX ON lineflux.data (method) ; - -COMMENT ON TABLE linewidth.data IS 'Catalog of the HI line width' ; -COMMENT ON COLUMN linewidth.data.record_id IS 'Record ID' ; -COMMENT ON COLUMN linewidth.data.flux IS '{"description":"HI line width", "unit":"km/s", "ucd":"spect.line.width"}' ; -COMMENT ON COLUMN linewidth.data.e_flux IS '{"description":"Error of the HI line width", "unit":"km/s", "ucd":"stat.error"}' ; -COMMENT ON COLUMN linewidth.data.method IS 'Measurement type' ; -COMMENT ON COLUMN linewidth.data.level IS 'Measurement level in percent' ; - +CREATE INDEX ON radio.data (record_id) ; +CREATE INDEX ON radio.data (method) ; -CREATE TABLE linewidth.dataset ( - table_id Integer PRIMARY KEY REFERENCES layer0.tables(id) ON UPDATE cascade ON DELETE restrict -, telescope Text NOT NULL -, resolution real NOT NULL -, correction boolean NOT NULL DEFAULT false -); +COMMENT ON TABLE radio.line_width IS 'Catalog of the HI line width' ; +COMMENT ON COLUMN radio.line_width.record_id IS 'Record ID' ; +COMMENT ON COLUMN radio.line_width.flux IS '{"description":"HI line width", "unit":"km/s", "ucd":"spect.line.width"}' ; +COMMENT ON COLUMN radio.line_width.e_flux IS '{"description":"Error of the HI line width", "unit":"km/s", "ucd":"stat.error"}' ; +COMMENT ON COLUMN radio.line_width.method IS 'Measurement type' ; +COMMENT ON COLUMN radio.line_width.level IS 'Measurement level in percent' ; -COMMENT ON TABLE linewidth.dataset IS 'Description of the data on the HI line width' ; -COMMENT ON COLUMN linewidth.dataset.table_id IS 'Table ID' ; -COMMENT ON COLUMN linewidth.dataset.telescope IS 'Rdio telescope' ; -- It seems we need a special table on telescopes -COMMENT ON COLUMN linewidth.dataset.resolution IS '{"description":"Effective spectral resolution for the HI line width correction", "unit":"km/s", "ucd":"spect.resolution"}' ; -COMMENT ON COLUMN linewidth.dataset.correction IS 'The flag describing if the spectral resolution correction is already applied' ; - - - -CREATE OR REPLACE VIEW linewidth.dataview AS -SELECT - d.width -, d.e_width -, d.method -, d.level -, s.telescope -, s.resolution -, s.correction -, r.* -FROM - linewidth.data AS d - LEFT JOIN layer0.recordview AS r USING (record_id) - LEFT JOIN linewidth.dataset AS s USING (table_id) -; COMMIT; \ No newline at end of file From 0bb1b446a7d474c3135c8259cfa5063640e13217 Mon Sep 17 00:00:00 2001 From: Dmitry Makarov Date: Thu, 19 Mar 2026 11:54:46 +0300 Subject: [PATCH 4/4] Radia schema: bugs fixed --- postgres/drafts/12_hi_schemas.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/postgres/drafts/12_hi_schemas.sql b/postgres/drafts/12_hi_schemas.sql index 238bf088..6425f60f 100644 --- a/postgres/drafts/12_hi_schemas.sql +++ b/postgres/drafts/12_hi_schemas.sql @@ -40,7 +40,7 @@ INSERT INTO radio.lines (id,species,transition,frequency) VALUES , ('OH 1612 MHz', 'OH', '1612 MHz', 1612.231e6) , ('OH 1665 MHz', 'OH', '1665 MHz', 1665.402e6) , ('OH 1667 MHz', 'OH', '1667 MHz', 1667.359e6) -, ('OH 1720 MHz', 'OH', '1612 MHz', 1720.530e6) +, ('OH 1720 MHz', 'OH', '1720 MHz', 1720.530e6) ; @@ -103,7 +103,7 @@ CREATE TABLE radio.line_flux ( record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict , flux real NOT NULL , e_flux real -, method radio.line_fluxMethodType NOT NULL DEFAULT 'sum' +, method radio.FluxMethodType NOT NULL DEFAULT 'sum' , PRIMARY KEY (record_id, method) ); CREATE INDEX ON radio.line_flux (record_id) ; @@ -145,15 +145,15 @@ CREATE TABLE radio.line_width ( , level real NOT NULL DEFAULT 50 , PRIMARY KEY (record_id, method, level) ); -CREATE INDEX ON radio.data (record_id) ; -CREATE INDEX ON radio.data (method) ; +CREATE INDEX ON radio.line_width (record_id) ; +CREATE INDEX ON radio.line_width (method) ; COMMENT ON TABLE radio.line_width IS 'Catalog of the HI line width' ; COMMENT ON COLUMN radio.line_width.record_id IS 'Record ID' ; -COMMENT ON COLUMN radio.line_width.flux IS '{"description":"HI line width", "unit":"km/s", "ucd":"spect.line.width"}' ; -COMMENT ON COLUMN radio.line_width.e_flux IS '{"description":"Error of the HI line width", "unit":"km/s", "ucd":"stat.error"}' ; +COMMENT ON COLUMN radio.line_width.width IS '{"description":"Radio line width", "unit":"km/s", "ucd":"spect.line.width"}' ; +COMMENT ON COLUMN radio.line_width.e_width IS '{"description":"Error of the radio line width", "unit":"km/s", "ucd":"stat.error"}' ; COMMENT ON COLUMN radio.line_width.method IS 'Measurement type' ; COMMENT ON COLUMN radio.line_width.level IS 'Measurement level in percent' ; -COMMIT; \ No newline at end of file +COMMIT;