Querying CosmoDC2 Mock v1 catalogs#

This tutorial demonstrates how to access the CosmoDC2 Mock V1 catalogs. More information about these catalogs can be found here: https://irsa.ipac.caltech.edu/Missions/cosmodc2.html

These catalogs can be accessed through IRSA’s Virtual Ovservatory Table Access Protocol (TAP) service. See https://www.ivoa.net/documents/TAP/ for details on the protocol. This service can be accessed through Python using the PyVO library.

# Uncomment the next line to install dependencies if needed.
# !pip install numpy matplotlib pyvo
import pyvo as vo
service = vo.dal.TAPService("https://irsa.ipac.caltech.edu/TAP")

List the available DC2 tables#

tables = service.tables
for tablename in tables.keys():
    if not "tap_schema" in tablename:
        if "dc2" in tablename:
            tables[tablename].describe()
cosmodc2mockv1
    CosmoDC2MockV1 Catalog - unabridged, spatially partitioned

cosmodc2mockv1_heavy
    CosmoDC2MockV1 Catalog - stellar mass > 10^7 Msun
cosmodc2mockv1_new
    CosmoDC2MockV1 Catalog - unabridged

Choose the DC2 catalog you want to work with.#

IRSA currently offers 3 versions of the DC2 catalog.

  • cosmodc2mockv1_new has been optimized to make searches with constraints on stellar mass and redshift fast.

  • cosmodc2mockv1 has been optimized to make searches with spatial constraints fast.

  • cosmodc2mockv1_heavy is the same as cosmodc2mockv1_new, except that it does not contain galaxies with stellar masses <= 10^7 solar masses.

If you are new to the DC2 catalog, we recommend that you start with cosmodc2mockv1_heavy

# Choose the abridged table to start with.
# Queries should be faster on smaller tables.

tablename = 'cosmodc2mockv1_heavy'

How many rows are in the chosen table?#

