Tests related to Surveying the SDSS DR7


In [20]:
# imports
import numpy as np
from astropy.table import Table
from specdb.specdb import IgmSpec
from dla_cnn import data_loader as ddl

Generate CSV file from igmspec

Load igmspec


In [3]:
igmsp = IgmSpec()


Database is igmspec
Created on 2017-Jan-31

In [6]:
sdss_dr7 = igmsp['SDSS_DR7'].meta

In [7]:
sdss_dr7[0:3]


Out[7]:
<Table length=3>
SDSSJRA_GROUPDEC_GROUPzem_GROUPUMAGUMAGERRGMAGGMAGERRRMAGRMAGERRIMAGIMAGERRZMAGZMAGERRAUlogNHFIRSTMAGFIRSTSNFIRSTDELRASSCNTRASSSNRASSDELJMAGJMAGERRHMAGHMAGERRKMAGKMAGERRMASSDELMASSFLGMIMAGDGMIMFLAGSPFLAGMODEFLAGUSELFLAGBESTFLAGLZFLAGHZFLAGFTFLAGRTFLAGSRFLAGSTFLAGGXFLAGRUNRMJDSMJDPLATEFIBERRERUNCAMCOLFIELDOBJECTTFLAGLZTFLAGHZTFLAGFTTFLAGRTTFLAGSRTFLAGSTTFLAGGXTFLAGUTMAGUTMAGERRGTMAGGTMAGERRRTMAGRTMAGERRITMAGITMAGERRZTMAGZTMAGERRBESTIDSPECOIDONAMEDATE-OBSEPOCHRsig_zemflag_zemSTYPEIGM_IDSPEC_FILENPIXWV_MINWV_MAXGROUP_IDINSTRDISPERSERTELESCOPE
str31float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int32float64float64int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32int32float64float64float64float64float64float64float64float64float64float64str31str31str31str10float64float64float64str10str3int64str28int64float64float64int64str4str4str10
000006.53+003055.20.02720.51531.82420.3840.06520.4610.03420.3240.03820.0930.04120.0420.1210.1320.5080.00.00.0-9.00.00.00.00.00.00.00.00.00.00-25.1090.09100103460300800001003325525225220368546741510811834603008000010020.3840.06520.4610.03420.3240.03820.0930.04120.0420.121588015509806252150193034571183292416SDSS J000006.53+003055.22001-10-212000.02000.00.0SDSS-HWQSO302257spSpec-52203-0685-467.fit.gz38433803.69213.00SDSSBOTHSDSS 2.5-M
000008.13+001634.60.03390.27631.83620.2420.05420.2060.02419.9410.03219.4850.03219.1780.0680.16120.5020.00.00.0-9.00.00.017.3510.2910.00.00.00.00.018-25.7450.4380010346030080000100266252197522036854704042831501048576000010020.0940.04419.980.01719.8520.0219.4050.02119.10.079587731186740822166193034571195875328SDSS J000008.13+001634.62001-10-212000.02000.00.0SDSS-HWQSO302258spSpec-52203-0685-470.fit.gz38433803.69213.01SDSSBOTHSDSS 2.5-M
000009.26+151754.50.038615.29851.19719.9160.04219.8070.03619.3740.01719.1480.02319.3120.0690.22320.551-1.00.00.0-9.00.00.00.00.00.00.00.00.00.00-25.1010.33801111048578100010017395181452251751354404303241048578100010019.9120.03719.770.02419.3930.01819.1730.01919.3530.07587727222487318552211612125330669568SDSS J000009.26+151754.52001-12-082000.02000.00.0SDSS-HWQSO302259spSpec-52251-0751-354.fit.gz38283817.79215.12SDSSBOTHSDSS 2.5-M

Cut


In [18]:
zlow = 3700./1215.67 - 1.
zlow


Out[18]:
2.043589131919024

In [21]:
gdq = sdss_dr7['zem_GROUP'] > 2.0
np.sum(gdq)


Out[21]:
24740

In [22]:
sdss_dr7 = sdss_dr7[gdq]

Build the Table


In [23]:
dr7_set = Table()

In [24]:
dr7_set['PLATE'] = sdss_dr7['PLATE']
dr7_set['FIB'] = sdss_dr7['FIBER']
#
dr7_set['RA'] = sdss_dr7['RA_GROUP']
dr7_set['DEC'] = sdss_dr7['DEC_GROUP']

In [26]:
dr7_set.write('dr7_set.csv', format='csv', overwrite=True)

In [ ]: