Skip to content

Commit 77a9cbc

Browse files
committed
EOL is converted to Unix
1 parent 3daa16c commit 77a9cbc

3 files changed

Lines changed: 109 additions & 109 deletions

File tree

postgres/drafts/06_designation.sql

100755100644
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
BEGIN ;
2-
3-
CREATE VIEW layer2.designations AS
4-
SELECT
5-
-- можно еще добавить record_id - но я не представляю зачем это может понадобиться на этом уровне
6-
r.pgc
7-
, d.design
8-
, t.table_name -- я не уверен, что это нужно
9-
, t.bib
10-
, b.code
11-
, b.year
12-
, b.author
13-
, b.title
14-
FROM
15-
designation.data AS d
16-
LEFT JOIN layer0.records AS r ON (d.record_id = r.id)
17-
LEFT JOIN layer0.tables AS t ON (r.table_id = t.id)
18-
LEFT JOIN common.bib AS b ON (t.bib = b.id)
19-
;
20-
1+
BEGIN ;
2+
3+
CREATE VIEW layer2.designations AS
4+
SELECT
5+
-- можно еще добавить record_id - но я не представляю зачем это может понадобиться на этом уровне
6+
r.pgc
7+
, d.design
8+
, t.table_name -- я не уверен, что это нужно
9+
, t.bib
10+
, b.code
11+
, b.year
12+
, b.author
13+
, b.title
14+
FROM
15+
designation.data AS d
16+
LEFT JOIN layer0.records AS r ON (d.record_id = r.id)
17+
LEFT JOIN layer0.tables AS t ON (r.table_id = t.id)
18+
LEFT JOIN common.bib AS b ON (t.bib = b.id)
19+
;
20+
2121
COMMIT ;

postgres/drafts/07_notes.sql

100755100644
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
BEGIN;
2-
3-
CREATE SCHEMA note ;
4-
5-
CREATE TABLE nature.data (
6-
record_id Text PRIMARY KEY REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict
7-
, note Text NOT NULL
8-
) ;
9-
10-
CREATE VIEW layer2.notes AS
11-
SELECT
12-
r.pgc
13-
, d.note
14-
, t.bib
15-
, b.code
16-
, b.year
17-
, b.author
18-
, b.title
19-
FROM
20-
note.data AS d
21-
LEFT JOIN layer0.records AS r ON (d.record_id = r.id)
22-
LEFT JOIN layer0.tables AS t ON (r.table_id = t.id)
23-
LEFT JOIN common.bib AS b ON (t.bib = b.id)
24-
;
25-
1+
BEGIN;
2+
3+
CREATE SCHEMA note ;
4+
5+
CREATE TABLE nature.data (
6+
record_id Text PRIMARY KEY REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict
7+
, note Text NOT NULL
8+
) ;
9+
10+
CREATE VIEW layer2.notes AS
11+
SELECT
12+
r.pgc
13+
, d.note
14+
, t.bib
15+
, b.code
16+
, b.year
17+
, b.author
18+
, b.title
19+
FROM
20+
note.data AS d
21+
LEFT JOIN layer0.records AS r ON (d.record_id = r.id)
22+
LEFT JOIN layer0.tables AS t ON (r.table_id = t.id)
23+
LEFT JOIN common.bib AS b ON (t.bib = b.id)
24+
;
25+
2626
COMMIT;

postgres/drafts/08_photometry.sql

100755100644
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
BEGIN;
2-
3-
------------------------------------------------------------------
4-
-------- Photometry catalog (level 1) ---------
5-
------------------------------------------------------------------
6-
------------------ Methods -------------------------------------
7-
-- Visual:
8-
-- -> magVisual
9-
-- -> sizeVisual
10-
-- (in fact, it corresponds to the limiting isophote)
11-
-- Total
12-
-- (Asymptotic extrapolation when aperture size -> Inf) :
13-
-- -> magTotal -> size%total
14-
-- Model:
15-
-- model -> magModel
16-
-- -> size%model
17-
-- Petrosian:
18-
-- -> Rpetro -> aperture -> magPetro -> size%petro
19-
-- Kron:
20-
-- -> Rkron -> aperture -> magKron
21-
------------------------------------------------------------------
22-
23-
CREATE TYPE photometry.MagMethodType AS ENUM ( 'psf', 'visual', 'aperture', 'isophotal', 'asymptotic', 'model', 'petrosian', 'kron' ) ;
24-
COMMENT ON TYPE photometry.MagMethodType IS '{ "psf":"Point Spread Function photometry for the point source", "visual":"Visual estimate", "aperture":"Aperture photometry", "isophotal":"Magnitude measurement inside a specified isophote", "asymptotic":"Asymptotic (extrapolated) magnitude when the aperture size -> Inf", "model":"Best fit model of the light distribution", "petrosian":"Petrosian adaptively scaled aperture", "kron":"Kron adaptively scaled aperture" }' ;
25-
26-
27-
CREATE TABLE photometry.total (
28-
record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict
29-
, band text NOT NULL REFERENCES photometry.calib_bands (id) ON DELETE restrict ON UPDATE cascade
30-
, mag real NOT NULL CHECK ( mag > -1 and mag < 30 )
31-
, e_mag real CHECK ( e_mag > 0 and e_mag < 0.5 )
32-
, method photometry.MagMethodType NOT NULL CHECK ( method IN ('psf', 'visual', 'asymptotic', 'model', 'petrosian', 'kron') )
33-
, PRIMARY KEY (record_id, method, band)
34-
);
35-
CREATE INDEX IF NOT EXISTS ON photometry.total (band) ;
36-
CREATE INDEX IF NOT EXISTS ON photometry.total (method) ;
37-
38-
COMMENT ON TABLE photometry.total IS 'Catalog of the total magnitudes';
39-
COMMENT ON COLUMN photometry.total.record_id IS 'Record ID';
40-
COMMENT ON COLUMN photometry.total.band IS 'Calibrated passband ID';
41-
COMMENT ON COLUMN photometry.total.mag IS '{"description":"Total (PSF|model|asymptotic|etc.) magnitude", "unit":"mag", "ucd":"phot.mag"}';
42-
COMMENT ON COLUMN photometry.total.e_mag IS '{"description":"Error of the total magnitude", "unit":"mag", "ucd":"stat.error;phot.mag"}';
43-
COMMENT ON COLUMN photometry.total.method IS 'Photometry method type (PSF, Kron, etc.)' ;
44-
45-
46-
CREATE TABLE photometry.isophotal (
47-
record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict
48-
, band text NOT NULL REFERENCES photometry.calib_bands (id) ON DELETE restrict ON UPDATE cascade
49-
, mag real NOT NULL CHECK ( mag > -1 and mag < 30 )
50-
, e_mag real CHECK ( e_mag > 0 and e_mag < 0.5 )
51-
, isophote real NOT NULL CHECK ( mag > -1 and mag < 30 )
52-
, PRIMARY KEY (record_id, method, band, isophote)
53-
);
54-
CREATE INDEX IF NOT EXISTS ON photometry.total (band) ;
55-
CREATE INDEX IF NOT EXISTS ON photometry.total (method) ;
56-
CREATE INDEX IF NOT EXISTS ON photometry.total (isophote) ;
57-
58-
COMMENT ON TABLE photometry.isophotal IS 'Catalog of the isophotal magnitudes';
59-
COMMENT ON COLUMN photometry.isophotal.record_id IS 'Record ID';
60-
COMMENT ON COLUMN photometry.isophotal.band IS 'Calibrated passband ID';
61-
COMMENT ON COLUMN photometry.isophotal.mag IS '{"description":"Isophotal magnitude", "unit":"mag", "ucd":"phot.mag"}';
62-
COMMENT ON COLUMN photometry.isophotal.e_mag IS '{"description":"Error of the isophotal magnitude", "unit":"mag", "ucd":"stat.error;phot.mag"}';
63-
COMMENT ON COLUMN photometry.isophotal.isophote IS 'Isophote level' ;
64-
1+
BEGIN;
2+
3+
------------------------------------------------------------------
4+
-------- Photometry catalog (level 1) ---------
5+
------------------------------------------------------------------
6+
------------------ Methods -------------------------------------
7+
-- Visual:
8+
-- -> magVisual
9+
-- -> sizeVisual
10+
-- (in fact, it corresponds to the limiting isophote)
11+
-- Total
12+
-- (Asymptotic extrapolation when aperture size -> Inf) :
13+
-- -> magTotal -> size%total
14+
-- Model:
15+
-- model -> magModel
16+
-- -> size%model
17+
-- Petrosian:
18+
-- -> Rpetro -> aperture -> magPetro -> size%petro
19+
-- Kron:
20+
-- -> Rkron -> aperture -> magKron
21+
------------------------------------------------------------------
22+
23+
CREATE TYPE photometry.MagMethodType AS ENUM ( 'psf', 'visual', 'aperture', 'isophotal', 'asymptotic', 'model', 'petrosian', 'kron' ) ;
24+
COMMENT ON TYPE photometry.MagMethodType IS '{ "psf":"Point Spread Function photometry for the point source", "visual":"Visual estimate", "aperture":"Aperture photometry", "isophotal":"Magnitude measurement inside a specified isophote", "asymptotic":"Asymptotic (extrapolated) magnitude when the aperture size -> Inf", "model":"Best fit model of the light distribution", "petrosian":"Petrosian adaptively scaled aperture", "kron":"Kron adaptively scaled aperture" }' ;
25+
26+
27+
CREATE TABLE photometry.total (
28+
record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict
29+
, band text NOT NULL REFERENCES photometry.calib_bands (id) ON DELETE restrict ON UPDATE cascade
30+
, mag real NOT NULL CHECK ( mag > -1 and mag < 30 )
31+
, e_mag real CHECK ( e_mag > 0 and e_mag < 0.5 )
32+
, method photometry.MagMethodType NOT NULL CHECK ( method IN ('psf', 'visual', 'asymptotic', 'model', 'petrosian', 'kron') )
33+
, PRIMARY KEY (record_id, method, band)
34+
);
35+
CREATE INDEX IF NOT EXISTS ON photometry.total (band) ;
36+
CREATE INDEX IF NOT EXISTS ON photometry.total (method) ;
37+
38+
COMMENT ON TABLE photometry.total IS 'Catalog of the total magnitudes';
39+
COMMENT ON COLUMN photometry.total.record_id IS 'Record ID';
40+
COMMENT ON COLUMN photometry.total.band IS 'Calibrated passband ID';
41+
COMMENT ON COLUMN photometry.total.mag IS '{"description":"Total (PSF|model|asymptotic|etc.) magnitude", "unit":"mag", "ucd":"phot.mag"}';
42+
COMMENT ON COLUMN photometry.total.e_mag IS '{"description":"Error of the total magnitude", "unit":"mag", "ucd":"stat.error;phot.mag"}';
43+
COMMENT ON COLUMN photometry.total.method IS 'Photometry method type (PSF, Kron, etc.)' ;
44+
45+
46+
CREATE TABLE photometry.isophotal (
47+
record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict
48+
, band text NOT NULL REFERENCES photometry.calib_bands (id) ON DELETE restrict ON UPDATE cascade
49+
, mag real NOT NULL CHECK ( mag > -1 and mag < 30 )
50+
, e_mag real CHECK ( e_mag > 0 and e_mag < 0.5 )
51+
, isophote real NOT NULL CHECK ( mag > -1 and mag < 30 )
52+
, PRIMARY KEY (record_id, method, band, isophote)
53+
);
54+
CREATE INDEX IF NOT EXISTS ON photometry.total (band) ;
55+
CREATE INDEX IF NOT EXISTS ON photometry.total (method) ;
56+
CREATE INDEX IF NOT EXISTS ON photometry.total (isophote) ;
57+
58+
COMMENT ON TABLE photometry.isophotal IS 'Catalog of the isophotal magnitudes';
59+
COMMENT ON COLUMN photometry.isophotal.record_id IS 'Record ID';
60+
COMMENT ON COLUMN photometry.isophotal.band IS 'Calibrated passband ID';
61+
COMMENT ON COLUMN photometry.isophotal.mag IS '{"description":"Isophotal magnitude", "unit":"mag", "ucd":"phot.mag"}';
62+
COMMENT ON COLUMN photometry.isophotal.e_mag IS '{"description":"Error of the isophotal magnitude", "unit":"mag", "ucd":"stat.error;phot.mag"}';
63+
COMMENT ON COLUMN photometry.isophotal.isophote IS 'Isophote level' ;
64+
6565
COMMIT;

0 commit comments

Comments
 (0)