Examples for reading SDSS Quasar Database


In [41]:
# imports
from xastropy.sdss import quasars as sdssq
from xastropy.sdss import qso as sdssqso

Generate the Class


In [37]:
reload(sdssq)
sdss_dr7 = sdssq.SdssQuasars()


SDSS_QUASAR: Using summary file /u/xavier/SDSS//DR7_QSO/dr7_qso.fits.gz

In [38]:
sdss_dr7


Out[38]:
[SdssQuasars: Version=DR7]

Grab by Plate/Fiber or Name


In [35]:
row = sdss_dr7.get_qso((287,264))
row


Out[35]:
<QTable masked=False length=1>
ZZ_ERRZ_CONFZ_WARNPLATEMJDFIBERIDFLG_TARGRAOBJDECOBJPSF_UPSF_GPSF_RPSF_IPSF_ZPSF_SUPSF_SGPSF_SRPSF_SIPSF_SZ
float32float32float32int16int32int32int32int16float64float64float32float32float32float32float32float32float32float32float32float32
0.3311880.001796990.00287520232640182.68148-0.6520189620.046120.128819.4619.280318.65330.0495760.032440.0342810.0382320.042613

In [36]:
## By name
row = sdss_dr7.get_qso('J000009.42-102751.9')
row


Out[36]:
<QTable masked=False length=1>
ZZ_ERRZ_CONFZ_WARNPLATEMJDFIBERIDFLG_TARGRAOBJDECOBJPSF_UPSF_GPSF_RPSF_IPSF_ZPSF_SUPSF_SGPSF_SRPSF_SIPSF_SZ
float32float32float32int16int32int32int32int16float64float64float32float32float32float32float32float32float32float32float32float32
1.844930.001998660.006505214319900.03926445-10.4644119.241619.018718.965918.775418.70460.0358690.0271960.0213560.0182480.046806

Generate a QSO Object


In [80]:
## Simple
reload(sdssqso)
qso = sdssqso.SdssQso()
qso


Out[80]:
[SdssQso: 00:00:00 +00:00:00, z=0]

In [82]:
## From the Database Class
reload(sdssq)
reload(sdssqso)
sdss_dr7 = sdssq.SdssQuasars()
qso = sdss_dr7[(287,264)]
qso


SDSS_QUASAR: Using summary file /u/xavier/SDSS//DR7_QSO/dr7_qso.fits.gz
Out[82]:
[SdssQso: 12:10:43.5552 -00:39:07.2683, z=0.331188]

Load Spectrum


In [73]:
qso.load_spec()
#qso.spec.plot()


SdssQso: Loading spectrum from /u/xavier/SDSS//DR7_QSO/spectro/1d_26/0287/1d/spSpec-52023-0287-264.fit

In [70]:

Sandbox


In [3]:
path = os.getenv('SDSSPATH')+'/DR7_QSO/' 
summf = path+'dr7_qso.fits.gz'
datdir = path+'spectro/1d_26/'
sdss = QTable.read(summf)
sdss[0:3]


Out[3]:
<QTable masked=False length=3>
ZZ_ERRZ_CONFZ_WARNPLATEMJDFIBERIDFLG_TARGRAOBJDECOBJPSF_UPSF_GPSF_RPSF_IPSF_ZPSF_SUPSF_SGPSF_SRPSF_SIPSF_SZ
float32float32float32int16int32int32int32int16float64float64float32float32float32float32float32float32float32float32float32float32
0.3311880.001796990.00287520232640182.68148-0.6520189620.046120.128819.4619.280318.65330.0495760.032440.0342810.0382320.042613
0.3324750.0009573230.0027751908700166.25829-0.7484960519.840419.754219.212618.958118.44990.0437950.04220.0340180.0261090.036945
0.379570.001567320.0030351615540213.86771-1.087511420.074519.934119.469518.998518.27550.046260.0251930.0198350.0291980.030035

In [5]:
tmp = 'DR7'
tmp.lower()


Out[5]:
'dr7'

In [ ]: