|
| 1 | +BEGIN; |
| 2 | + |
| 3 | +------------------------------------------------------------------ |
| 4 | +-------- Geometry catalog (level 1) ----------- |
| 5 | +------------------------------------------------------------------ |
| 6 | +DROP SCHEMA IF EXISTS geometry CASCADE; |
| 7 | +CREATE SCHEMA IF NOT EXISTS geometry; |
| 8 | +COMMENT ON SCHEMA geometry IS 'Catalog of the object geometry'; |
| 9 | + |
| 10 | + |
| 11 | +CREATE TABLE geometry.data ( |
| 12 | + record_id Text NOT NULL REFERENCES layer0.records(id) ON UPDATE cascade ON DELETE restrict |
| 13 | +, band text NOT NULL REFERENCES photometry.calib_bands (id) ON DELETE restrict ON UPDATE cascade |
| 14 | +, method photometry.MagMethodType NOT NULL CHECK ( method IN ('moments', 'asymptotic', 'model', 'petrosian', 'kron') ) |
| 15 | +, level real NOT NULL CHECK (level>0 and level<100) DEFAULT 39.3 |
| 16 | +, a real NOT NULL CHECK (a>0) |
| 17 | +, e_a real CHECK (e_a>0) |
| 18 | +, b real NOT NULL CHECK (b<=a) |
| 19 | +, e_b real CHECK (e_b>0) |
| 20 | +, pa real CHECK (pa>=0 and pa<180) |
| 21 | +, e_pa real CHECK (e_pa>0) |
| 22 | +, isophote real CHECK (isophote>-1 and isophote<30) |
| 23 | +, e_isophote real CHECK (e_isophote>0 and e_isophote<0.5) |
| 24 | +, PRIMARY KEY (record_id, band, method, level) |
| 25 | +); |
| 26 | +CREATE INDEX ON geometry.data (record_id) ; |
| 27 | +CREATE INDEX ON geometry.data (band) ; |
| 28 | +CREATE INDEX ON geometry.data (level) ; |
| 29 | + |
| 30 | +COMMENT ON TABLE geometry.data IS 'Catalog of the isophotal photometry'; |
| 31 | +COMMENT ON COLUMN geometry.data.record_id IS 'Record ID'; |
| 32 | +COMMENT ON COLUMN geometry.data.band IS '{"description":"Calibrated passband ID", "ucd":"instr.filter"}'; |
| 33 | +COMMENT ON COLUMN geometry.data.method IS 'Measurement method of the total magnitude' ; |
| 34 | +COMMENT ON COLUMN geometry.data.level IS 'Percent of the enclosed flux' ; |
| 35 | +COMMENT ON COLUMN geometry.data.a IS '{"description":"Semi-major axis length at the given isophote", "unit":"arcsec", "ucd":"phys.angSize.smajAxis"}' ; |
| 36 | +COMMENT ON COLUMN geometry.data.e_a IS '{"description":"Error of the semi-major axis length at the given isophote", "unit":"arcsec", "ucd":"stat.error;phys.angSize.smajAxis"}' ; |
| 37 | +COMMENT ON COLUMN geometry.data.b IS '{"description":"Semi-minor axis length at the given isophote", "unit":"arcsec", "ucd":"phys.angSize.sminAxis"}' ; |
| 38 | +COMMENT ON COLUMN geometry.data.e_b IS '{"description":"Error of the semi-minor axis length at the given isophote", "unit":"arcsec", "ucd":"stat.error;phys.angSize.sminAxis"}' ; |
| 39 | +COMMENT ON COLUMN geometry.data.pa IS '{"description":"Position angle (measured east of north)", "unit":"deg", "ucd":"pos.posAng"}' ; |
| 40 | +COMMENT ON COLUMN geometry.data.e_pa IS '{"description":"Error of the position angle", "unit":"deg", "ucd":"stat.error;pos.posAng"}' ; |
| 41 | +COMMENT ON COLUMN geometry.data.isophote IS '{"description":"Surface brightness at given level",, "unit":"mag/arcmin2", "ucd":"phot.mag.sb"}' ; |
| 42 | +COMMENT ON COLUMN geometry.data.e_isophote IS '{"description":"Error fo the surface brightness at given level",, "unit":"mag/arcmin2", "ucd":"stat.error;phot.mag.sb"}' ; |
| 43 | + |
| 44 | +COMMIT; |
0 commit comments