With TAP, you can query catalogs with constraints specified in IVOA Astronomical Data Query Language (ADQL; https://www.ivoa.net/documents/latest/ADQL.html), which is based on SQL.

# For example, this snippet of ADQL counts the number of elements in
# the redshift column of the table we chose.
adql = f"SELECT count(redshift) FROM {tablename}"
adql
'SELECT count(redshift) FROM cosmodc2mockv1_heavy'
# In order to use TAP with this ADQL string using pyvo, you can do the following:
result = service.search(adql)
result
<DALResultsTable length=1>
count(redshift)
    float64    
---------------
    597488849.0

The above query shows that there are 597,488,849 redshifts in this table.

What is the default maximum number of rows returned by the service?#

This service will return a maximum of 2 billion rows by default.

service.maxrec
2000000000

This default maximum can be changed, and there is no hard upper limit to what it can be changed to.

print(service.hardlimit)
None

List the columns in the chosen table#

This table contains 301 columns.

columns = tables[tablename].columns
print(len(columns))
301

Let’s learn a bit more about them.

for col in columns:
    print(f'{f"{col.name}":30s}  {col.description}')
ra                              Right ascension, lensed
dec                             Declination, lensed
ra_true                         Right ascension, not lensed
dec_true                        Declination, not lensed
redshift                        Cosmological redshift with line-of-sight motion
redshift_true                   Cosmological redshift
mag_u_lsst                      Apparent magnitude, lensed, in 'u' with LSST
mag_g_lsst                      Apparent magnitude, lensed, in 'g' with LSST
mag_r_lsst                      Apparent magnitude, lensed, in 'r' with LSST
mag_i_lsst                      Apparent magnitude, lensed, in 'i' with LSST
mag_z_lsst                      Apparent magnitude, lensed, in 'z' with LSST
mag_y_lsst                      Apparent magnitude, lensed, in 'y' with LSST
mag_u_sdss                      Apparent magnitude, lensed, in 'u' with SDSS
mag_g_sdss                      Apparent magnitude, lensed, in 'g' with SDSS
mag_r_sdss                      Apparent magnitude, lensed, in 'r' with SDSS
mag_i_sdss                      Apparent magnitude, lensed, in 'i' with SDSS
mag_z_sdss                      Apparent magnitude, lensed, in 'z' with SDSS
mag_true_u_lsst                 Apparent magnitude, not lensed, in 'u' with LSST
mag_true_g_lsst                 Apparent magnitude, not lensed, in 'g' with LSST
mag_true_r_lsst                 Apparent magnitude, not lensed, in 'r' with LSST
mag_true_i_lsst                 Apparent magnitude, not lensed, in 'i' with LSST
mag_true_z_lsst                 Apparent magnitude, not lensed, in 'z' with LSST
mag_true_y_lsst                 Apparent magnitude, not lensed, in 'y' with LSST
mag_true_u_sdss                 Apparent magnitude, not lensed, in 'u' with SDSS
mag_true_g_sdss                 Apparent magnitude, not lensed, in 'g' with SDSS
mag_true_r_sdss                 Apparent magnitude, not lensed, in 'r' with SDSS
mag_true_i_sdss                 Apparent magnitude, not lensed, in 'i' with SDSS
mag_true_z_sdss                 Apparent magnitude, not lensed, in 'z' with SDSS
mag_true_u_lsst_z0              Rest-frame absolute magnitude, not lensed, in 'u' with LSST
mag_true_g_lsst_z0              Rest-frame absolute magnitude, not lensed, in 'g' with LSST
mag_true_r_lsst_z0              Rest-frame absolute magnitude, not lensed, in 'r' with LSST
mag_true_i_lsst_z0              Rest-frame absolute magnitude, not lensed, in 'i' with LSST
mag_true_z_lsst_z0              Rest-frame absolute magnitude, not lensed, in 'z' with LSST
mag_true_y_lsst_z0              Rest-frame absolute magnitude, not lensed, in 'y' with LSST
mag_true_u_sdss_z0              Rest-frame absolute magnitude, not lensed, in 'u' with SDSS
mag_true_g_sdss_z0              Rest-frame absolute magnitude, not lensed, in 'g' with SDSS
mag_true_r_sdss_z0              Rest-frame absolute magnitude, not lensed, in 'r' with SDSS
mag_true_i_sdss_z0              Rest-frame absolute magnitude, not lensed, in 'i' with SDSS
mag_true_z_sdss_z0              Rest-frame absolute magnitude, not lensed, in 'z' with SDSS
mag_u_lsst_no_ext               Apparent magnitude, lensed, in 'u' with LSST without dust extinction in the host galaxy
mag_g_lsst_no_ext               Apparent magnitude, lensed, in 'g' with LSST without dust extinction in the host galaxy
mag_r_lsst_no_ext               Apparent magnitude, lensed, in 'r' with LSST without dust extinction in the host galaxy
mag_i_lsst_no_ext               Apparent magnitude, lensed, in 'i' with LSST without dust extinction in the host galaxy
mag_z_lsst_no_ext               Apparent magnitude, lensed, in 'z' with LSST without dust extinction in the host galaxy
mag_y_lsst_no_ext               Apparent magnitude, lensed, in 'y' with LSST without dust extinction in the host galaxy
mag_u_sdss_no_ext               Apparent magnitude, lensed, in 'u' with SDSS without dust extinction in the host galaxy
mag_g_sdss_no_ext               Apparent magnitude, lensed, in 'g' with SDSS without dust extinction in the host galaxy
mag_r_sdss_no_ext               Apparent magnitude, lensed, in 'r' with SDSS without dust extinction in the host galaxy
mag_i_sdss_no_ext               Apparent magnitude, lensed, in 'i' with SDSS without dust extinction in the host galaxy
mag_z_sdss_no_ext               Apparent magnitude, lensed, in 'z' with SDSS without dust extinction in the host galaxy
mag_true_u_lsst_no_ext          Apparent magnitude, not lensed, in 'u' with LSST without dust extinction in the host galaxy
mag_true_g_lsst_no_ext          Apparent magnitude, not lensed, in 'g' with LSST without dust extinction in the host galaxy
mag_true_r_lsst_no_ext          Apparent magnitude, not lensed, in 'r' with LSST without dust extinction in the host galaxy
mag_true_i_lsst_no_ext          Apparent magnitude, not lensed, in 'i' with LSST without dust extinction in the host galaxy
mag_true_z_lsst_no_ext          Apparent magnitude, not lensed, in 'z' with LSST without dust extinction in the host galaxy
mag_true_y_lsst_no_ext          Apparent magnitude, not lensed, in 'y' with LSST without dust extinction in the host galaxy
mag_true_u_sdss_no_ext          Apparent magnitude, not lensed, in 'u' with SDSS without dust extinction in the host galaxy
mag_true_g_sdss_no_ext          Apparent magnitude, not lensed, in 'g' with SDSS without dust extinction in the host galaxy
mag_true_r_sdss_no_ext          Apparent magnitude, not lensed, in 'r' with SDSS without dust extinction in the host galaxy
mag_true_i_sdss_no_ext          Apparent magnitude, not lensed, in 'i' with SDSS without dust extinction in the host galaxy
mag_true_z_sdss_no_ext          Apparent magnitude, not lensed, in 'z' with SDSS without dust extinction in the host galaxy
mag_true_u_lsst_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'u' with LSST without dust extinction in the host galaxy
mag_true_g_lsst_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'g' with LSST without dust extinction in the host galaxy
mag_true_r_lsst_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'r' with LSST without dust extinction in the host galaxy
mag_true_i_lsst_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'i' with LSST without dust extinction in the host galaxy
mag_true_z_lsst_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'z' with LSST without dust extinction in the host galaxy
mag_true_y_lsst_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'y' with LSST without dust extinction in the host galaxy
mag_true_u_sdss_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'u' with SDSS without dust extinction in the host galaxy
mag_true_g_sdss_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'g' with SDSS without dust extinction in the host galaxy
mag_true_r_sdss_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'r' with SDSS without dust extinction in the host galaxy
mag_true_i_sdss_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'i' with SDSS without dust extinction in the host galaxy
mag_true_z_sdss_z0_no_ext       Rest-frame absolute magnitude, not lensed, in 'z' with SDSS without dust extinction in the host galaxy
sersic_disk                     Sersic index of disk light profile
sersic_bulge                    Sersic index of bulge light profile
a_v                             Extinction in V-band, for galaxy light profile
a_v_disk                        Extinction in V-band, for disk light profile
a_v_bulge                       Extinction in V-band, for bulge light profile
r_v                             Ratio of total to selective extinction in B and V bands, for galaxy light profile
r_v_disk                        Ratio of total to selective extinction in B and V bands, for disk light profile
r_v_bulge                       Ratio of total to selective extinction in B and V bands, for bulge light profile
size_true                       Galaxy half-light radius (of major axis), not lensed
size_minor_true                 Galaxy half-light radius (of minor axis), not lensed
size_disk_true                  Disk half-light radius (of major axis), not lensed
size_minor_disk_true            Disk half-light radius (of minor axis), not lensed
size_bulge_true                 Bulge half-light radius (of major axis), not lensed
size_minor_bulge_true           Bulge half-light radius (of minor axis), not lensed
position_angle_true             Position angle (arctan(E2/E1)), for galaxy, not lensed
ellipticity_true                Ellipticity (= sqrt(E1^2+E2^2) = (1-q)/(1+q)), for galaxy, not lensed, where q = size_minor_true/size_true
ellipticity_1_true              Ellipticity component 1, for galaxy, not lensed
ellipticity_2_true              Ellipticity component 2, for galaxy, not lensed
ellipticity_disk_true           Ellipticity (= sqrt(E1^2+E2^2) = (1-q)/(1+q)), for disk, not lensed, where q = size_minor_disk_true/size_disk_true
ellipticity_1_disk_true         Ellipticity component 1, for disk, not lensed
ellipticity_2_disk_true         Ellipticity component 2, for disk, not lensed
ellipticity_bulge_true          Ellipticity (= sqrt(E1^2+E2^2) = (1-q)/(1+q)), for bulge, not lensed, where q = size_minor_bulge_true/size_bulge_true
ellipticity_1_bulge_true        Ellipticity component 1, for bulge, not lensed
ellipticity_2_bulge_true        Ellipticity component 2, for bulge, not lensed
shear_1                         Shear (gamma) component 1 in treecorr/GalSim convention
shear_2                         Shear (gamma) component 2 in treecorr/GalSim convention
shear_2_phosim                  Shear (gamma) component 2 in PhoSim convention ( = -shear_2 )
shear_2_treecorr                Shear (gamma) component 2 in treecorr/GalSim convention ( = shear_2 )
convergence                     Convergence (kappa)
magnification                   Magnification
galaxy_id                       Unique integer identifier
halo_id                         Unique ID of the main halo that contains the galaxy
halo_mass                       Halo mass of the main halo that contains the galaxy
stellar_mass                    Total stellar mass of the galaxy
stellar_mass_disk               Stellar mass of the disk component
stellar_mass_bulge              Stellar mass of the bulge component
bulge_to_total_ratio_i          bulge-to-total luminosity ratio in 'i'
is_central                      1 if the galaxy is the central galaxy of the main halo, 0 otherwise.
position_x                      3D position (x coordinate)
position_y                      3D position (y coordinate)
position_z                      3D position (z coordinate)
velocity_x                      3D velocity (x component)
velocity_y                      3D velocity (y component)
velocity_z                      3D velocity (z component)
sed_1000_246                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 1000 to 1246 in Angstroms
sed_1246_306                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 1246 to 1552 in Angstroms
sed_1552_381                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 1552 to 1933 in Angstroms
sed_1933_474                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 1933 to 2407 in Angstroms
sed_2407_591                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 2407 to 2998 in Angstroms
sed_2998_186                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 2998 to 3184 in Angstroms
sed_3184_197                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 3184 to 3381 in Angstroms
sed_3381_209                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 3381 to 3590 in Angstroms
sed_3590_222                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 3590 to 3812 in Angstroms
sed_3812_236                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 3812 to 4048 in Angstroms
sed_4048_251                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 4048 to 4299 in Angstroms
sed_4299_266                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 4299 to 4565 in Angstroms
sed_4565_283                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 4565 to 4848 in Angstroms
sed_4848_300                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 4848 to 5148 in Angstroms
sed_5148_319                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 5148 to 5467 in Angstroms
sed_5467_339                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 5467 to 5806 in Angstroms
sed_5806_360                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 5806 to 6166 in Angstroms
sed_6166_382                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 6166 to 6548 in Angstroms
sed_6548_406                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 6548 to 6954 in Angstroms
sed_6954_431                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 6954 to 7385 in Angstroms
sed_7385_458                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 7385 to 7843 in Angstroms
sed_7843_486                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 7843 to 8329 in Angstroms
sed_8329_517                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 8329 to 8846 in Angstroms
sed_8846_549                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 8846 to 9395 in Angstroms
sed_9395_583                    Integrated, rest-frame, AB luminosity for a narrow tophat filter from 9395 to 9978 in Angstroms
sed_9978_1489                   Integrated, rest-frame, AB luminosity for a narrow tophat filter from 9978 to 11467 in Angstroms
sed_11467_1710                  Integrated, rest-frame, AB luminosity for a narrow tophat filter from 11467 to 13177 in Angstroms
sed_13177_1966                  Integrated, rest-frame, AB luminosity for a narrow tophat filter from 13177 to 15143 in Angstroms
sed_15143_2259                  Integrated, rest-frame, AB luminosity for a narrow tophat filter from 15143 to 17402 in Angstroms
sed_17402_2596                  Integrated, rest-frame, AB luminosity for a narrow tophat filter from 17402 to 19998 in Angstroms
sed_1000_246_disk               Same as sed_1000_246 but for disk
sed_1246_306_disk               Same as sed_1246_306 but for disk
sed_1552_381_disk               Same as sed_1552_381 but for disk
sed_1933_474_disk               Same as sed_1933_474 but for disk
sed_2407_591_disk               Same as sed_2407_591 but for disk
sed_2998_186_disk               Same as sed_2998_186 but for disk
sed_3184_197_disk               Same as sed_3184_197 but for disk
sed_3381_209_disk               Same as sed_3381_209 but for disk
sed_3590_222_disk               Same as sed_3590_222 but for disk
sed_3812_236_disk               Same as sed_3812_236 but for disk
sed_4048_251_disk               Same as sed_4048_251 but for disk
sed_4299_266_disk               Same as sed_4299_266 but for disk
sed_4565_283_disk               Same as sed_4565_283 but for disk
sed_4848_300_disk               Same as sed_4848_300 but for disk
sed_5148_319_disk               Same as sed_5148_319 but for disk
sed_5467_339_disk               Same as sed_5467_339 but for disk
sed_5806_360_disk               Same as sed_5806_360 but for disk
sed_6166_382_disk               Same as sed_6166_382 but for disk
sed_6548_406_disk               Same as sed_6548_406 but for disk
sed_6954_431_disk               Same as sed_6954_431 but for disk
sed_7385_458_disk               Same as sed_7385_458 but for disk
sed_7843_486_disk               Same as sed_7843_486 but for disk
sed_8329_517_disk               Same as sed_8329_517 but for disk
sed_8846_549_disk               Same as sed_8846_549 but for disk
sed_9395_583_disk               Same as sed_9395_583 but for disk
sed_9978_1489_disk              Same as sed_9978_1489 but for disk
sed_11467_1710_disk             Same as sed_11467_1710 but for disk
sed_13177_1966_disk             Same as sed_13177_1966 but for disk
sed_15143_2259_disk             Same as sed_15143_2259 but for disk
sed_17402_2596_disk             Same as sed_17402_2596 but for disk
sed_1000_246_bulge              Same as sed_1000_246 but for bulge
sed_1246_306_bulge              Same as sed_1246_306 but for bulge
sed_1552_381_bulge              Same as sed_1552_381 but for bulge
sed_1933_474_bulge              Same as sed_1933_474 but for bulge
sed_2407_591_bulge              Same as sed_2407_591 but for bulge
sed_2998_186_bulge              Same as sed_2998_186 but for bulge
sed_3184_197_bulge              Same as sed_3184_197 but for bulge
sed_3381_209_bulge              Same as sed_3381_209 but for bulge
sed_3590_222_bulge              Same as sed_3590_222 but for bulge
sed_3812_236_bulge              Same as sed_3812_236 but for bulge
sed_4048_251_bulge              Same as sed_4048_251 but for bulge
sed_4299_266_bulge              Same as sed_4299_266 but for bulge
sed_4565_283_bulge              Same as sed_4565_283 but for bulge
sed_4848_300_bulge              Same as sed_4848_300 but for bulge
sed_5148_319_bulge              Same as sed_5148_319 but for bulge
sed_5467_339_bulge              Same as sed_5467_339 but for bulge
sed_5806_360_bulge              Same as sed_5806_360 but for bulge
sed_6166_382_bulge              Same as sed_6166_382 but for bulge
sed_6548_406_bulge              Same as sed_6548_406 but for bulge
sed_6954_431_bulge              Same as sed_6954_431 but for bulge
sed_7385_458_bulge              Same as sed_7385_458 but for bulge
sed_7843_486_bulge              Same as sed_7843_486 but for bulge
sed_8329_517_bulge              Same as sed_8329_517 but for bulge
sed_8846_549_bulge              Same as sed_8846_549 but for bulge
sed_9395_583_bulge              Same as sed_9395_583 but for bulge
sed_9978_1489_bulge             Same as sed_9978_1489 but for bulge
sed_11467_1710_bulge            Same as sed_11467_1710 but for bulge
sed_13177_1966_bulge            Same as sed_13177_1966 but for bulge
sed_15143_2259_bulge            Same as sed_15143_2259 but for bulge
sed_17402_2596_bulge            Same as sed_17402_2596 but for bulge
sed_1000_246_no_ext             Same as sed_1000_246 but without dust extinction in the host galaxy
sed_1246_306_no_ext             Same as sed_1246_306 but without dust extinction in the host galaxy
sed_1552_381_no_ext             Same as sed_1552_381 but without dust extinction in the host galaxy
sed_1933_474_no_ext             Same as sed_1933_474 but without dust extinction in the host galaxy
sed_2407_591_no_ext             Same as sed_2407_591 but without dust extinction in the host galaxy
sed_2998_186_no_ext             Same as sed_2998_186 but without dust extinction in the host galaxy
sed_3184_197_no_ext             Same as sed_3184_197 but without dust extinction in the host galaxy
sed_3381_209_no_ext             Same as sed_3381_209 but without dust extinction in the host galaxy
sed_3590_222_no_ext             Same as sed_3590_222 but without dust extinction in the host galaxy
sed_3812_236_no_ext             Same as sed_3812_236 but without dust extinction in the host galaxy
sed_4048_251_no_ext             Same as sed_4048_251 but without dust extinction in the host galaxy
sed_4299_266_no_ext             Same as sed_4299_266 but without dust extinction in the host galaxy
sed_4565_283_no_ext             Same as sed_4565_283 but without dust extinction in the host galaxy
sed_4848_300_no_ext             Same as sed_4848_300 but without dust extinction in the host galaxy
sed_5148_319_no_ext             Same as sed_5148_319 but without dust extinction in the host galaxy
sed_5467_339_no_ext             Same as sed_5467_339 but without dust extinction in the host galaxy
sed_5806_360_no_ext             Same as sed_5806_360 but without dust extinction in the host galaxy
sed_6166_382_no_ext             Same as sed_6166_382 but without dust extinction in the host galaxy
sed_6548_406_no_ext             Same as sed_6548_406 but without dust extinction in the host galaxy
sed_6954_431_no_ext             Same as sed_6954_431 but without dust extinction in the host galaxy
sed_7385_458_no_ext             Same as sed_7385_458 but without dust extinction in the host galaxy
sed_7843_486_no_ext             Same as sed_7843_486 but without dust extinction in the host galaxy
sed_8329_517_no_ext             Same as sed_8329_517 but without dust extinction in the host galaxy
sed_8846_549_no_ext             Same as sed_8846_549 but without dust extinction in the host galaxy
sed_9395_583_no_ext             Same as sed_9395_583 but without dust extinction in the host galaxy
sed_9978_1489_no_ext            Same as sed_9978_1489 but without dust extinction in the host galaxy
sed_11467_1710_no_ext           Same as sed_11467_1710 but without dust extinction in the host galaxy
sed_13177_1966_no_ext           Same as sed_13177_1966 but without dust extinction in the host galaxy
sed_15143_2259_no_ext           Same as sed_15143_2259 but without dust extinction in the host galaxy
sed_17402_2596_no_ext           Same as sed_17402_2596 but without dust extinction in the host galaxy
sed_1000_246_disk_no_ext        Same as sed_1000_246_no_ext but for disk
sed_1246_306_disk_no_ext        Same as sed_1246_306_no_ext but for disk
sed_1552_381_disk_no_ext        Same as sed_1552_381_no_ext but for disk
sed_1933_474_disk_no_ext        Same as sed_1933_474_no_ext but for disk
sed_2407_591_disk_no_ext        Same as sed_2407_591_no_ext but for disk
sed_2998_186_disk_no_ext        Same as sed_2998_186_no_ext but for disk
sed_3184_197_disk_no_ext        Same as sed_3184_197_no_ext but for disk
sed_3381_209_disk_no_ext        Same as sed_3381_209_no_ext but for disk
sed_3590_222_disk_no_ext        Same as sed_3590_222_no_ext but for disk
sed_3812_236_disk_no_ext        Same as sed_3812_236_no_ext but for disk
sed_4048_251_disk_no_ext        Same as sed_4048_251_no_ext but for disk
sed_4299_266_disk_no_ext        Same as sed_4299_266_no_ext but for disk
sed_4565_283_disk_no_ext        Same as sed_4565_283_no_ext but for disk
sed_4848_300_disk_no_ext        Same as sed_4848_300_no_ext but for disk
sed_5148_319_disk_no_ext        Same as sed_5148_319_no_ext but for disk
sed_5467_339_disk_no_ext        Same as sed_5467_339_no_ext but for disk
sed_5806_360_disk_no_ext        Same as sed_5806_360_no_ext but for disk
sed_6166_382_disk_no_ext        Same as sed_6166_382_no_ext but for disk
sed_6548_406_disk_no_ext        Same as sed_6548_406_no_ext but for disk
sed_6954_431_disk_no_ext        Same as sed_6954_431_no_ext but for disk
sed_7385_458_disk_no_ext        Same as sed_7385_458_no_ext but for disk
sed_7843_486_disk_no_ext        Same as sed_7843_486_no_ext but for disk
sed_8329_517_disk_no_ext        Same as sed_8329_517_no_ext but for disk
sed_8846_549_disk_no_ext        Same as sed_8846_549_no_ext but for disk
sed_9395_583_disk_no_ext        Same as sed_9395_583_no_ext but for disk
sed_1000_246_bulge_no_ext       Same as sed_1000_246_no_ext but for bulge
sed_1246_306_bulge_no_ext       Same as sed_1246_306_no_ext but for bulge
sed_1552_381_bulge_no_ext       Same as sed_1552_381_no_ext but for bulge
sed_1933_474_bulge_no_ext       Same as sed_1933_474_no_ext but for bulge
sed_2407_591_bulge_no_ext       Same as sed_2407_591_no_ext but for bulge
sed_2998_186_bulge_no_ext       Same as sed_2998_186_no_ext but for bulge
sed_3184_197_bulge_no_ext       Same as sed_3184_197_no_ext but for bulge
sed_3381_209_bulge_no_ext       Same as sed_3381_209_no_ext but for bulge
sed_3590_222_bulge_no_ext       Same as sed_3590_222_no_ext but for bulge
sed_3812_236_bulge_no_ext       Same as sed_3812_236_no_ext but for bulge
sed_4048_251_bulge_no_ext       Same as sed_4048_251_no_ext but for bulge
sed_4299_266_bulge_no_ext       Same as sed_4299_266_no_ext but for bulge
sed_4565_283_bulge_no_ext       Same as sed_4565_283_no_ext but for bulge
sed_4848_300_bulge_no_ext       Same as sed_4848_300_no_ext but for bulge
sed_5148_319_bulge_no_ext       Same as sed_5148_319_no_ext but for bulge
sed_5467_339_bulge_no_ext       Same as sed_5467_339_no_ext but for bulge
sed_5806_360_bulge_no_ext       Same as sed_5806_360_no_ext but for bulge
sed_6166_382_bulge_no_ext       Same as sed_6166_382_no_ext but for bulge
sed_6548_406_bulge_no_ext       Same as sed_6548_406_no_ext but for bulge
sed_6954_431_bulge_no_ext       Same as sed_6954_431_no_ext but for bulge
sed_7385_458_bulge_no_ext       Same as sed_7385_458_no_ext but for bulge
sed_7843_486_bulge_no_ext       Same as sed_7843_486_no_ext but for bulge
sed_8329_517_bulge_no_ext       Same as sed_8329_517_no_ext but for bulge
sed_8846_549_bulge_no_ext       Same as sed_8846_549_no_ext but for bulge
sed_9395_583_bulge_no_ext       Same as sed_9395_583_no_ext but for bulge
sed_9978_1489_disk_no_ext       Same as sed_9978_1489_no_ext but for disk
sed_11467_1710_disk_no_ext      Same as sed_11467_1710_no_ext but for disk
sed_13177_1966_disk_no_ext      Same as sed_13177_1966_no_ext but for disk
sed_15143_2259_disk_no_ext      Same as sed_15143_2259_no_ext but for disk
sed_17402_2596_disk_no_ext      Same as sed_17402_2596_no_ext but for disk
sed_9978_1489_bulge_no_ext      Same as sed_9978_1489_no_ext but for bulge
sed_11467_1710_bulge_no_ext     Same as sed_11467_1710_no_ext but for bulge
sed_13177_1966_bulge_no_ext     Same as sed_13177_1966_no_ext but for bulge
sed_15143_2259_bulge_no_ext     Same as sed_15143_2259_no_ext but for bulge
sed_17402_2596_bulge_no_ext     Same as sed_17402_2596_no_ext but for bulge
cntr                            None
x                               None
y                               None
z                               None
htm20                           None

Create a histogram of redshifts#

Let’s figure out what redshift range these galaxies cover. Since we found out above that it’s a large catalog, we can start with a spatial search over a small area of 0.1 deg. The ADQL that is needed for the spatial constraint is:

adql = f"SELECT redshift FROM {tablename} WHERE CONTAINS(POINT('ICRS', RAMean, DecMean), CIRCLE('ICRS',54.218205903,-37.497959343,.1))=1"
adql
"SELECT redshift FROM cosmodc2mockv1_heavy WHERE CONTAINS(POINT('ICRS', RAMean, DecMean), CIRCLE('ICRS',54.218205903,-37.497959343,.1))=1"

Now we can use the previously-defined service to execute the query with the spatial contraint.

cone_results = service.search(adql)
# Plot a histogram
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt

num_bins = 20
# the histogram of the data
n, bins, patches = plt.hist(cone_results['redshift'], num_bins,
                            facecolor='blue', alpha = 0.5)
plt.xlabel('Redshift')
plt.ylabel('Number')
plt.title('Redshift Histogram CosmoDC2 Mock Catalog V1 abridged')
Text(0.5, 1.0, 'Redshift Histogram CosmoDC2 Mock Catalog V1 abridged')
../../_images/786cb2008903343e6237b537f3cb85d57f68eef9d0ea61f5bcaf82e63f1a2a23.png

We can easily see form this plot that the simulated galaxies go out to z = 3.

Visualize galaxy colors at z ~ 0.5#

Now let’s visualize the galaxy main sequence at z = 2.0. First, we’ll do a narrow redshift cut with no spatial constraint.

Let’s do it as an asynchronous search since this might take awhile.

service = vo.dal.TAPService("https://irsa.ipac.caltech.edu/TAP")
adql = f"SELECT Mag_true_r_sdss_z0, Mag_true_g_sdss_z0, redshift FROM {tablename} WHERE redshift > 0.5 and redshift < 0.54"
results = service.run_async(adql)
len(results['mag_true_r_sdss_z0'])
3833489
# Since this results in almost 4 million galaxies,
# we will construct a 2D histogram rather than a scatter plot.
plt.hist2d(results['mag_true_r_sdss_z0'], results['mag_true_g_sdss_z0']-results['mag_true_r_sdss_z0'],
           bins=200, cmap='plasma', cmax=500)

# Plot a colorbar with label.
cb = plt.colorbar()
cb.set_label('Number')

# Add title and labels to plot.
plt.xlabel('SDSS Mag r')
plt.ylabel('SDSS rest-frame g-r color')

# Show the plot.
plt.show()
../../_images/83f9377e78079f6d738c052d7953eb5b2b4096fe7fb414db697f799ecc761d00.png

About this notebook#

  • Author: Vandana Desai (IRSA Science Lead)

  • Updated: 2024-07-24

  • Contact: https://irsa.ipac.caltech.edu/docs/help_desk.html