belaa / boss-pipeline-errors

Recalibration of BOSS pipeline errors for 1D spectrum analysis
0 stars 0 forks source link

Build framework for looping over all DR9 quasars #2

Open dkirkby opened 9 years ago

dkirkby commented 9 years ago

Download all the (non-lite) spec files for DR9Q and create a python script that loops:

Test your framework by trying to reproduce the composite spectra in Fig.32 of the DR9Q paper. Three things to note here:

To start with, you could ignore the i-band cut and make a single composite to compare with the figure.

belaa commented 9 years ago

I'm writing something that loops through all the spectra, yet when I assign spec_obj=spec.SpecFile(local_path) I randomly get an error that says:

AttributeError                            Traceback (most recent call last)
<ipython-input-18-e8c4a92bc1d5> in <module>()
      1 remote_path=finder.get_spec_path(4385,55752,530,lite=False)
      2 local_path=mirror.get(remote_path)
----> 3 spec_obj=spec.SpecFile(local_path)

AttributeError: 'int' object has no attribute 'SpecFile'

It happens on and off when I call spec.SpecFile(...) for an individual fits file, but when I include it in a definition (when I'm looping through all the files) it consistently gives me this error. Here's my definition - it's not complete, just something I've written to test out:

screen shot 2015-07-14 at 3 17 12 pm

belaa commented 9 years ago

Never mind -- I unwisely used spec as my interator which is what gave the error

dkirkby commented 9 years ago

That's a hard one to debug!

belaa commented 9 years ago

Hi David - I know this was an issue in bossdata (#74, closed), but I am getting an error that says:

RuntimeError: Found inconsistent arcs for expid 00107388

for PLATE: 3660 MJD: 55209 FIBER: 632

I tried installing and updating bossdata but I don't think this change has been incorporated yet...is this correct?

belaa commented 9 years ago

Actually, this is happening for multiple spectra..

dkirkby commented 9 years ago

The change has been incorporated in the master branch on github but not yet released on pypi. You should be able to use the github version like this:

git clone https://github.com/dkirkby/bossdata.git
cd bossdata
python setup.py develop --user

This should temporarily override your latest pip install. You can undo this later with:

cd bossdata
python setup.py develop --user --uninstall

Let me know if this works and I will add it to the docs.

belaa commented 9 years ago

It works!

belaa commented 9 years ago

Hi David,

I'm looking at the DR9Q data model and trying to figure out which column gives the i-band magnitude. There are columns for JMAG, HMAG and KMAG but there is no IMAG column. There's one called IFLUX but it's in units of nanomaggies so I don't think that's the one I want.

DR10Q however has a column called Imag. I am going to keep looking, but was wondering if you had any thoughts? If I don't find anything, would I have to convert IFLUX to a magnitude?

belaa commented 9 years ago

Or maybe I could use DR10Q and select quasars before a certain date...

dkirkby commented 9 years ago

I would expect that M_i is just the i-band equivalent of r-PSF, i.e., available from bossquery as PSFMAG_3. Is there something in the paper that makes you suspect this might not be true?

belaa commented 9 years ago

The paper says 'In the following, all magnitudes will be PSF magnitudes,' so I think you're correct. But I get Database error: no such column: PSFMAG_3 when I try to access it in bossquery. Is there a difference between i-band magnitude and MI described in the data model as:

MI float64 - Absolute Magnitude Mi[z=2]

belaa commented 9 years ago

Actually I think that may be it - the paper says: 'We will call a quasar an object with a luminosity M_i[z=2] < −20.5 and either displaying at least one emission line...'