Skip to content

Commit

Permalink
Add catalogdb.gaia_assas_sn_cepheids table
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jun 24, 2020
1 parent ffe399b commit b80940e
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This document records the main changes to the ``sdssdb`` code.
* Ensure reflection assigns double type arrays.
* Clear metadata on reconnect.
* Add ``lite`` materialized views to ``catalogdb``.
* Add ``catalogdb.gaia_assas_sn_cepheids`` table.

* :release:`0.4.3 <2020-06-05>`
* Add schema for ``gaia_dr2_ruwe``.
Expand Down
11 changes: 11 additions & 0 deletions python/sdssdb/peewee/sdss5db/catalogdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,17 @@ class AllWise_Lite(CatalogdbModel):
backref='+')


class GAIA_ASSAS_SN_Cepheids:

source_id = BigIntegerField(primary_key=True)

gaia = ForeignKeyField(Gaia_DR2,
field='source_id',
column_name='source_id',
object_id_name='source_id',
backref='assas')


# Add relational tables to namespace.
if database.connected and database.is_connection_usable():
all_tables = database.get_tables('catalogdb')
Expand Down
8 changes: 8 additions & 0 deletions schema/sdss5db/catalogdb/foreignKeys.sql
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,11 @@ ALTER TABLE catalogdb.bhm_rm_v0
ADD CONSTRAINT objid_unwise_fk
FOREIGN KEY (objid_unwise)
REFERENCES catalogdb.unwise (unwise_objid);


-- gaia_assas_sn_cepheids

ALTER TABLE catalogdb.gaia_assas_sn_cepheids
ADD CONSTRAINT source_id_fk
FOREIGN KEY (source_id)
REFERENCES catalogdb.gaia_dr2_source (source_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
List of cepheids from Inno et al. (in prep).
*/

CREATE TABLE catalogdb.gaia_assas_sn_cepheids (
source TEXT,
ref TEXT,
star TEXT,
period DOUBLE PRECISION,
amp_v DOUBLE PRECISION,
mean_v DOUBLE PRECISION,
a1_v DOUBLE PRECISION,
source_id BIGINT,
random_index INTEGER,
ref_epoch REAL,
ra DOUBLE PRECISION,
ra_error DOUBLE PRECISION,
dec DOUBLE PRECISION,
dec_error DOUBLE PRECISION,
parallax DOUBLE PRECISION,
parallax_error DOUBLE PRECISION,
parallax_over_error DOUBLE PRECISION,
pmra DOUBLE PRECISION,
pmra_error DOUBLE PRECISION,
pmdec DOUBLE PRECISION,
pmdec_error DOUBLE PRECISION,
ra_dec_corr DOUBLE PRECISION,
ra_parallax_corr DOUBLE PRECISION,
ra_pmra_corr DOUBLE PRECISION,
ra_pmdec_corr DOUBLE PRECISION,
dec_parallax_corr DOUBLE PRECISION,
dec_pmra_corr DOUBLE PRECISION,
dec_pmdec_corr DOUBLE PRECISION,
parallax_pmra_corr DOUBLE PRECISION,
parallax_pmdec_corr DOUBLE PRECISION,
pmra_pmdec_corr DOUBLE PRECISION,
phot_g_n_obs SMALLINT,
phot_g_mean_flux DOUBLE PRECISION,
phot_g_mean_flux_error DOUBLE PRECISION,
phot_g_mean_flux_over_error DOUBLE PRECISION,
phot_g_mean_mag DOUBLE PRECISION,
phot_bp_n_obs SMALLINT,
phot_bp_mean_flux DOUBLE PRECISION,
phot_bp_mean_flux_error DOUBLE PRECISION,
phot_bp_mean_flux_over_error DOUBLE PRECISION,
phot_bp_mean_mag DOUBLE PRECISION,
phot_rp_n_obs SMALLINT,
phot_rp_mean_flux DOUBLE PRECISION,
phot_rp_mean_flux_error DOUBLE PRECISION,
phot_rp_mean_flux_over_error DOUBLE PRECISION,
phot_rp_mean_mag DOUBLE PRECISION,
phot_bp_rp_excess_factor DOUBLE PRECISION,
phot_proc_mode SMALLINT,
bp_rp DOUBLE PRECISION,
bp_g DOUBLE PRECISION,
g_rp DOUBLE PRECISION,
radial_velocity DOUBLE PRECISION,
radial_velocity_error DOUBLE PRECISION,
a_g_val DOUBLE PRECISION,
a_g_percentile_lower DOUBLE PRECISION,
a_g_percentile_upper DOUBLE PRECISION,
e_bp_min_rp_val DOUBLE PRECISION,
e_bp_min_rp_percentile_lower DOUBLE PRECISION,
e_bp_min_rp_percentile_upper DOUBLE PRECISION,
variability DOUBLE PRECISION,
type TEXT,
twomass TEXT,
raj2000 DOUBLE PRECISION,
dej2000 DOUBLE PRECISION,
errhalfmaj REAL,
errhalfmin REAL,
errposang REAL,
jmag REAL,
hmag REAL,
kmag REAL,
e_jmag REAL,
e_hmag REAL,
e_kmag REAL,
qfl TEXT,
rfl SMALLINT,
x SMALLINT,
measurejd DOUBLE PRECISION,
angdist DOUBLE PRECISION
);

\COPY catalogdb.gaia_assas_sn_cepheids FROM '/uufs/chpc.utah.edu/common/home/sdss50/sdsswork/target/catalogs/gaia_assas_sn_cepheids/gaia_assas_sn_cepheids_Jun_2020.csv' WITH CSV HEADER;

ALTER TABLE catalogdb.gaia_assas_sn_cepheids ADD PRIMARY KEY (source_id);

0 comments on commit b80940e

Please sign in to comment.