Friday, June 18, 2010

Distance and Completeness Updates

Fun
Today started out with breakfast in Zubrow for all the KINSC students. Twas good. It's also pot luck day!

I spent part of the afternoon helping some other folks figure things out. But now for my own work:

Distance
I came back and double checked my input to the distance code, just to be sure that everything was good to go there. I checked my technique against Dave's description of his calculation and went back to Shane's Bootes II paper, which Dave had cited. I discovered that there were a few additional things that I hadn't coded yet. Primarily, after I select the best fit isochrone or fiducial and the best distance, I need to bootstrap the distance calculation with the best fit to derive the error in the distance. Everything besides this last step is set, so I'll add the bootstrap after I've got the completeness stuff figured out.

I also tracked down the info about M13 and M92 (age/metallicity/distance) which was missing from yesterday's post.

Completeness
I spent all afternoon working on the completeness calculation for the actual ASTs. I really want to get the full-fledged Allframing started before the weekend. At this point I need the results to make significant progress on other calculations. Essentially, a lot of things will come together quickly once the artificial star tests are finished and the completeness levels are calculated.

Last I left the completeness calculation, I had a debugged version for the bright star tests, but had run into trouble matching the positions for the real test. That problem is still there. I did find a bug in the code where I was creating the input addstar file, so I made new ones and am running Allframe again. Hopefully that will solve the problem. In the meantime, I'm going to double check a few other things. Fingers crossed, this will not be an issue by lunchtime. Below are some signs of problems I've discovered on my hunt for answers. These are results from the bad addstar input runs, so I'll go back after running Allframe again to see if these red flags are still there.

A few observations:
1. I'm definitely getting 96% completeness for the bright star tests at r < 22.5. I've confirmed qualitatively and quantitatively.
2. Without applying a faint magnitude limit, only 6 stars out of 1765 artificial stars are matching between my art star input and the output from Allframe.
3. There are fewer stars coming out of allframe for the true distribution than are getting input as artificial. This could possibly be correct but seems unlikely. Allframe will pick up noise down to 27.5 mags, so even for stuff that's very faint I should be getting a lot of signal there. This is not to mention the true stars that allframe should be picking out of the image, too.
4. A quick, informal survey of 22 stars in the center of the ref frame shows that 3/22 visible artstars weren't subtracted (at least not well) by DAOphot/Allstar. Real stars are getting subtracted pretty well.
5. The bright star test outputs 1426 more stars than the real artificial star test. After calibration the bright star masterlist contains 1538 more stars than the actual art star masterlist. After final chi/sharp cuts, the margin is almost twice as many stars in the bright masterlist as in the actual AST masterlist.
6. I've double checked my option files, the program I use to create the masterlist, and the calibration program and they're exactly the same for both the bright tests and the actual tests.




Tomorrow:
1. Paper revisions
2. Completeness calculation
3. Allframing

Thursday, June 17, 2010

Distance Calculation

I downloaded 4 isochrones for the distance calculation. They are:

13Gyr, [Fe/H] = -2.3
13Gyr, [Fe/H] = -2.0
10Gyr, [Fe/H] = -2.3
10Gyr, [Fe/H] = -2.0

I downloaded these from Aaron Dotter's database at http://stellar.dartmouth.edu/~models/isolf.html. For each of the four, I assumed [a/Fe] = 0.0, Y = 0.245 + 1.5Z, and used the SDSS color database in ugriz.

I'll also be comparing to the M13 and M92 fiducials. The info on them is:

M13: (Grundahl et al. 1998)
distance = 7.7 kpc (dm = 14.431)
age = 12 +/- 1 Gyr
metallicity = [Fe/H] = -1.61
[a/Fe] = 0.3


M92: (Pont et al. 1998)
distance = 8kpc (dist modulus (dm) = 14.515)
age = 14 +/- 1.2 Gyr
metallicity = [Fe/H] = -2.2

I'll be fitting each of the fiducials and isochrones at 6 distances:

distance | dm
35.0 kpc | 17.720
36.0 kpc | 17.782
37.0 kpc | 17.841
38.0 kpc | 17.899
39.0 kpc | 17.955
40.0 kpc | 18.010

As of the end of the day Wednesday, the code was completed and de-bugged. The best match so far is M13 at a distance of 39 kpc with a total of 210 Wil1 stars within the envelope. This is derived using a magnitude limit of r = 24.25, which will need to be compared to the results of the completeness tests. Also, I'm currently using the measurement errors from the KPNO data to define the envelope around each isochrone/fiducial within which I'm matching Wil1 stars. This will need to be adjusted to the photometric uncertainty derived from the completeness tests.

Tuesday, June 15, 2010

June 15

Compeleteness

I finished the completeness calculation of the actual artificial star distribution today. The problem that I was finding with calibration yesterday didn't occur with the distribution I really want. From an email I sent to Beth:

The problem could be that I didn't (and still haven't) masked out any of the artificial stars. For the calibration I set a magnitude limit of r = 21.75 to only use reliable SDSS stars. My bright stars had r = 21.5 so if they overlapped with an SDSS star, they would've been included in the calibration and possibly screwed it up. In the real tests, there are very few stars that bright, so it's unlikely for an artificial star to meet the mag limit AND match the position of an SDSS star. The calibration for the real artificial star test is consistent with that of the true data, which tells me the calibrations aren't being affected by the presence of artificial stars.

I therefore assumed that the calibrations were good for the artificial data I was actually concerned about and decided to move on. I ran into some snags when I moved onto the completeness calculation itself. I worked with it for a long time and decided I just needed to take a break from it. I'm going to look at it again later tonight. I already have the code from the bright artificial star tests, so it should be a straightforward calculation, but apparently applying the code to the real tests is buggy.

Distance

In the meantime, I've begun coding up the distance calculation. I went back to Dave's paper to read how he did the calculation and its similar to how I'll be doing it. The outline of my technique is as follow:

1. Download a number of isochrones and fiducials with a range of metallicities and a few ages.
2. Match stars within 1 hlr of the center of Wil1 to these color-magnitude sequences within an envelope defined by the photometric error determined by my artificial star tests.
3. Do the same thing for an annulus representing the background sky in the field of Wil1, but far from potential member stars.
4. Count the number of Wil1 stars (member candidates - contaminants) which are consistent with the main sequence
5. Shift distance modulus of the sequences by intervals of 0.025 mag around what the approximate Wil1 distance modulus is ( m - M ~ 17.84). Repeat
6. Repeat steps 2-4.

Whichever distance modulus/metallicity combo matches the most member stars of Wil1 is presumed to be the best fit.

So far I have a detailed outline of the code and I've started to fill in the details. I'm going to spend some time tonight deciding exactly which fiducials/isochrones I want so that I can put them into the code in the morning. I'm hoping to have a full draft of the code by the end of the day tomorrow for debugging.

Paper

I have yet to get back to editing the paper, but I'll definitely make time before the week is out. Hopefully in the next couple of days I'll have a completed distance calculation code and be running Allframe so I'll have some extra time.

The Outside World
Today Jerry had a visitor, Michael Triantafyllou, aka the Director for the Center for Ocean Engineering at MIT. Apparently his son is interested in Haverford and was getting a tour. He gave a little talk for Jerry and his students, Peter and Andrew, and Mimi and me. He's doing research about the movement of fish as they swim. Apparently fish can stay beyond rocks for a long period of time, getting their energy from the flow of the water (!) and using very little of their own muscle power to stay there. His group is trying to recreate the technology, essentially building a fish. They're using a lot of MEMS to gauge pressure changes around vortices caused by turbulence behind obstacles in a river environment. I could go on about it, but it was interesting.

Tomorrow afternoon Peter Love is giving a talk about his research. I'll probably stop by for an hour.

Monday, June 14, 2010

Bright artificial star tests completed

I finished the allframe follow-up analysis and just visually checking my calibrated masterlist, it looked as though nearly 100% of the stars were found. That means when I go to do the completeness calculation, I expect good agreement.

I first went back to the completeness test Beth gave me--calculating the number of stars per magnitude for the true images, artificial input, and fake output images. I found a 98% approximate completeness sat 21.5. However, as I went to fainter magnitudes I found that I was about to calculate a higher than 100% completeness. This indicates to me that I'm likely finding all or most of the artificial stars, but I'm perhaps finding a few other stars which are not artificial and yet I'm counting as such.

After that initial test was looking reasonable (though not perfect), I went back to matching the artificial star output to the positions of the artificial stars I input. I matched positions for all stars with g < 21.5 (the bright stars I input all had g or r eq 21.5 for simplicity). I found 95.9% completeness. I went to fainter magnitude limits to make sure that I wasn't somehow picking up more stars (this seems like it could only be the case if my calibration or positions were off since all of my stars should be accounted for with a maglim of 21.5. And neither one of these scenarios is likely since they would result in systematic problems in the completeness and would probably reduce the completeness at 21.5 by far more than 4%.) In the 2006 paper, Beth was getting 100% completeness down to r eq 22.5 mag. Mine doesn't seem to be this good for the bright tests, so I wouldn't expect it to be as good for the real artificial star tests. However, I'm zen with a 96% completeness, especially if at fainter magnitudes the values are similarly reasonable. After all that, I've determined that my completeness calculation seems to be sane and that it was, in fact, a problem with the artificial start input. That's slightly comforting for my own sanity. Now that I've got the technique figured out and the code written, I'm going to apply it to the real images and re-do the artificial star tests from the beginning. I'll then re-do all of this analysis and hopefully come out with properly-calculated completeness levels in the end. I'll start Allframe running this afternoon and complete the calculations tomorrow morning. Real Artificial star tests:

I'll be inputting a grid of stars as defined in my fake CMD with a square spacing of 56 pixels. All of the stars will be located on all 18 exposures of chip 7 --that's a total of 1764 stars per run. After I calculate completeness values for the first run and determine that everything is working fine, I'll need to do more runs. At this point, I'm considering 30 runs in total, each time randomly generating new artificial stars which meet the same CMD critera. That will result in just over 52,000 stars used to calculate the final completeness. Each iteration of Allframe takes about 3 hours to run, which is a total of 90 hours. However, I can run multiple instances of Allframe at once. Last semester we found that running 8 at a time really bogged down Squid. However, running 4 at a time shouldn't be a problem. My current plan is to finish about 8 to 12 instances a day once I get the real tests started. That means it should all be done in less than a week.




Note: When I did the calibration of the bright stars, I found that the g-band zeropoint offset was about 0.3 higher than for the calibration of real data. The r-band appeared consistent with the calibration of the real data and both color terms were the same. I don't think the zero points should be different at all because they are determined from stars in our images matched to those in SDSS. Needless to say, the artificial stars I'm inputting shouldn't be influencing the matching to SDSS data and so the calibration stars should be the same. In an analysis like ours, 0.3 mag is a fairly significant margin. I'm going to move forward and see if the same happens in the actual artificial star testing (as opposed to the bright artificial star testing). If I get the same result, I'll have to look into it further.

Thursday, June 10, 2010

Bright star tests

Today I spent some time trying to understand how Addstar is working and where things are going wrong. In a word, that was a fail. Addstar seems to be skipping over some artificial stars that I've indicated in my input file and I couldn't find a reason for it to do so. As I mentioned yesterday, Addstar was inserting only those stars in every other row. I found that when I decreased the spacing of the artificial stars it was then inputting alternating columns and rows to give a diamond grid effect.

While I couldn't solve the mystery of Addstar, I decided to go ahead and do more testing using only bright artificial stars in order to find a way to troubleshoot the problem. I found that Addstar added the same pattern of artificial stars for a given spacing of stars. So as long as I am careful to keep my spacing the same or double check the resulting artificial star pattern in a bright star test for a new spacing, I figure I can reliably make a new file with only those stars addstar is actually inputting for comparison later when I calculate the completeness levels.

In addition to the spacing tests, I also went back to the original artificial star input to make sure that I was only inputting stars that appear on all exposures of the same chip. When I do my Allframe analysis, I require stars to have both g and r information (all of my input artificial stars do) and to be found in at least 2 exposures. (Because the exposures are dithered from one another, there could be stars near the edges that appear on only one exposure. My method for choosing my artificial stars before today would've meant this would only be the case near the edges of my reference frame, so it should not have had a huge effect, but I did this correction to eliminate the edge factor altogether.) It ended up just being easier to ensure that all of my artificial stars appear on the overlap of all exposures. This means I'm inputting fewer stars per Allframe run than I had previously. This is fine because I can always run more than 10 artificial star tests or further decrease the artificial star spacing per run to get more artificial stars for the end statistics.

My next project will be completing the effective Addstar files (including the positions and mags of only artificial stars that actually appear in the fake images). I've been thinking about whether it will be using to run Allframe on the bright artificial star tests. I'm not sure it will provide much more insight than running the actual tests will. Instead, I'll practice making the effective Addstar files and double checking the art star positions. Then I'll apply that technique to the real files and Allframe the real files again. I'll then go back to Beth's method of looking at the number of stars per magnitude on the true and artificial frames as compared to the input. If there are still major problems, it might worthwhile to do the full Allframe analysis on the bright artificial star images.


Notes:


For now, I've settled on a 50 pix spacing in both the x and y directions. I've determined that the area that overlaps all exposures has coords
xmin = 439.4917
xmax = 3989.424
ymin = 251.866
ymax = 1840.46

I rounded the min values up and the max values down for good measure. In all, I'm inserting 70 stars in the x direction and 31 stars in the y direction. r181 still have signficant astrometry problems, so I've ignored it when calculating these values (it's one of the 2 exposures that's not used in the analysis, so I haven't even bothered to run it through DAOphot and Allstar. r183 is the other, but it will at least generate an allstar output in the usual amount of time, so I run it with the others for simplicity, though it is not used at all in the Allframe analysis.)

Ideas about Addstar:

Just talked to Beth about a few other things to consider when figuring out the best way to work with Addstar. First, I'll generate a fraction of the stars I currently have to see if we're somehow exceeding a limit Addstar has for the number of stars that can be input at one time. The second idea is to just cut the spacing in half to see if I can get the spacing I had wanted in the first place. I mentioned this idea yesterday and it's the desired way to do things because we want to fit a reasonable max number of stars into each AST so that we can cut down on Allframe computing time. Additionally, it'll be easiest to generate the effective Addstar file using this approach. Right now, the easiest spacing for that seems to be 56 pix in either direction, but tomorrow morning I'll try larger pixel spacing, perhaps 28 pix (half the original) to see what the pattern looks like.

Tuesday, June 8, 2010

Completeness problem found!

I was still having completeness problems up until group meeting this afternoon. So Beth gave me some suggestions to sanity check things in more detail. I went back to the image files of the original data, artificial star data, and art star-subtracted data. Turns out half of the stars I was inputting weren't showing up. I looked for stars brighter than 21.5 mag and wasn't finding most of them. So, again at Beth's suggestion, I created a new .add file of artificial stars that all had a magnitude of 20 (clearly bright enough to see by eye). When I ran this file through DAOphot, Addstar, and Allstar, every other row of artificial stars were missing. That would explain at least in part why I wasn't finding many artificial stars.

This is more or less taking me back to square one but that's a good thing in this case. I need to take a look at how I'm running addstar and see if there's an obvious solution. Otherwise I think I could just troubleshoot the problem by putting in twice as many stars with half the spacing in the vertical direction (to get the originally intended effect). Then before calculating completeness I'll just need to create a .add file with the artificial stars that actually appear in the output of addstar.

Making the addstar fix is next on the agenda and will hopefully alleviate all of my problems, but we'll see. I'm also still going to check the aperture photometry on a few of the stars in the artificial images to be sure that the photometry is looking sane. I'll check both the bright grid and the one generated from the fake CMD.

Tomorrow is AstroPhilly! So I won't be doing much of this tomorrow, but I'll be back to it on Thursday.

Monday, June 7, 2010

June 7 Update

Today I worked on finishing up the data section of the paper and proofreading what I have. I sent the draft of the first 2 sections to Beth for comments.

I also went back to looking at the completeness stuff and going through it very carefully. Beth gave me an alternate calculation to try. Instead of matching positions, she recommended I match based on CMDs to see what the completeness levels are looking like. That way I'll know if it's still a problem with the position transformations or if Allframe simply isn't finding the stars. There are a few things that are complicating this process. The first was the error in positions. The second is that I can't be sure that the magnitudes coming out of the pipeline are matching those I put in. I'm getting the sense that this isn't a huge concern, but I'll need to test this hypothesis thoroughly tomorrow.

Tomorrow is finishing the coding on this new completeness calculation. There's also group meeting and Bruce's talk in the afternoon.