Debugging the Training Set


In [8]:
%matplotlib notebook

In [25]:
# import
import pdb
import os
from linetools.spectra import io as lsio
from linetools import utils as ltu

from pyigm.surveys.dlasurvey import DLASurvey

index 196 in file [training_20456_5000.hdf5]

Load


In [31]:
spec_20456 = lsio.readspec(os.getenv('DROPBOX_DIR')+'/MachineLearning/DLAs/training_20456_5000.hdf5')

In [5]:
spec_20456.select = 196

In [9]:
# Strange qso..  Probably BAL nonsense
#  And probably should not have inlucded it in the training set..
spec_20456.plot()



In [12]:
spec_20456.header['PLATE'], spec_20456.header['FIBER']


Out[12]:
(538, 168)

In [13]:
spec_20456.header['zem']


Out[13]:
2.36299991607666

Check zabs vs. zem


In [32]:
dlas = ltu.loadjson(os.getenv('DROPBOX_DIR')+'/MachineLearning/DLAs/training_20456_5000.json')

In [33]:
for ispec in range(spec_20456.nspec):
    spec_20456.select = ispec
    zem = spec_20456.header['zem']
    for ii in range(dlas[str(ispec)]['nDLA']):
        if dlas[str(ispec)][str(ii)]['zabs'] > zem:
            pdb.set_trace()

In [23]:
spec_20456.select = 228

In [24]:
spec_20456.plot()


Bad zem??


In [26]:
sdss = DLASurvey.load_SDSS_DR5(sample='all')


SDSS-DR5: Loading DLA file /Users/xavier/local/Python/pyigm/pyigm/data/DLA/SDSS_DR5/dr5_alldla.fits.gz
SDSS-DR5: Loading QSOs file /Users/xavier/local/Python/pyigm/pyigm/data/DLA/SDSS_DR5/dr5_dlagz_s2n4.fits

In [28]:
badsl = (sdss.sightlines['PLATE'] == 538) & (sdss.sightlines['FIB'] == 168)

In [29]:
sdss.sightlines[badsl]


Out[29]:
<QTable length=1>
PLATEFIBRADECFLG_BALIQSOMAGS2NZ_STARTZ_ENDZEMDX
degdeg
int32int32float64float64int16int32float64float64float64float64float64float64
538168224.012831.24598060528920.5459995275.60490417484.192187202854.228764057164.281579971310.15294242902

In [ ]: