In [1]:
import numpy as np
from astropy.io import fits
from astropy.table import Table, Column
from desispec.io.spectra import read_spectra
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rc('font', size=14)
The quicktransients
program in the desisim transients branch will produce two FITS outputs:
The spectra can then be coadded using the desi_coadd_spectra
program available in desispec.
In [2]:
truth_file = '../../bgs_2020-03-08_0300s_001_truth.fits'
spect_file = '../../bgs_2020-03-08_0300s_001_spect.fits'
coadd_file = '../../bgs_2020-03-08_0300s_001_coadd.fits'
The truth file has the following tables:
WAVE
.FLUX
.TARGETS
table simulating a target list available in data.TRUTH
table with information about the object (redshift, flux, etc.).OBJTRUTH
table with line fluxes and other data generated for each object.
In [3]:
hdus = fits.open(truth_file)
hdus.info()
Filename: ../../bgs_2020-03-08_0300s_001_truth.fits
No. Name Ver Type Cards Dimensions Format
0 WAVE 1 PrimaryHDU 8 (32001,) float64
1 FLUX 1 ImageHDU 9 (32001, 100) float32
2 TARGETS 1 BinTableHDU 235 100R x 99C [I, J, 8A, J, 4A, D, D, E, E, 5E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, I, I, I, E, E, E, E, E, E, E, E, E, E, E, E, B, B, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, 2A, K, E, E, E, E, E, E, E, E, K, E, L, E, E, E, E, E, E, I, E, 1A, K, K, K]
3 TRUTH 1 BinTableHDU 51 100R x 17C [K, K, E, 10A, 10A, 10A, J, K, E, 15A, E, E, E, E, E, E, E]
4 OBJTRUTH 1 BinTableHDU 53 100R x 17C [K, E, E, E, E, E, E, E, E, E, E, E, 20A, 10A, E, E, E]
In [4]:
wave = hdus['WAVE'].data
flux = hdus['FLUX'].data
targets = Table.read(truth_file, 'TARGETS')
truth = Table.read(truth_file, 'TRUTH')
objtr = Table.read(truth_file, 'OBJTRUTH')
In [5]:
truth
Out[5]:
<Table length=100>
TARGETID MOCKID TRUEZ TRUESPECTYPE TEMPLATETYPE TEMPLATESUBTYPE TEMPLATEID SEED MAG MAGFILTER FLUX_G FLUX_R FLUX_Z FLUX_W1 FLUX_W2 FLUX_W3 FLUX_W4
mag nanomaggies nanomaggies nanomaggies nanomaggies nanomaggies nanomaggies nanomaggies
int64 int64 float32 str10 str10 str10 int32 int64 float32 str15 float32 float32 float32 float32 float32 float32 float32
122950001 39442479 0.31979337 GALAXY BGS 1528 889570419 19.522118 sdss2010-r 8.530254 16.150675 20.135765 18.063293 13.561185 0.0 0.0
122950002 39191741 0.30067772 GALAXY BGS 1568 776354895 19.055407 sdss2010-r 11.606274 25.826294 44.903187 53.18688 38.543854 0.0 0.0
122950003 39559440 0.16610113 GALAXY BGS 6397 570823249 19.931982 sdss2010-r 6.6919436 11.207017 14.134193 10.033721 7.4633784 0.0 0.0
122950004 40454276 0.3167331 GALAXY BGS 7286 617846192 19.62056 sdss2010-r 9.2901 14.651335 19.765135 19.43716 14.380677 0.0 0.0
122950005 38549858 0.120078176 GALAXY BGS 7492 1163573733 19.98743 sdss2010-r 4.99677 10.975766 21.221918 43.174496 35.41856 0.0 0.0
122950006 39559371 0.2248764 GALAXY BGS 7427 380246581 18.639769 sdss2010-r 22.581226 36.206165 38.576164 31.075006 24.072613 0.0 0.0
122950007 40890090 0.25627232 GALAXY BGS 7507 957175036 19.099724 sdss2010-r 14.94617 23.741371 29.98171 27.15031 22.225008 0.0 0.0
122950008 39565774 0.5775137 GALAXY BGS 5184 872163103 19.9638 sdss2010-r 4.3686852 11.224926 17.18447 35.570694 25.026514 0.0 0.0
122950009 40595659 0.19883993 GALAXY BGS 5930 1864505736 20.034039 sdss2010-r 6.1144304 10.439302 13.691724 10.569315 7.237731 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
122950091 39009428 0.16526465 GALAXY BGS 3142 1743183197 17.890905 sdss2010-r 51.463215 73.46343 103.862976 91.53062 65.280304 0.0 0.0
122950092 40029413 0.31963074 GALAXY BGS 5212 1540273852 19.277475 sdss2010-r 12.707229 20.71696 32.346745 36.718197 27.328165 0.0 0.0
122950093 39704839 0.12930746 GALAXY BGS 6868 1151350445 18.657742 sdss2010-r 18.510853 36.449123 53.653805 47.767384 33.386803 0.0 0.0
122950094 40667335 0.1958485 GALAXY BGS 6171 1011693500 19.092773 sdss2010-r 13.585359 24.752384 34.337494 37.349983 29.442865 0.0 0.0
122950095 37779927 0.3460831 GALAXY BGS 2521 2001636549 19.47317 sdss2010-r 5.177586 17.898182 35.62045 50.864883 36.36237 0.0 0.0
122950096 40671621 0.11701738 GALAXY BGS 3914 360582036 19.309277 sdss2010-r 14.565317 19.596085 24.929838 15.514724 10.115413 0.0 0.0
122950097 41501057 0.44814777 GALAXY BGS 5424 1480293482 19.825798 sdss2010-r 3.653399 12.677492 21.378723 38.13581 29.397194 0.0 0.0
122950098 39488301 0.2258223 GALAXY BGS 1652 334446238 19.46129 sdss2010-r 10.001626 17.663885 25.585272 27.4712 20.395878 0.0 0.0
122950099 37245301 0.1321732 GALAXY BGS 6562 539886401 18.228052 sdss2010-r 40.916363 51.77857 54.888752 40.670364 28.760216 0.0 0.0
122950100 40937697 0.419504 GALAXY BGS 2429 1377998320 19.747936 sdss2010-r 5.3968124 13.576779 17.971577 29.609905 24.41468 0.0 0.0
In [6]:
r = 22.5 - 2.5*np.log10(truth['FLUX_R'])
z = truth['TRUEZ']
fig, ax = plt.subplots(1,1, figsize=(6,4))
ax.scatter(z, r)
ax.set(xlabel='$z$', ylabel='$r$')
fig.tight_layout();
In [7]:
targets
Out[7]:
<Table length=100>
RELEASE BRICKID BRICKNAME OBJID TYPE RA DEC RA_IVAR DEC_IVAR DCHISQ [5] FLUX_G FLUX_R FLUX_Z FLUX_W1 FLUX_W2 FLUX_W3 FLUX_W4 FLUX_IVAR_G FLUX_IVAR_R FLUX_IVAR_Z FLUX_IVAR_W1 FLUX_IVAR_W2 FLUX_IVAR_W3 FLUX_IVAR_W4 MW_TRANSMISSION_G MW_TRANSMISSION_R MW_TRANSMISSION_Z MW_TRANSMISSION_W1 MW_TRANSMISSION_W2 MW_TRANSMISSION_W3 MW_TRANSMISSION_W4 NOBS_G NOBS_R NOBS_Z FRACFLUX_G FRACFLUX_R FRACFLUX_Z FRACMASKED_G FRACMASKED_R FRACMASKED_Z FRACIN_G FRACIN_R FRACIN_Z ALLMASK_G ALLMASK_R ALLMASK_Z WISEMASK_W1 WISEMASK_W2 PSFDEPTH_G PSFDEPTH_R PSFDEPTH_Z GALDEPTH_G GALDEPTH_R GALDEPTH_Z FRACDEV FRACDEV_IVAR SHAPEDEV_R SHAPEDEV_R_IVAR SHAPEDEV_E1 SHAPEDEV_E1_IVAR SHAPEDEV_E2 SHAPEDEV_E2_IVAR SHAPEEXP_R SHAPEEXP_R_IVAR SHAPEEXP_E1 SHAPEEXP_E1_IVAR SHAPEEXP_E2 SHAPEEXP_E2_IVAR FIBERFLUX_G FIBERFLUX_R FIBERFLUX_Z FIBERTOTFLUX_G FIBERTOTFLUX_R FIBERTOTFLUX_Z REF_CAT REF_ID GAIA_PHOT_G_MEAN_MAG GAIA_PHOT_G_MEAN_FLUX_OVER_ERROR GAIA_PHOT_BP_MEAN_MAG GAIA_PHOT_BP_MEAN_FLUX_OVER_ERROR GAIA_PHOT_RP_MEAN_MAG GAIA_PHOT_RP_MEAN_FLUX_OVER_ERROR GAIA_PHOT_BP_RP_EXCESS_FACTOR GAIA_ASTROMETRIC_SIGMA5D_MAX GAIA_ASTROMETRIC_PARAMS_SOLVED GAIA_ASTROMETRIC_EXCESS_NOISE GAIA_DUPLICATED_SOURCE PARALLAX PARALLAX_IVAR PMRA PMRA_IVAR PMDEC PMDEC_IVAR MASKBITS EBV PHOTSYS DESI_TARGET BGS_TARGET MWS_TARGET
deg deg 1 / deg2 1 / deg2 nanomaggies nanomaggies nanomaggies nanomaggies nanomaggies nanomaggies nanomaggies 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 1/nanomaggies**2 arcsec 1 / arcsec2 arcsec 1 / arcsec2
int16 int32 str8 int32 str4 float64 float64 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 int16 int16 int16 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 uint8 uint8 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 str2 int64 float32 float32 float32 float32 float32 float32 float32 float32 int64 float32 bool float32 float32 float32 float32 float32 float32 int16 float32 str1 int64 int64 int64
9999 348912 3161p030 122950001 DEV 316.1523742675781 2.996169328689575 100000000.0 100000000.0 0.0 .. 400.0 6.285332 13.130102 18.014805 17.51906 10.217433 0.0 0.0 1438.5999 329.56418 62.79716 0.76639146 0.30370852 0.0 0.0 0.7362965 0.8136631 0.89021164 0.98262733 0.9892948 0.9977072 0.99913365 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 1.0 0.0 2.2527204 4539.693 0.26029885 667224040000000.0 0.013814785 11969.285 0.0 0.0 0.0 0.0 0.0 0.0 0.9458975 2.0545819 2.946139 0.9458975 2.0545819 2.946139 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.10341264 S 0 0 0
9999 348915 3168p030 122950002 EXP 316.83343505859375 3.007141590118408 100000000.0 100000000.0 0.0 .. 400.0 8.9873295 21.720291 40.688442 51.426346 38.41325 0.0 0.0 1438.5999 329.56418 62.79716 0.76551706 0.30337155 0.0 0.0 0.7737394 0.84130925 0.90714574 0.98542166 0.99102163 0.99807835 0.99927396 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.3691101 35064.027 0.30522487 3585341800000000.0 0.39049596 74129.82 1.5335152 3.8094988 7.36468 1.5335152 3.8094988 7.36468 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08665627 S 0 0 0
9999 350353 3168p032 122950003 REX 316.69415283203125 3.139270782470703 100000000.0 100000000.0 0.0 .. 400.0 5.091034 9.340486 12.559835 10.0650625 4.730369 0.0 0.0 1438.5999 329.56418 62.79716 0.7662645 0.30365962 0.0 0.0 0.7675354 0.8367592 0.9043756 0.9849676 0.9907412 0.9980181 0.9992512 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.3377284 169316.8 0.0 0.0 0.0 0.0 2.62564 5.0703583 7.219431 2.62564 5.0703583 7.219431 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08937585 S 0 0 0
9999 348910 3156p030 122950004 REX 315.7365417480469 2.961479902267456 100000000.0 100000000.0 0.0 .. 400.0 7.0868835 12.308013 17.86563 18.979038 13.149493 0.0 0.0 1438.5999 329.56418 62.79716 0.7668059 0.30386823 0.0 0.0 0.7648226 0.83476585 0.9031599 0.984768 0.9906179 0.9979916 0.9992412 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5396752 52387.74 0.0 0.0 0.0 0.0 2.8977106 5.2632055 8.034735 2.8977106 5.2632055 8.034735 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.090571955 S 0 0 0
9999 350350 3160p032 122950005 REX 316.034423828125 3.1479761600494385 100000000.0 100000000.0 0.0 .. 400.0 3.4873087 8.583637 18.419758 41.615517 34.897198 0.0 0.0 1438.5999 329.56418 62.79716 0.76720256 0.30402106 0.0 0.0 0.6963177 0.7836329 0.87153023 0.9794918 0.987355 0.9972896 0.9989757 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.57957464 62183.285 0.0 0.0 0.0 0.0 1.3594973 3.4953115 7.877955 1.3594973 3.4953115 7.877955 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.12227176 S 0 0 0
9999 350352 3165p032 122950006 EXP 316.5281677246094 3.1505260467529297 100000000.0 100000000.0 0.0 .. 400.0 17.5355 30.590092 35.046154 30.467323 25.949299 0.0 0.0 1438.5999 329.56418 62.79716 0.76653886 0.30376533 0.0 0.0 0.77623403 0.8431355 0.90825576 0.9856033 0.9911338 0.9981024 0.9992831 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.9385298 111514.13 0.16799098 2.0947942e+18 0.22540268 479212.7 1.8917618 3.3719666 3.9602656 1.8917618 3.3719666 3.9602656 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08556887 S 0 0 0
9999 348913 3163p030 122950007 EXP 316.4424743652344 3.0266659259796143 100000000.0 100000000.0 0.0 .. 400.0 11.435003 19.761646 27.021074 26.712896 23.539806 0.0 0.0 1438.5999 329.56418 62.79716 0.7661283 0.30360714 0.0 0.0 0.76451015 0.8345362 0.9030197 0.9847449 0.9906036 0.9979885 0.99924004 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.6824149 10659.692 0.61413485 197292170000000.0 0.26754382 38836.383 1.4976622 2.6507254 3.7252913 1.4976622 2.6507254 3.7252913 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.09070997 S 0 0 0
9999 347474 3166p027 122950008 EXP 316.564697265625 2.8542842864990234 100000000.0 100000000.0 0.0 .. 400.0 3.4229398 9.5177355 15.590446 35.637173 21.91507 0.0 0.0 1438.5999 329.56418 62.79716 0.76523685 0.30326357 0.0 0.0 0.7828918 0.84800005 0.91120744 0.9860853 0.9914315 0.9981664 0.9993072 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.2217414 28707.924 0.20849869 2741240300000000.0 0.10904133 34746.426 0.66887695 1.915728 3.245992 0.66887695 1.915728 3.245992 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08268376 S 0 0 0
9999 348913 3163p030 122950009 REX 316.442138671875 2.884831666946411 100000000.0 100000000.0 0.0 .. 400.0 4.7777104 8.806635 12.286938 10.296636 7.725024 0.0 0.0 1438.5999 329.56418 62.79716 0.76552945 0.30337632 0.0 0.0 0.7793465 0.84541136 0.90963763 0.9858291 0.9912733 0.9981324 0.9992944 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.39460093 130255.766 0.0 0.0 0.0 0.0 2.3119097 4.477014 6.6010075 2.3119097 4.477014 6.6010075 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08421701 S 0 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
9999 348914 3166p030 122950091 DEV 316.587646484375 2.9565248489379883 100000000.0 100000000.0 0.0 .. 400.0 39.914177 61.99608 94.36916 89.009514 65.55663 0.0 0.0 1438.5999 329.56418 62.79716 0.7656356 0.30341724 0.0 0.0 0.7759404 0.84292066 0.9081253 0.98558193 0.99112064 0.9980996 0.999282 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 1.0 0.0 50.778183 4.076674 0.0064656152 79916320000000.0 0.42449227 6232.231 0.0 0.0 0.0 0.0 0.0 0.0 1.9957088 3.099804 4.718458 1.9957088 3.099804 4.718458 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08569665 S 0 0 0
9999 348911 3158p030 122950092 DEV 315.8100891113281 3.014225482940674 100000000.0 100000000.0 0.0 .. 400.0 9.442765 16.955393 28.904829 35.504772 24.632147 0.0 0.0 1438.5999 329.56418 62.79716 0.76693267 0.30391705 0.0 0.0 0.7429734 0.8186261 0.89326984 0.9831353 0.9896089 0.9977747 0.99915916 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 1.0 0.0 1.2510027 32735.729 0.0062905154 8.7176945e+18 0.024263553 36455.293 0.0 0.0 0.0 0.0 0.0 0.0 2.1959229 4.1160493 7.364882 2.1959229 4.1160493 7.364882 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.10036307 S 0 0 0
9999 348913 3163p030 122950093 DEV 316.4068298339844 2.968167781829834 100000000.0 100000000.0 0.0 .. 400.0 14.123852 30.290215 48.410706 45.6958 31.475048 0.0 0.0 1438.5999 329.56418 62.79716 0.7659286 0.30353016 0.0 0.0 0.76351774 0.8338063 0.90257424 0.9846717 0.9905584 0.9979788 0.99923635 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 1.0 0.0 1.9266539 39178.94 -0.043268725 4.6311996e+18 0.0028002872 1503613.6 0.0 0.0 0.0 0.0 0.0 0.0 2.4283466 5.4215183 9.06763 2.4283466 5.4215183 9.06763 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.091148786 S 0 0 0
9999 348915 3168p030 122950094 REX 316.9741516113281 2.9544930458068848 100000000.0 100000000.0 0.0 .. 400.0 10.611111 20.95082 31.262861 36.302418 26.552885 0.0 0.0 1438.5999 329.56418 62.79716 0.7651067 0.30321342 0.0 0.0 0.78080076 0.84647363 0.9102821 0.9859343 0.99133825 0.99814636 0.99929965 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.2016236 30821.303 0.0 0.0 0.0 0.0 2.1116228 4.2956653 6.632546 2.1116228 4.2956653 6.632546 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.083587244 S 0 0 0
9999 347473 3163p027 122950095 DEV 316.3717956542969 2.799359083175659 100000000.0 100000000.0 0.0 .. 400.0 4.1053476 15.315883 32.62384 49.618835 37.02061 0.0 0.0 1438.5999 329.56418 62.79716 0.7652646 0.30327427 0.0 0.0 0.7899333 0.8531303 0.9143123 0.98659086 0.9917436 0.9982334 0.99933255 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 1.0 0.0 0.8094837 53882.145 0.16384102 3176630000000000.0 0.09753125 37813.387 0.0 0.0 0.0 0.0 0.0 0.0 1.236492 4.8283434 10.825783 1.236492 4.8283434 10.825783 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.079658955 S 0 0 0
9999 348913 3163p030 122950096 REX 316.4466247558594 3.0077035427093506 100000000.0 100000000.0 0.0 .. 400.0 11.180186 16.35903 22.621618 15.321023 14.420046 0.0 0.0 1438.5999 329.56418 62.79716 0.7660423 0.30357397 0.0 0.0 0.7653294 0.8351385 0.90338725 0.9848053 0.99064094 0.99799657 0.999243 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.412502 271260.4 0.0 0.0 0.0 0.0 5.302083 8.145961 11.897105 5.302083 8.145961 11.897105 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.09034816 S 0 0 0
9999 348916 3171p030 122950097 REX 317.0958251953125 2.9794046878814697 100000000.0 100000000.0 0.0 .. 400.0 2.8628452 10.8479185 19.559298 36.448734 31.171446 0.0 0.0 1438.5999 329.56418 62.79716 0.765047 0.3031904 0.0 0.0 0.7874034 0.85128874 0.91319877 0.9864097 0.99163175 0.99820936 0.9993235 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.9846502 39336.387 0.0 0.0 0.0 0.0 0.7084064 2.7762833 5.2014093 0.7084064 2.7762833 5.2014093 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.08074262 S 0 0 0
9999 350353 3168p032 122950098 EXP 316.72039794921875 3.2825276851654053 100000000.0 100000000.0 0.0 .. 400.0 7.4512835 14.455457 23.138222 26.894514 20.472746 0.0 0.0 1438.5999 329.56418 62.79716 0.7668398 0.3038813 0.0 0.0 0.7468999 0.8215379 0.89506036 0.983432 0.9897923 0.9978142 0.99917406 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.7957906 14877.221 0.033508454 3.400451e+16 0.12443674 70225.08 0.8931184 1.7725348 2.9125378 0.8931184 1.7725348 2.9125378 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.098582454 S 0 0 0
9999 347473 3163p027 122950099 DEV 316.3603515625 2.7383956909179688 100000000.0 100000000.0 0.0 .. 400.0 32.547592 44.42431 50.16973 39.943626 30.014486 0.0 0.0 1438.5999 329.56418 62.79716 0.7650247 0.30318183 0.0 0.0 0.79560834 0.857254 0.91680217 0.9869953 0.99199325 0.99828696 0.9993528 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 1.0 0.0 2.2384312 35845.254 0.06358366 2.455279e+18 0.057227373 184377.39 0.0 0.0 0.0 0.0 0.0 0.0 4.9287596 6.995277 8.257004 4.9287596 6.995277 8.257004 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.07724071 S 0 0 0
9999 346034 3166p025 122950100 REX 316.617431640625 2.5801117420196533 100000000.0 100000000.0 0.0 .. 400.0 4.305484 11.633435 16.266111 27.122734 22.521572 0.0 0.0 1438.5999 329.56418 62.79716 0.76402825 0.3027978 0.0 0.0 0.7963428 0.857787 0.9171236 0.98704743 0.99202543 0.9982939 0.99935544 2 2 2 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0 0 0 52.480747 7.7268057 1.8706821 57.543995 13.182568 2.5118864 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.25987935 347452.53 0.0 0.0 0.0 0.0 2.4081693 6.863938 10.18622 2.4081693 6.863938 10.18622 -1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0.0 False 0.0 1.0 0.0 1.0 0.0 1.0 0 0.07692902 S 0 0 0
In [8]:
objtr
Out[8]:
<Table length=100>
TARGETID OIIFLUX HBETAFLUX EWOII EWHBETA D4000 VDISP OIIDOUBLET OIIIHBETA OIIHBETA NIIHBETA SIIHBETA TRANSIENT_MODEL TRANSIENT_TYPE TRANSIENT_EPOCH TRANSIENT_RFLUXRATIO TRUEZ_NORSD
erg / (cm2 s) erg / (cm2 s) Angstrom Angstrom km / s Dex Dex Dex Dex d
int64 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 str20 str10 float32 float32 float32
122950001 -1.0 8.870828e-17 -1.0 3.5195003 1.3070124 87.681656 0.77882457 0.6299224 0.28130755 -0.97576165 -0.4656399 hsiao Ia 4.0 0.8160281 0.0
122950002 -1.0 0.0 -1.0 0.0 1.6933385 79.602806 0.74148506 0.5645636 0.20991385 -1.1360153 -0.6713571 hsiao Ia -4.0 0.4140573 0.0
122950003 -1.0 9.889676e-17 -1.0 3.7780135 1.2662714 79.602806 0.66710335 0.24323988 0.37400806 -0.34835115 -0.17972317 hsiao Ia 7.0 0.22954988 0.0
122950004 -1.0 1.0823011e-16 -1.0 4.883233 1.3889332 87.681656 0.692422 -0.6361045 0.0983756 -0.23645414 -0.39118406 hsiao Ia -5.0 0.95765936 0.0
122950005 -1.0 5.307847e-17 -1.0 2.6511593 1.402579 87.681656 0.7592538 -0.007215936 0.21859567 -0.0012534182 -0.21264657 hsiao Ia 12.0 0.29456013 0.0
122950006 -1.0 2.5055094e-16 -1.0 4.3570123 1.2503612 84.321754 0.65273345 0.7745344 0.15142019 -0.8983938 -0.6740899 hsiao Ia 6.0 0.7841913 0.0
122950007 -1.0 1.9854571e-16 -1.0 4.1021285 1.2479023 84.321754 0.66456985 0.5769597 0.17034702 -1.0902989 -0.4393439 hsiao Ia -12.0 0.3901421 0.0
122950008 -1.0 1.04032904e-16 -1.0 5.4172015 1.1802052 79.602806 0.7298952 -0.30444324 0.6692825 0.011213212 -0.044433285 hsiao Ia -6.0 0.8717522 0.0
122950009 -1.0 0.0 -1.0 0.0 1.7374407 70.58511 0.7411435 0.28199553 0.46205333 -0.49219698 -0.33044997 hsiao Ia 2.0 0.66008055 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
122950091 -1.0 1.9279406e-16 -1.0 1.68705 1.6018229 67.84319 0.7523352 0.039326947 0.3813936 -0.11169975 -0.08833691 hsiao Ia -13.0 0.7738959 0.0
122950092 -1.0 0.0 -1.0 0.0 1.5484437 62.92012 0.7588735 -0.68904316 0.5103526 -0.087232135 -0.06413947 hsiao Ia -13.0 0.7626922 0.0
122950093 -1.0 0.0 -1.0 0.0 1.6439546 67.80345 0.75702304 0.38619676 0.5784496 -0.42178124 -0.22919591 hsiao Ia 11.0 0.31922385 0.0
122950094 -1.0 1.7652288e-16 -1.0 4.036331 1.536446 67.84319 0.679125 0.98035294 -0.2831387 -1.4538585 -0.90769523 hsiao Ia 3.0 0.48960584 0.0
122950095 -1.0 0.0 -1.0 0.0 1.9248911 67.80345 0.7810222 0.63591516 0.19622882 -0.9661813 -0.51082635 hsiao Ia 7.0 0.30324972 0.0
122950096 -1.0 0.0 -1.0 0.0 1.8510376 67.84319 0.69747615 0.9095344 0.2406731 -0.77056324 -0.54578745 hsiao Ia -8.0 0.90315837 0.0
122950097 -1.0 1.6093957e-16 -1.0 6.9943027 1.3616737 67.84319 0.69002473 -0.03188833 0.4611288 -0.0999768 -0.33187115 hsiao Ia 9.0 0.759215 0.0
122950098 -1.0 0.0 -1.0 0.0 1.642101 71.84691 0.712823 0.72505534 0.13574758 -1.3457509 -0.64145803 hsiao Ia 0.0 0.66181177 0.0
122950099 -1.0 6.033641e-16 -1.0 7.312999 1.2528051 67.80345 0.65720767 0.048350357 0.4058268 -0.14150938 -0.11031354 hsiao Ia 3.0 0.91931665 0.0
122950100 -1.0 4.1460976e-16 -1.0 19.40933 1.1534513 67.80345 0.6933926 0.66728795 0.13687317 -1.0905042 -0.48161605 hsiao Ia 0.0 0.6876737 0.0
In [9]:
fig, axes = plt.subplots(1,2, figsize=(9,4), sharey=True)
ax = axes[0]
n, bins, patches = ax.hist(objtr['TRANSIENT_EPOCH'], bins=10, color='k', alpha=0.3)
x = 0.5*(bins[1:] + bins[:-1])
dx = 0.5*np.diff(bins)
ax.errorbar(x, n, xerr=dx, yerr=np.sqrt(n), fmt=',', color='k')
ax.set(xlabel='epoch [day]', ylabel='count')
ax = axes[1]
n, bins, patches = ax.hist(objtr['TRANSIENT_RFLUXRATIO'], bins=10, color='k', alpha=0.3)
x = 0.5*(bins[1:] + bins[:-1])
dx = 0.5*np.diff(bins)
ax.errorbar(x, n, xerr=dx, yerr=np.sqrt(n), fmt=',', color='k')
ax.set(xlabel=r'$r_\mathrm{trans}/r_\mathrm{host}$')
fig.tight_layout();
In [10]:
for i in range(10):
plt.plot(wave, flux[i])
The spectra generated under observing conditions are stored in a single file. A FIBERMAP
table provides a summary of target data for each object, and individual wavelength, flux, variance, resolution, and mask tables are present for each camera.
The data are best accessed using the read_spectra
function from desispec, which packs everything into a single object.
In [11]:
spectra = read_spectra(spect_file)
hdus = fits.open(spect_file)
hdus.info()
Filename: ../../bgs_2020-03-08_0300s_001_spect.fits
No. Name Ver Type Cards Dimensions Format
0 PRIMARY 1 PrimaryHDU 50 ()
1 FIBERMAP 1 BinTableHDU 164 100R x 76C [K, K, K, K, K, D, D, D, D, K, K, 4A, J, D, K, E, E, E, E, E, I, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, 1A, J, K, K, J, K, J, J, J, J, J, 3A, E, E, E, K, B, I, D, D, E, E, E, E, E, E, J, J, J, J, J]
2 B_WAVELENGTH 1 ImageHDU 10 (2380,) float64
3 B_FLUX 1 ImageHDU 11 (2380, 100) float32
4 B_IVAR 1 ImageHDU 11 (2380, 100) float32
5 B_MASK 1 ImageHDU 12 (2380, 100) int32 (rescales to uint32)
6 B_RESOLUTION 1 ImageHDU 11 (2380, 9, 100) float32
7 R_WAVELENGTH 1 ImageHDU 10 (2116,) float64
8 R_FLUX 1 ImageHDU 11 (2116, 100) float32
9 R_IVAR 1 ImageHDU 11 (2116, 100) float32
10 R_MASK 1 ImageHDU 12 (2116, 100) int32 (rescales to uint32)
11 R_RESOLUTION 1 ImageHDU 11 (2116, 9, 100) float32
12 Z_WAVELENGTH 1 ImageHDU 10 (2399,) float64
13 Z_FLUX 1 ImageHDU 11 (2399, 100) float32
14 Z_IVAR 1 ImageHDU 11 (2399, 100) float32
15 Z_MASK 1 ImageHDU 12 (2399, 100) int32 (rescales to uint32)
16 Z_RESOLUTION 1 ImageHDU 11 (2399, 11, 100) float32
In [12]:
spectra.fibermap
Out[12]:
<Table length=100>
TARGETID DESI_TARGET BGS_TARGET MWS_TARGET SECONDARY_TARGET TARGET_RA TARGET_DEC TARGET_RA_IVAR TARGET_DEC_IVAR BRICKID BRICK_OBJID MORPHTYPE PRIORITY SUBPRIORITY REF_ID PMRA PMDEC REF_EPOCH PMRA_IVAR PMDEC_IVAR RELEASE FLUX_G FLUX_R FLUX_Z FLUX_W1 FLUX_W2 FLUX_IVAR_G FLUX_IVAR_R FLUX_IVAR_Z FLUX_IVAR_W1 FLUX_IVAR_W2 FIBERFLUX_G FIBERFLUX_R FIBERFLUX_Z FIBERFLUX_W1 FIBERFLUX_W2 FIBERTOTFLUX_G FIBERTOTFLUX_R FIBERTOTFLUX_Z FIBERTOTFLUX_W1 FIBERTOTFLUX_W2 MW_TRANSMISSION_G MW_TRANSMISSION_R MW_TRANSMISSION_Z EBV PHOTSYS OBSCONDITIONS NUMOBS_INIT PRIORITY_INIT NUMOBS_MORE HPXPIXEL FIBER PETAL_LOC DEVICE_LOC LOCATION FIBERSTATUS OBJTYPE LAMBDA_REF FIBERASSIGN_X FIBERASSIGN_Y FA_TARGET FA_TYPE NUMTARGET FIBER_RA FIBER_DEC FIBER_RA_IVAR FIBER_DEC_IVAR PLATEMAKER_X PLATEMAKER_Y PLATEMAKER_RA PLATEMAKER_DEC NUM_ITER SPECTROID NIGHT EXPID TILEID
int64 int64 int64 int64 int64 float64 float64 float64 float64 int64 int64 bytes4 int32 float64 int64 float32 float32 float32 float32 float32 int16 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 bytes1 int32 int64 int64 int32 int64 int32 int32 int32 int32 int32 bytes3 float32 float32 float32 int64 uint8 int16 float64 float64 float32 float32 float32 float32 float32 float32 int32 int32 int32 int32 int32
122950001 1152921504606846976 0 0 0 316.1523742675781 2.996169328689575 0.0 0.0 348912 122950001 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 6.285332 13.130102 18.014805 17.51906 10.217433 1438.5999 329.56418 62.79716 0.76639146 0.30370852 0.9458975 2.0545819 2.946139 0.0 0.0 0.9458975 2.0545819 2.946139 0.0 0.0 0.7362965 0.8136631 0.89021164 0.10341264 S 0 0 0 0 0 0 0 311 311 0 5400.0 83.21898 -286.66373 0 0 0 316.1523742675781 2.996169328689575 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950002 1152921504606846976 0 0 0 316.83343505859375 3.007141590118408 0.0 0.0 348915 122950002 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 8.9873295 21.720291 40.688442 51.426346 38.41325 1438.5999 329.56418 62.79716 0.76551706 0.30337155 1.5335152 3.8094988 7.36468 0.0 0.0 1.5335152 3.8094988 7.36468 0.0 0.0 0.7737394 0.84130925 0.90714574 0.08665627 S 0 0 0 0 0 1 0 272 272 0 5400.0 59.109577 -273.27396 0 0 0 316.83343505859375 3.007141590118408 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950003 1152921504606846976 0 0 0 316.69415283203125 3.139270782470703 0.0 0.0 350353 122950003 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 5.091034 9.340486 12.559835 10.0650625 4.730369 1438.5999 329.56418 62.79716 0.7662645 0.30365962 2.62564 5.0703583 7.219431 0.0 0.0 2.62564 5.0703583 7.219431 0.0 0.0 0.7675354 0.8367592 0.9043756 0.08937585 S 0 0 0 0 0 2 0 252 252 0 5400.0 31.751867 -269.80435 0 0 0 316.69415283203125 3.139270782470703 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950004 1152921504606846976 0 0 0 315.7365417480469 2.961479902267456 0.0 0.0 348910 122950004 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 7.0868835 12.308013 17.86563 18.979038 13.149493 1438.5999 329.56418 62.79716 0.7668059 0.30386823 2.8977106 5.2632055 8.034735 0.0 0.0 2.8977106 5.2632055 8.034735 0.0 0.0 0.7648226 0.83476585 0.9031599 0.090571955 S 0 0 0 0 0 3 0 156 156 0 5400.0 0.18432418 -221.17873 0 0 0 315.7365417480469 2.961479902267456 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950005 1152921504606846976 0 0 0 316.034423828125 3.1479761600494385 0.0 0.0 350350 122950005 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 3.4873087 8.583637 18.419758 41.615517 34.897198 1438.5999 329.56418 62.79716 0.76720256 0.30402106 1.3594973 3.4953115 7.877955 0.0 0.0 1.3594973 3.4953115 7.877955 0.0 0.0 0.6963177 0.7836329 0.87153023 0.12227176 S 0 0 0 0 0 4 0 198 198 0 5400.0 -19.776659 -253.03535 0 0 0 316.034423828125 3.1479761600494385 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950006 1152921504606846976 0 0 0 316.5281677246094 3.1505260467529297 0.0 0.0 350352 122950006 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 17.5355 30.590092 35.046154 30.467323 25.949299 1438.5999 329.56418 62.79716 0.76653886 0.30376533 1.8917618 3.3719666 3.9602656 0.0 0.0 1.8917618 3.3719666 3.9602656 0.0 0.0 0.77623403 0.8431355 0.90825576 0.08556887 S 0 0 0 0 0 5 0 204 204 0 5400.0 41.488995 -240.11723 0 0 0 316.5281677246094 3.1505260467529297 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950007 1152921504606846976 0 0 0 316.4424743652344 3.0266659259796143 0.0 0.0 348913 122950007 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 11.435003 19.761646 27.021074 26.712896 23.539806 1438.5999 329.56418 62.79716 0.7661283 0.30360714 1.4976622 2.6507254 3.7252913 0.0 0.0 1.4976622 2.6507254 3.7252913 0.0 0.0 0.76451015 0.8345362 0.9030197 0.09070997 S 0 0 0 0 0 6 0 233 233 0 5400.0 14.601016 -264.20517 0 0 0 316.4424743652344 3.0266659259796143 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950008 1152921504606846976 0 0 0 316.564697265625 2.8542842864990234 0.0 0.0 347474 122950008 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 3.4229398 9.5177355 15.590446 35.637173 21.91507 1438.5999 329.56418 62.79716 0.76523685 0.30326357 0.66887695 1.915728 3.245992 0.0 0.0 0.66887695 1.915728 3.245992 0.0 0.0 0.7828918 0.84800005 0.91120744 0.08268376 S 0 0 0 0 0 7 0 172 172 0 5400.0 17.358227 -226.7752 0 0 0 316.564697265625 2.8542842864990234 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950009 1152921504606846976 0 0 0 316.442138671875 2.884831666946411 0.0 0.0 348913 122950009 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 4.7777104 8.806635 12.286938 10.296636 7.725024 1438.5999 329.56418 62.79716 0.76552945 0.30337632 2.3119097 4.477014 6.6010075 0.0 0.0 2.3119097 4.477014 6.6010075 0.0 0.0 0.7793465 0.84541136 0.90963763 0.08421701 S 0 0 0 0 0 8 0 310 310 0 5400.0 73.0176 -288.79773 0 0 0 316.442138671875 2.884831666946411 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950010 1152921504606846976 0 0 0 316.5118713378906 2.933967113494873 0.0 0.0 348914 122950010 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 6.3741465 16.333185 22.807755 30.308369 22.593151 1438.5999 329.56418 62.79716 0.7656426 0.30341995 1.1437836 3.014823 4.348249 0.0 0.0 1.1437836 3.014823 4.348249 0.0 0.0 0.7757973 0.84281594 0.9080616 0.08575897 S 0 0 0 0 0 9 0 290 290 0 5400.0 55.85053 -283.17615 0 0 0 316.5118713378906 2.933967113494873 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
122950091 1152921504606846976 0 0 0 316.587646484375 2.9565248489379883 0.0 0.0 348914 122950091 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 39.914177 61.99608 94.36916 89.009514 65.55663 1438.5999 329.56418 62.79716 0.7656356 0.30341724 1.9957088 3.099804 4.718458 0.0 0.0 1.9957088 3.099804 4.718458 0.0 0.0 0.7759404 0.84292066 0.9081253 0.08569665 S 0 0 0 0 0 90 0 269 269 0 5400.0 28.508 -279.7112 0 0 0 316.587646484375 2.9565248489379883 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950092 1152921504606846976 0 0 0 315.8100891113281 3.014225482940674 0.0 0.0 348911 122950092 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 9.442765 16.955393 28.904829 35.504772 24.632147 1438.5999 329.56418 62.79716 0.76693267 0.30391705 2.1959229 4.1160493 7.364882 0.0 0.0 2.1959229 4.1160493 7.364882 0.0 0.0 0.7429734 0.8186261 0.89326984 0.10036307 S 0 0 0 0 0 91 0 246 246 0 5400.0 -29.461878 -282.7649 0 0 0 315.8100891113281 3.014225482940674 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950093 1152921504606846976 0 0 0 316.4068298339844 2.968167781829834 0.0 0.0 348913 122950093 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 14.123852 30.290215 48.410706 45.6958 31.475048 1438.5999 329.56418 62.79716 0.7659286 0.30353016 2.4283466 5.4215183 9.06763 0.0 0.0 2.4283466 5.4215183 9.06763 0.0 0.0 0.76351774 0.8338063 0.90257424 0.091148786 S 0 0 0 0 0 92 0 345 345 0 5400.0 25.688492 -317.2147 0 0 0 316.4068298339844 2.968167781829834 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950094 1152921504606846976 0 0 0 316.9741516113281 2.9544930458068848 0.0 0.0 348915 122950094 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 10.611111 20.95082 31.262861 36.302418 26.552885 1438.5999 329.56418 62.79716 0.7651067 0.30321342 2.1116228 4.2956653 6.632546 0.0 0.0 2.1116228 4.2956653 6.632546 0.0 0.0 0.78080076 0.84647363 0.9102821 0.083587244 S 0 0 0 0 0 93 0 302 302 0 5400.0 -8.5949 -305.9973 0 0 0 316.9741516113281 2.9544930458068848 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950095 1152921504606846976 0 0 0 316.3717956542969 2.799359083175659 0.0 0.0 347473 122950095 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 4.1053476 15.315883 32.62384 49.618835 37.02061 1438.5999 329.56418 62.79716 0.7652646 0.30327427 1.236492 4.8283434 10.825783 0.0 0.0 1.236492 4.8283434 10.825783 0.0 0.0 0.7899333 0.8531303 0.9143123 0.079658955 S 0 0 0 0 0 94 0 367 367 0 5400.0 42.842823 -322.85312 0 0 0 316.3717956542969 2.799359083175659 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950096 1152921504606846976 0 0 0 316.4466247558594 3.0077035427093506 0.0 0.0 348913 122950096 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 11.180186 16.35903 22.621618 15.321023 14.420046 1438.5999 329.56418 62.79716 0.7660423 0.30357397 5.302083 8.145961 11.897105 0.0 0.0 5.302083 8.145961 11.897105 0.0 0.0 0.7653294 0.8351385 0.90338725 0.09034816 S 0 0 0 0 0 95 0 388 388 0 5400.0 39.591503 -332.79407 0 0 0 316.4466247558594 3.0077035427093506 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950097 1152921504606846976 0 0 0 317.0958251953125 2.9794046878814697 0.0 0.0 348916 122950097 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 2.8628452 10.8479185 19.559298 36.448734 31.171446 1438.5999 329.56418 62.79716 0.765047 0.3031904 0.7084064 2.7762833 5.2014093 0.0 0.0 0.7084064 2.7762833 5.2014093 0.0 0.0 0.7874034 0.85128874 0.91319877 0.08074262 S 0 0 0 0 0 96 0 265 265 0 5400.0 -12.30921 -288.31976 0 0 0 317.0958251953125 2.9794046878814697 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950098 1152921504606846976 0 0 0 316.72039794921875 3.2825276851654053 0.0 0.0 350353 122950098 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 7.4512835 14.455457 23.138222 26.894514 20.472746 1438.5999 329.56418 62.79716 0.7668398 0.3038813 0.8931184 1.7725348 2.9125378 0.0 0.0 0.8931184 1.7725348 2.9125378 0.0 0.0 0.7468999 0.8215379 0.89506036 0.098582454 S 0 0 0 0 0 97 0 248 248 0 5400.0 -9.055862 -278.4183 0 0 0 316.72039794921875 3.2825276851654053 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950099 1152921504606846976 0 0 0 316.3603515625 2.7383956909179688 0.0 0.0 347473 122950099 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 32.547592 44.42431 50.16973 39.943626 30.014486 1438.5999 329.56418 62.79716 0.7650247 0.30318183 4.9287596 6.995277 8.257004 0.0 0.0 4.9287596 6.995277 8.257004 0.0 0.0 0.79560834 0.857254 0.91680217 0.07724071 S 0 0 0 0 0 98 0 308 308 0 5400.0 52.594242 -293.08817 0 0 0 316.3603515625 2.7383956909179688 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
122950100 1152921504606846976 0 0 0 316.617431640625 2.5801117420196533 0.0 0.0 346034 122950100 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 4.305484 11.633435 16.266111 27.122734 22.521572 1438.5999 329.56418 62.79716 0.76402825 0.3027978 2.4081693 6.863938 10.18622 0.0 0.0 2.4081693 6.863938 10.18622 0.0 0.0 0.7963428 0.857787 0.9171236 0.07692902 S 0 0 0 0 0 99 0 285 285 0 5400.0 4.852069 -293.90848 0 0 0 316.617431640625 2.5801117420196533 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0
The coadds are generated using the desi_coadd_spectra
program available in desispec. For example, to add data across the cameras run
desi_coadd_spectra -i bgs_2020-03-08_0150s_001_spect.fits -o bgs_2020-03-08_0150s_001_coadd.fits --coadd-cameras
The data can then be accessed using the read_spectra
function.
In [13]:
coadds = read_spectra(coadd_file)
hdus = fits.open(coadd_file)
hdus.info()
Filename: ../../bgs_2020-03-08_0300s_001_coadd.fits
No. Name Ver Type Cards Dimensions Format
0 PRIMARY 1 PrimaryHDU 52 ()
1 FIBERMAP 1 BinTableHDU 196 100R x 92C [K, K, K, K, K, D, D, D, D, K, K, 4A, J, D, K, E, E, E, E, E, I, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, 1A, J, K, K, J, K, J, J, J, J, J, 3A, E, E, E, K, B, I, D, D, E, E, E, E, E, E, J, J, J, J, J, I, K, K, K, K, K, K, K, K, K, K, K, K, K, K, K]
2 BRZ_WAVELENGTH 1 ImageHDU 10 (6265,) float64
3 BRZ_FLUX 1 ImageHDU 11 (6265, 100) float32
4 BRZ_IVAR 1 ImageHDU 11 (6265, 100) float32
5 BRZ_MASK 1 ImageHDU 12 (6265, 100) int32 (rescales to uint32)
6 BRZ_RESOLUTION 1 ImageHDU 11 (6265, 11, 100) float32
7 SCORES 1 BinTableHDU 30 100R x 9C [D, D, D, D, D, D, D, D, D]
In [14]:
coadds.fibermap
Out[14]:
<Table length=100>
TARGETID DESI_TARGET BGS_TARGET MWS_TARGET SECONDARY_TARGET TARGET_RA TARGET_DEC TARGET_RA_IVAR TARGET_DEC_IVAR BRICKID BRICK_OBJID MORPHTYPE PRIORITY SUBPRIORITY REF_ID PMRA PMDEC REF_EPOCH PMRA_IVAR PMDEC_IVAR RELEASE FLUX_G FLUX_R FLUX_Z FLUX_W1 FLUX_W2 FLUX_IVAR_G FLUX_IVAR_R FLUX_IVAR_Z FLUX_IVAR_W1 FLUX_IVAR_W2 FIBERFLUX_G FIBERFLUX_R FIBERFLUX_Z FIBERFLUX_W1 FIBERFLUX_W2 FIBERTOTFLUX_G FIBERTOTFLUX_R FIBERTOTFLUX_Z FIBERTOTFLUX_W1 FIBERTOTFLUX_W2 MW_TRANSMISSION_G MW_TRANSMISSION_R MW_TRANSMISSION_Z EBV PHOTSYS OBSCONDITIONS NUMOBS_INIT PRIORITY_INIT NUMOBS_MORE HPXPIXEL FIBER PETAL_LOC DEVICE_LOC LOCATION FIBERSTATUS OBJTYPE LAMBDA_REF FIBERASSIGN_X FIBERASSIGN_Y FA_TARGET FA_TYPE NUMTARGET FIBER_RA FIBER_DEC FIBER_RA_IVAR FIBER_DEC_IVAR PLATEMAKER_X PLATEMAKER_Y PLATEMAKER_RA PLATEMAKER_DEC NUM_ITER SPECTROID NIGHT EXPID TILEID COADD_NUMEXP FIRST_NIGHT LAST_NIGHT NUM_NIGHT FIRST_EXPID LAST_EXPID NUM_EXPID FIRST_TILEID LAST_TILEID NUM_TILEID FIRST_SPECTROID LAST_SPECTROID NUM_SPECTROID FIRST_FIBER LAST_FIBER NUM_FIBER
int64 int64 int64 int64 int64 float64 float64 float64 float64 int64 int64 bytes4 int32 float64 int64 float32 float32 float32 float32 float32 int16 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 float32 bytes1 int32 int64 int64 int32 int64 int32 int32 int32 int32 int32 bytes3 float32 float32 float32 int64 uint8 int16 float64 float64 float32 float32 float32 float32 float32 float32 int32 int32 int32 int32 int32 int16 int64 int64 int64 int64 int64 int64 int64 int64 int64 int64 int64 int64 int64 int64 int64
122950001 1152921504606846976 0 0 0 316.1523742675781 2.996169328689575 0.0 0.0 348912 122950001 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 6.285332 13.130102 18.014805 17.51906 10.217433 1438.5999 329.56418 62.79716 0.76639146 0.30370852 0.9458975 2.0545819 2.946139 0.0 0.0 0.9458975 2.0545819 2.946139 0.0 0.0 0.7362965 0.8136631 0.89021164 0.10341264 S 0 0 0 0 0 0 0 311 311 0 5400.0 83.21898 -286.66373 0 0 0 316.1523742675781 2.996169328689575 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 0 0 1
122950002 1152921504606846976 0 0 0 316.83343505859375 3.007141590118408 0.0 0.0 348915 122950002 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 8.9873295 21.720291 40.688442 51.426346 38.41325 1438.5999 329.56418 62.79716 0.76551706 0.30337155 1.5335152 3.8094988 7.36468 0.0 0.0 1.5335152 3.8094988 7.36468 0.0 0.0 0.7737394 0.84130925 0.90714574 0.08665627 S 0 0 0 0 0 1 0 272 272 0 5400.0 59.109577 -273.27396 0 0 0 316.83343505859375 3.007141590118408 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 1 1 1
122950003 1152921504606846976 0 0 0 316.69415283203125 3.139270782470703 0.0 0.0 350353 122950003 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 5.091034 9.340486 12.559835 10.0650625 4.730369 1438.5999 329.56418 62.79716 0.7662645 0.30365962 2.62564 5.0703583 7.219431 0.0 0.0 2.62564 5.0703583 7.219431 0.0 0.0 0.7675354 0.8367592 0.9043756 0.08937585 S 0 0 0 0 0 2 0 252 252 0 5400.0 31.751867 -269.80435 0 0 0 316.69415283203125 3.139270782470703 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 2 2 1
122950004 1152921504606846976 0 0 0 315.7365417480469 2.961479902267456 0.0 0.0 348910 122950004 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 7.0868835 12.308013 17.86563 18.979038 13.149493 1438.5999 329.56418 62.79716 0.7668059 0.30386823 2.8977106 5.2632055 8.034735 0.0 0.0 2.8977106 5.2632055 8.034735 0.0 0.0 0.7648226 0.83476585 0.9031599 0.090571955 S 0 0 0 0 0 3 0 156 156 0 5400.0 0.18432418 -221.17873 0 0 0 315.7365417480469 2.961479902267456 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 3 3 1
122950005 1152921504606846976 0 0 0 316.034423828125 3.1479761600494385 0.0 0.0 350350 122950005 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 3.4873087 8.583637 18.419758 41.615517 34.897198 1438.5999 329.56418 62.79716 0.76720256 0.30402106 1.3594973 3.4953115 7.877955 0.0 0.0 1.3594973 3.4953115 7.877955 0.0 0.0 0.6963177 0.7836329 0.87153023 0.12227176 S 0 0 0 0 0 4 0 198 198 0 5400.0 -19.776659 -253.03535 0 0 0 316.034423828125 3.1479761600494385 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 4 4 1
122950006 1152921504606846976 0 0 0 316.5281677246094 3.1505260467529297 0.0 0.0 350352 122950006 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 17.5355 30.590092 35.046154 30.467323 25.949299 1438.5999 329.56418 62.79716 0.76653886 0.30376533 1.8917618 3.3719666 3.9602656 0.0 0.0 1.8917618 3.3719666 3.9602656 0.0 0.0 0.77623403 0.8431355 0.90825576 0.08556887 S 0 0 0 0 0 5 0 204 204 0 5400.0 41.488995 -240.11723 0 0 0 316.5281677246094 3.1505260467529297 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 5 5 1
122950007 1152921504606846976 0 0 0 316.4424743652344 3.0266659259796143 0.0 0.0 348913 122950007 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 11.435003 19.761646 27.021074 26.712896 23.539806 1438.5999 329.56418 62.79716 0.7661283 0.30360714 1.4976622 2.6507254 3.7252913 0.0 0.0 1.4976622 2.6507254 3.7252913 0.0 0.0 0.76451015 0.8345362 0.9030197 0.09070997 S 0 0 0 0 0 6 0 233 233 0 5400.0 14.601016 -264.20517 0 0 0 316.4424743652344 3.0266659259796143 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 6 6 1
122950008 1152921504606846976 0 0 0 316.564697265625 2.8542842864990234 0.0 0.0 347474 122950008 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 3.4229398 9.5177355 15.590446 35.637173 21.91507 1438.5999 329.56418 62.79716 0.76523685 0.30326357 0.66887695 1.915728 3.245992 0.0 0.0 0.66887695 1.915728 3.245992 0.0 0.0 0.7828918 0.84800005 0.91120744 0.08268376 S 0 0 0 0 0 7 0 172 172 0 5400.0 17.358227 -226.7752 0 0 0 316.564697265625 2.8542842864990234 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 7 7 1
122950009 1152921504606846976 0 0 0 316.442138671875 2.884831666946411 0.0 0.0 348913 122950009 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 4.7777104 8.806635 12.286938 10.296636 7.725024 1438.5999 329.56418 62.79716 0.76552945 0.30337632 2.3119097 4.477014 6.6010075 0.0 0.0 2.3119097 4.477014 6.6010075 0.0 0.0 0.7793465 0.84541136 0.90963763 0.08421701 S 0 0 0 0 0 8 0 310 310 0 5400.0 73.0176 -288.79773 0 0 0 316.442138671875 2.884831666946411 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 8 8 1
122950010 1152921504606846976 0 0 0 316.5118713378906 2.933967113494873 0.0 0.0 348914 122950010 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 6.3741465 16.333185 22.807755 30.308369 22.593151 1438.5999 329.56418 62.79716 0.7656426 0.30341995 1.1437836 3.014823 4.348249 0.0 0.0 1.1437836 3.014823 4.348249 0.0 0.0 0.7757973 0.84281594 0.9080616 0.08575897 S 0 0 0 0 0 9 0 290 290 0 5400.0 55.85053 -283.17615 0 0 0 316.5118713378906 2.933967113494873 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 9 9 1
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
122950091 1152921504606846976 0 0 0 316.587646484375 2.9565248489379883 0.0 0.0 348914 122950091 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 39.914177 61.99608 94.36916 89.009514 65.55663 1438.5999 329.56418 62.79716 0.7656356 0.30341724 1.9957088 3.099804 4.718458 0.0 0.0 1.9957088 3.099804 4.718458 0.0 0.0 0.7759404 0.84292066 0.9081253 0.08569665 S 0 0 0 0 0 90 0 269 269 0 5400.0 28.508 -279.7112 0 0 0 316.587646484375 2.9565248489379883 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 90 90 1
122950092 1152921504606846976 0 0 0 315.8100891113281 3.014225482940674 0.0 0.0 348911 122950092 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 9.442765 16.955393 28.904829 35.504772 24.632147 1438.5999 329.56418 62.79716 0.76693267 0.30391705 2.1959229 4.1160493 7.364882 0.0 0.0 2.1959229 4.1160493 7.364882 0.0 0.0 0.7429734 0.8186261 0.89326984 0.10036307 S 0 0 0 0 0 91 0 246 246 0 5400.0 -29.461878 -282.7649 0 0 0 315.8100891113281 3.014225482940674 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 91 91 1
122950093 1152921504606846976 0 0 0 316.4068298339844 2.968167781829834 0.0 0.0 348913 122950093 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 14.123852 30.290215 48.410706 45.6958 31.475048 1438.5999 329.56418 62.79716 0.7659286 0.30353016 2.4283466 5.4215183 9.06763 0.0 0.0 2.4283466 5.4215183 9.06763 0.0 0.0 0.76351774 0.8338063 0.90257424 0.091148786 S 0 0 0 0 0 92 0 345 345 0 5400.0 25.688492 -317.2147 0 0 0 316.4068298339844 2.968167781829834 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 92 92 1
122950094 1152921504606846976 0 0 0 316.9741516113281 2.9544930458068848 0.0 0.0 348915 122950094 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 10.611111 20.95082 31.262861 36.302418 26.552885 1438.5999 329.56418 62.79716 0.7651067 0.30321342 2.1116228 4.2956653 6.632546 0.0 0.0 2.1116228 4.2956653 6.632546 0.0 0.0 0.78080076 0.84647363 0.9102821 0.083587244 S 0 0 0 0 0 93 0 302 302 0 5400.0 -8.5949 -305.9973 0 0 0 316.9741516113281 2.9544930458068848 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 93 93 1
122950095 1152921504606846976 0 0 0 316.3717956542969 2.799359083175659 0.0 0.0 347473 122950095 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 4.1053476 15.315883 32.62384 49.618835 37.02061 1438.5999 329.56418 62.79716 0.7652646 0.30327427 1.236492 4.8283434 10.825783 0.0 0.0 1.236492 4.8283434 10.825783 0.0 0.0 0.7899333 0.8531303 0.9143123 0.079658955 S 0 0 0 0 0 94 0 367 367 0 5400.0 42.842823 -322.85312 0 0 0 316.3717956542969 2.799359083175659 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 94 94 1
122950096 1152921504606846976 0 0 0 316.4466247558594 3.0077035427093506 0.0 0.0 348913 122950096 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 11.180186 16.35903 22.621618 15.321023 14.420046 1438.5999 329.56418 62.79716 0.7660423 0.30357397 5.302083 8.145961 11.897105 0.0 0.0 5.302083 8.145961 11.897105 0.0 0.0 0.7653294 0.8351385 0.90338725 0.09034816 S 0 0 0 0 0 95 0 388 388 0 5400.0 39.591503 -332.79407 0 0 0 316.4466247558594 3.0077035427093506 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 95 95 1
122950097 1152921504606846976 0 0 0 317.0958251953125 2.9794046878814697 0.0 0.0 348916 122950097 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 2.8628452 10.8479185 19.559298 36.448734 31.171446 1438.5999 329.56418 62.79716 0.765047 0.3031904 0.7084064 2.7762833 5.2014093 0.0 0.0 0.7084064 2.7762833 5.2014093 0.0 0.0 0.7874034 0.85128874 0.91319877 0.08074262 S 0 0 0 0 0 96 0 265 265 0 5400.0 -12.30921 -288.31976 0 0 0 317.0958251953125 2.9794046878814697 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 96 96 1
122950098 1152921504606846976 0 0 0 316.72039794921875 3.2825276851654053 0.0 0.0 350353 122950098 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 7.4512835 14.455457 23.138222 26.894514 20.472746 1438.5999 329.56418 62.79716 0.7668398 0.3038813 0.8931184 1.7725348 2.9125378 0.0 0.0 0.8931184 1.7725348 2.9125378 0.0 0.0 0.7468999 0.8215379 0.89506036 0.098582454 S 0 0 0 0 0 97 0 248 248 0 5400.0 -9.055862 -278.4183 0 0 0 316.72039794921875 3.2825276851654053 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 97 97 1
122950099 1152921504606846976 0 0 0 316.3603515625 2.7383956909179688 0.0 0.0 347473 122950099 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 32.547592 44.42431 50.16973 39.943626 30.014486 1438.5999 329.56418 62.79716 0.7650247 0.30318183 4.9287596 6.995277 8.257004 0.0 0.0 4.9287596 6.995277 8.257004 0.0 0.0 0.79560834 0.857254 0.91680217 0.07724071 S 0 0 0 0 0 98 0 308 308 0 5400.0 52.594242 -293.08817 0 0 0 316.3603515625 2.7383956909179688 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 98 98 1
122950100 1152921504606846976 0 0 0 316.617431640625 2.5801117420196533 0.0 0.0 346034 122950100 0 0.0 0 0.0 0.0 0.0 0.0 0.0 0 4.305484 11.633435 16.266111 27.122734 22.521572 1438.5999 329.56418 62.79716 0.76402825 0.3027978 2.4081693 6.863938 10.18622 0.0 0.0 2.4081693 6.863938 10.18622 0.0 0.0 0.7963428 0.857787 0.9171236 0.07692902 S 0 0 0 0 0 99 0 285 285 0 5400.0 4.852069 -293.90848 0 0 0 316.617431640625 2.5801117420196533 0.0 0.0 0.0 0.0 0.0 0.0 2 0 20200308 0 0 1 20200308 20200308 1 0 0 1 0 0 1 0 0 1 99 99 1
In [15]:
if 'MEDIAN_COADD_SNR' not in coadds.scores.columns:
totsnr = None
for cam in 'BRZ':
camsnr = coadds.scores['MEDIAN_COADD_SNR_{}'.format(cam)]
if totsnr is None:
totsnr = camsnr**2
else:
totsnr += camsnr**2
totsnr = np.sqrt(totsnr)
coadds.scores.add_column(Column(totsnr, name='MEDIAN_COADD_SNR'))
coadds.scores
Out[15]:
<Table length=100>
INTEG_COADD_FLUX_B MEDIAN_COADD_FLUX_B MEDIAN_COADD_SNR_B INTEG_COADD_FLUX_R MEDIAN_COADD_FLUX_R MEDIAN_COADD_SNR_R INTEG_COADD_FLUX_Z MEDIAN_COADD_FLUX_Z MEDIAN_COADD_SNR_Z MEDIAN_COADD_SNR
float64 float64 float64 float64 float64 float64 float64 float64 float64 float64
5215.221938925086 3.0426539182662964 1.21610558298026 6001.167387267265 3.32555615901947 2.0506820401356323 5424.101250837069 2.4586155473668674 1.826571166799545 3.0034266839851522
7366.916616582257 4.179696321487427 1.6063100331892497 10016.056823210434 5.570260524749756 3.1533200776260615 11628.200063354936 5.310257911682129 3.5724135460950746 5.028498580988928
3902.393618896121 2.163161873817444 0.5744470836777908 4128.723390846711 2.327670931816101 0.9702164552327888 3839.5000197376794 1.6846105456352234 0.8334002701540928 1.4020932323648494
5742.106335436697 3.2396013736724854 1.267959231025919 5471.645756062546 2.9433501596541554 1.8570605367966404 5429.36304282126 2.428017497062683 1.837055310572008 2.903647131276816
3068.012221021386 1.8552420735359192 0.3875220979821035 3779.4139584058735 2.133725098508137 0.6942821197819352 4813.4942605611295 2.1074760573018754 0.8339597640257269 1.1522542802208178
14701.111405761189 8.41447114944458 2.672587109731343 13191.590849760421 7.229382514953613 3.504507475711117 11042.259262715354 4.976744651794434 2.9627101594492053 5.310550441839412
9325.523171341873 5.2153994238786865 1.7872340828809556 8758.916483129324 4.749372959136963 2.633843670634536 8121.034339171875 3.7062941789627075 2.4398993021007342 4.010541952497766
2778.959435606834 1.6136696934700012 0.8230041447300147 4399.462698742371 2.4214975833892822 1.899045522981757 4376.748696124689 1.9757242798805237 1.795498338137651 2.7399861318727337
4001.2260549227385 2.266971230506897 0.6980240798125583 3935.3429861278405 2.1367682218551636 1.0512505334346764 3707.462926291546 1.7044706344604492 0.9898602411554033 1.6038044135944673
5869.373796532378 3.3446332456461874 1.4260815630147872 7179.006523343899 3.9052326526676984 2.592229403858517 7090.882988852623 3.2360442876815796 2.5728412579011364 3.9208256840820765
... ... ... ... ... ... ... ... ... ...
31134.576348485858 17.179140090942383 3.9974845332811135 28054.909886851896 15.516252994537354 5.371990770139784 27538.332422182622 12.46394157409668 5.213174013196101 8.486185875889822
7315.215767693725 4.1247061782799275 1.6392637299454105 7733.766509162026 4.272533893585205 2.5522342680960604 8428.994352542977 3.8136343955993652 2.7687956052683687 4.106983618096352
11651.041511627456 6.747768402099609 1.3600249208060506 13767.608420921546 7.651253938674927 2.4092142508889207 14009.305441966686 6.320380449295044 2.4186486429832086 3.6747574545953756
8687.908498572273 5.0284264087677 1.4904457162049765 9417.961911659642 5.1617653369903564 2.352439766263453 9455.973830550305 4.185863733291626 2.345719934055582 3.641126651996211
3653.011109234771 2.233209329121025 0.8976318819588829 7538.460296120517 4.169497363457554 2.609035060685664 9437.00117142705 4.263236853621896 3.0709703829134316 4.128397514305952
8876.790978295325 4.845900297164917 0.9439814119927412 7084.94970246548 3.8569164566800342 1.17879611631477 6835.397187737595 3.1381702423095703 1.1454474470322407 1.8954448142690075
2827.099626042232 1.67165607213974 0.7835263945067584 4983.752769100655 2.7532601356506348 1.9634097952243568 5555.922703766704 2.571816086769104 2.1677963402542173 3.027908949702961
6277.150542670464 3.561915159225464 1.1805681661334693 6608.884892274808 3.6228190660476685 1.8927897414351236 6769.630875437064 3.0550858974456787 1.9340809324356125 2.952467316225667
25543.37355635203 14.3564453125 2.856648366304113 19444.27733558296 10.678998157341416 3.292661476011622 14803.976328800221 6.5871076583862305 2.4977436270576394 5.024020572293274
4018.6804418675492 2.2598809003829956 1.0141881392078176 4910.1102462458975 2.595016806592106 1.8032723838849232 4889.949250799351 2.162584259086172 1.8544317073831356 2.7783602771310565
In [16]:
from scipy.signal import medfilt
fig, axes = plt.subplots(10,3, figsize=(14,30), sharex=True)
for i in range(10):
axes[i,0].plot(wave, flux[i], alpha=0.7, label='template')
axes[i,0].legend()
for _filt, _col in zip(spectra.bands, ['b', 'r', 'saddlebrown']):
wl = spectra.wave[_filt]
fl = spectra.flux[_filt][i]
axes[i,1].plot(wl, fl, color=_col, alpha=0.7, label=_filt)
axes[i,1].legend()
axes[i,2].plot(coadds.wave['brz'], coadds.flux['brz'][i], alpha=0.7, label='coadd')
axes[i,2].plot(coadds.wave['brz'], medfilt(coadds.flux['brz'][i], 149), color='yellow')
axes[i,2].legend()
fig.tight_layout();
In [ ]:
Content source: desihub/desisim
Similar notebooks: