Showing posts with label Stripe 82. Show all posts
Showing posts with label Stripe 82. Show all posts

Wednesday, May 19, 2010

Adam's Thoughts...

Adam Myers got back to me about the differences in our thresholds. He thinks that my problem is that I am setting the thresholds with objects that are in the stellar locus, so this is making my thresholds higher than they should be (from 5/19 email re: Testing Likelihood):

~~~~~~

....my guess is that your thresholds are so high because the area between RA = 320 and 321 degrees has one of the largest gradients in stellar density of anywhere on the sky (see the attached quick-plot).


If you compare you threshold in this range to the other RA strips you should find that it is grossly deviant

e.g., my numbers are likelihood v2:

0 < RA < 1....threshold at 20 fibers per sq. deg. = 0.468797
320 < RA < 321....threshold at 20 fibers per sq. deg. = 0.999961

In fact, 320 < RA < 321 dominates the counts to the extent that you don't even really *see* the other strips in RA in your test. Taking the first 240 objects over your 12 degrees of strips (i.e. targeting at 20 per sq. deg.) I find that 90% (215 out of 240) of them come from the 320 < RA < 321 strip. So, that's your problem there. This is why I set thresholds over large representative areas, preferably outside of stripe 82. Although, I think you'd be safe to continue doing what you're doing if you stick to, say strips in the range 350 < RA < 60.

~~~~~~

So it looks like I need to try again, setting the thresholds with a different sky region (away from Milky Way). Results to follow.

Monday, May 10, 2010

Setting Thresholds

I've made a file to use for setting the thresholds. It is objects in Erin's median seeing file (../boss/boss-qso-stripe82median.fits) that are in the following ra/dec ranges:

(-1 < dec ≤ 1) and
(0 < ra ≤ 1) or (20 < ra ≤ 21) or (40 < ra ≤ 41) or
(320 < ra ≤ 321) or (340 < ra ≤ 341) or (359 ≤ ra < 360)

The area of this file is 2 (degrees in dec) × 6 (degrees in ra) = 12 deg2.
The number of targets in this file 43,134.

Ra/Dec of Threshold Targets
<

I modified the likelihood.script to take as an argument the directory to store the likefile*.fits. So now when you run the likelihood.script you do the following:
./likelihood.script thisrundirectory

This will stores all the likefile*.fits and qsub*.out files in the directory ../likelihood/thisrundirectory

If you don't give the likelihood.script a directory argument it will write in the current directory.

I have found a problem that not all the Stripe-82 quasars in the 3pc catalog are in Erin's median seeing targets catalog. I've pinged him about this. We'll see if he has an idea.

In the mean time, I am determining the thresholds for the old version of the likelihood (v1) on my set of threshold targets above. I'm also re-calculating the likelihoods on the 3pc quasars which I have median seeing for to make sure I get the same numbers again.

The code for this is here: ../logs/100510log.pro
The run directory is here: ../likelihood/likev1

Monday, March 29, 2010

Data Run

I'm running the reconstruction on the data. I'm doing in the working directory: .../pythonJess/run2010329_1319. I am running this with 12 redshift bins and 250k photometric and spectroscopic objects.

I did a little bit of thinking about the number of grids for the correlation function. There is the strange balance that you want the number of grids to be less than the number of particles, otherwise you might as well just correlate all possible pairs. You also want the spacing to be much bigger than the max correlation length, otherwise even by going out one grid length, you will unnecessarily correlate too many objects. I feel like this is a computer science problem, and perhaps Adam Pauls or Erin Sheldon would know the answer?

I played with this a bit (tried upping the grid points to 1000, and this took forever to run). For the 2D correlation function, I am correlating out to a distance of 0.34 (with a box size of 1). Maybe I don't need to correlate out to such a big angle? We could probably have as few as 10 grid points in each dimension if we are going out to this large of an angle. For the 3D correlation function, I am correlating out to a distance of 20 Mpc/h (with a box size of 2400 Mpc/h) so we need at least ~120 grid points in each dimension.

For the 3D correlation function, some of the larger redshift bins have very few objects in them, and if we have ~1003 or 106 grid points then we are wasting time griding if we have less than 103 points in each set.

Here are the results from the reconstruction I ran yesterday. It looks like I don't have enough points because the correlation functions are very noisy.





The reconstructions don't look good and are highly variable:




I'm running on a bigger data set now.

Friday, March 26, 2010

Mask Fixed

It turns out that my mask was messing up. I now have it fixed. Here is what the data/randoms look like on the mock data:






And here is what is looks like for real data:






The log on 3/29 has the code to run these.

Wednesday, March 24, 2010

If It Isn't One Correlation Function, It's Another!

I ran my code on the Stripe-82 data for the first time since I fixed the angular correlation functions and now my 3D correlation functions look weird:



I think this has something to do with some changes I made to the conversion from ra/dec to x, y, z. I had been doing something that I don't think is right before and I changed that, but it might now be messing up the masks so that my mask for the 3D correlation functions are now not in the same region as the data. I'm going back to look at the changes I made to investigate this. Thank goodness for repositories!

Tuesday, March 16, 2010

Comparing Quasars

Here are the color-color diagrams with redshift temperature plots for the current QSO Catalog (in the BOSS redshift range) and the BOSS 3PC Quasars (same temperature-z map as before). I think this shows pretty well that something is wrong with the QSO Catalog's color distribution. These both have the same number of quasars, in the same redshift range:


Their redshift distributions are not that different so this is really a matter of the input QSOs not properly representing the spread of the possible colors, I believe:

White is BOSS QSOs, Green is the QSO Catalog.
The histograms are scaled as a percentage in each bin.

I want to add in BOSS QSOs to Joe's Monte Carlo. We can do this by just adding in the "chunk 1" objects where we have co-added photometry from Stripe-82, or we can apply the same cuts in terms of brightness as we did to the DR5 catalog.

Wednesday, March 3, 2010

Single Epoch vs Coadded

Joe Hennawi asked me to give him targeting files that were single epoch versus coadded for Stripe 82. Erin Sheldon had created some files for me which had different seeings:

This is the standard primary on stripe 82:
http://data.sdss3.org/sas/bosswork/groups/boss/target/2009-12-05-chunk1-retrain/bosstarget-qso-2009-12-05-chunk1-retrain-collate-fullcache.fits

These are alternative runs on stripe 82:
"good seeing"
http://data.sdss3.org/sas/bosswork/groups/boss/target/2009-11-30-stripe82pairs/bosstarget-qso-2009-11-30-stripe82pairs-collate-good-fullcache.fits

"median seeing"
http://data.sdss3.org/sas/bosswork/groups/boss/target/2009-11-30-stripe82pairs/bosstarget-qso-2009-11-30-stripe82pairs-collate-median-fullcache.fits

"bad seeing"
http://data.sdss3.org/sas/bosswork/groups/boss/target/2009-11-30-stripe82pairs/bosstarget-qso-2009-11-30-stripe82pairs-collate-bad-fullcache.fits

And it matched them to the variable catalogs (co-adds) with the following code:

erinfile2 = '/home/jessica/boss/boss-qso-stripe82median.fits'
confTT = mrdfits(erinfile2, 2)

varcat0 = '/home/schlegel/varcat4/varcat-ra0-30.fits.gz'
varcat = mrdfits(varcat0, 1)
spherematch, confTT.ra, confTT.dec, varcat.ra, varcat.dec, 2./3600, i1, i2, d12
truthmatch0 = confTT[i1]
varmatch0 = varcat[i2]

varcat1 = '/home/schlegel/varcat4/varcat-ra30-60.fits.gz'
varcat = mrdfits(varcat1, 1)
spherematch, confTT.ra, confTT.dec, varcat.ra, varcat.dec, 2./3600, i1, i2, d12
truthmatch1 = confTT[i1]
varmatch1 = varcat[i2]

varcat2 = '/home/schlegel/varcat4/varcat-ra60-90.fits.gz'
varcat = mrdfits(varcat2, 1)
spherematch, confTT.ra, confTT.dec, varcat.ra, varcat.dec, 2./3600, i1, i2, d12
truthmatch2 = confTT[i1]
varmatch2 = varcat[i2]

varcat3 = '/home/schlegel/varcat4/varcat-ra90-120.fits.gz'
varcat = mrdfits(varcat3, 1)
spherematch, confTT.ra, confTT.dec, varcat.ra, varcat.dec, 2./3600, i1, i2, d12
truthmatch3 = confTT[i1]
varmatch3 = varcat[i2]

varcat4 = '/home/schlegel/varcat4/varcat-ra300-330.fits.gz'
varcat = mrdfits(varcat4, 1)
spherematch, confTT.ra, confTT.dec, varcat.ra, varcat.dec, 2./3600, i1, i2, d12
truthmatch4 = confTT[i1]
varmatch4 = varcat[i2]

varcat5 = '/home/schlegel/varcat4/varcat-ra330-360.fits.gz'
varcat = mrdfits(varcat5, 1)
spherematch, confTT.ra, confTT.dec, varcat.ra, varcat.dec, 2./3600, i1, i2, d12
truthmatch5 = confTT[i1]
varmatch5 = varcat[i2]

truthmatch = [truthmatch0, truthmatch1, truthmatch4, truthmatch5]
varmatch = [varmatch0, varmatch1, varmatch4, varmatch5]

outfile = "./singleEpochMatch.fits"
splog, 'Writing file ', outfile
mwrfits, truthmatch, outfile, /create

outfile = "./coaddedMatch.fits"
splog, 'Writing file ', outfile
mwrfits, varmatch, outfile, /create

This creates two matched catalogs, each with 735,498 objects in Stripe-82. I'm sending these files to Jo and Joe to help with the "extreme deconvolution." (Man I love that name)

Thursday, January 28, 2010

Working Data Reconstruction!

I ran the SDSS CAS data though our working pipeline. I've run on a small data set as a first go -- the same size as what I was running on for the reconstructions with the mock data -- 20,000 points in both the photometric and spectroscopic data sets. The difference here is that both data sets are coming from the same super-set of data (I am randomly picking points from a larger set of Stripe-82 data), so the redshift distributions of the two sets are the same (see below plot). This, in theory, should make the reconstruction easier to do.

Redshift Distributions of photometric and spectroscopic data sets


The Bad News
The correlation functions look really noisy. This is hopefully due to the fact that I am running with 20,000 points instead of 1,000,000 points (before) so hopefully the noise will clear up when I re-run with a larger data set. I wouldn't expect the correlations to look as smooth on a smaller data set as it does with the mock data, because the mock data, by design, traces dark matter populations explicitly, so the dark matter signal is put in by hand. There is also more noise on this data than on the mock data. It is logical to me that we might need higher statistics to get the same strength of signal as we did in the mock data.


The Good News
Even with the noisy correlation functions, the reconstruction looks not too bad. There seems to be a problem at the edges (it seems to be forcing the reconstruction to be zero at redshift zero and thus changing the shape on the low end), but overall it looks pretty good. (At least much better than it's ever looked before). Thoughts Alexia?


I've chosen the binning which looks the best. Like what happened in the mock data the reconstruction changes a lot depending on the binning. However, it looks like I might actually have something working here! Woo hoo!

Next steps
Higher Statistics: I'm not sure if I should run on Eyal's LRGs or on a bigger set of CAS data. The CAS data is easier to do right away, so I might as well set that going (it will take a couple days), and in the mean time I can work on getting my code to read in Eyal's randoms instead of generating it's own. Will talk to Schlegel about this and see what he thinks.

Other Catalogs: According to Eric Huff, Reiko Nakajima has a SDSS catalog with her own calculated photo-z's that she uses for lensing. I will talk to her about this. I also should get in touch with Antonio Vazquez about catalogs.

Optimization: There is quite a few things I can do to make this code run faster. I need to spend some time writing scripts to simultaneously calculate all the correlation functions (right now they are calculated in succession). This should speed up the code by a factor of ten. I also should write scripts so that I can just set a run going and then log-out of the terminal window.

Organizational Note
For a while now I've been creating a log file for each day with the code I use to generate the plots for the blog post that day. I've been keeping these log files locally on my computer, but decided it might be useful for collaborators to have copies of them, and also for there to be a back-up should something happen to my laptop. I've now added these logs to the repository under: repositoryDir/Jessica/pythonJess/logs. The name of the log file is the date of the blog post which the code corresponds to.

Tuesday, November 3, 2009

Stripe 82 Histograms

Here are histograms of the random numbers versus data for Stripe 82. As you can see it seems like the randoms are matching the data pretty well:




Cartesian





Spherical Coordinates

Therefore I don't think this is what is causing the problem in my calculation on the data. I coded up the correlation function to print out the components as per Nic's suggestion (see yesterday's post). Hopefully this will help me isolate the problem.

Monday, November 2, 2009

Populating Randoms

I talked to Nic Ross and Mark Davis about this issue of populating the random declinations in the correlation functions. They both said that this is a well known issue and that (obviously) I want to populate the random declinations with a cosine function. Nic doesn't think this should matter much with my Stripe 82 3D correlation functions because the dec range is small and therefore is ~flat. Still, I am going to see if this matters.

Nic also recommended that I print out the individual elements of the correlation function to see if there is one in particular that isn't behaving properly. By "elements" mean that the 3D correlation function is calculated in the following way:

xi = (dd-2*dr+rr)/(rr);

where dd is the data correlated with itself, dr is the data correlated with the randoms and rr is the randoms correlated with themselves, so I am doing that now too.

Friday, October 9, 2009

Talking with Weinberg

I ran into David Weinberg at tea at the IAS today. We started talking about the Newman Project.
He suggested that after we get the method working on Stripe 82 using the LRGs as our "spectroscopic sample" and the rest of the galaxies as our "photometric sample" we could compare the reconstructed distribution with spectroscopic "follow-up" surveys such as COSMOS, Vimas?, and DEEP.

Then it would be interesting to break down the main sample (i.e. the rest of the galaxies) by colors and do redshift distribution reconstruction on each type of galaxy. We could also break these into photometric redshift slices and then look at the reconstruction in each slice and break those down by colors, to see if perhaps there is a different spread in the colors.

I thought these were really good ideas and ones that I haven't though of before. Need to talk to Schlegel/Nikhil and see what they think. Oh exciting!

Thursday, September 24, 2009

Back to the Likelihoods

It's been a while since I have worked on the likelihood QSO selection method. With the next deadline for target selection is coming up, it's time to go "Back to the Likelihoods." Note to self: It more time efficient to keep working on something continuously than to not work on it for weeks and then waste a day trying to remember what I was doing.

Where we left off...
Below is a color-color (ug - gr) plot of the final likelihood selection objects for the commissioning data.



The white data points are a random sampling of 20,000 possible objects to target. The red data points are objects who's likelihood ratio is greater than 0.1, where likelihood ratio is defined as:



where L_QSO and L_everything, as described in "A Likely Result" are defined as:



The green data points are objects are objects who's likelihood ratio is greater than 0.1 and L_everything is greater than 10^-6. This is eliminate classification of "fringe" objects that are not close to any objects (and therefore have a small everything likelihood.

The likelihood was then run on the co-added Stripe 82 data and all of the above green objects were submitted as targets for the commissioning data.

What we need to work out...
  • Why are the likelihoods so small/large? The likelihoods should be a probability, but we have likelihood's spanning from 0-11.
  • Why is our completeness and efficiency on the MMT data so poor?
  • How does the likeliness compare to QSOs based on variability?
  • How well does this method work on single epoch Stripe 82 data versus the co-added images?