drphilmarshall / OM10

Tools for working with the Oguri & Marshall (2010) mock catalog of strong gravitational lenses
MIT License
8 stars 19 forks source link

Diagnostic Plots for Painted Lenses and Sources #50

Closed jennykim1016 closed 7 years ago

jennykim1016 commented 7 years ago

I hope you are enjoying Christmas holidays! I was able to draw three diagnostic plots for the lenspop paint method. It would be really helpful if you could give me some advice on them.

Do the quasar colors reasonable?

../notebooks/QuasarColorComparison.ipynb contains a cornerplot that checks it. This seems okay. The blue ones(painted ones) lie close to the red ones(samples from KIPAC statistics course).

Are the colors of your lens galaxies reasonable, compared to the SDSS LRGs?

../notebooks/LensColorComparison.ipynb contains a cornerplot that checks it. The blue ones(painted ones) and the red ones(known samples of SDSS) seem a bit off.

Do the i-band magnitudes of the lens galaxy match the previous estimates, in the APMAG_I column?

../notebooks/IMagComparison contains two scatter plots that check it. Those are at the very bottom of the notebook. I was not able to find any information about magnitude errors in the sample, but I think the calculated magnitudes and the known magnitudes are significantly different. The differences are not even centered around zero; they are centered around 2.

So, the magnitude of quasars look fine, but the magnitude of lensing galaxies look a little bit off. I think this is because I naively chose the SED of M82(an irregular starburst galaxy) as a SED of all lenses. One little problem with testing which SED would be the best is that the code really takes a lot of time to compute magnitudes. I think there will be a smarter approach than trial-and-errors, but right now, manually testing with different SEDs and check which have the least differences is the only idea that I have.

There are a few files that look like they were added other than these files after the first pull request. However, they are not new. color.py and color_demo.py are the same python files with exactly the same codes. My computer sometimes imported a module called color rather than color.py, so I just made a copy of color.py and used when I needed it. I renamed old Graph.ipynb to LenspopMagnitudeGraph.ipynb because it no longer seems clear which graph that the notebook is referring to. This notebook contains a simple plot of painted magnitude for both a quasar and a lens.

In addition, would there be any reason why plotting.py in om10 calls matplotlib.rc('text', usetex=True) at the very beginning? Whenever I tried to use matplotlib, this line gave me an error, so I had to call matplotlib.rc('text', usetex=False) in the notebook.

Thank you so much!! Have a great end-of-the-year.

jennykim1016 commented 7 years ago

I hope you are having a great start of another quarter!

Now I am at UCLA for the Conference for Undergraduate Women in Physics. I think I finished fixing everything that you pointed out in the previous comment. However, I still get a weird results for notebooks/IMagComparison.

notebooks/IMagComparison compares the real magnitude with the calculated magnitude of the elliptical galaxies. I think the differences should be centered around zero if I am calculating it correctly. I used M82 SED as a template in my first attempt, and the differences were centered around 2. As M82 is not an elliptical galaxy, I thought the choice of wrong SED would be a source of error. I used a few different SEDs of elliptical galaxies, but this did not change the results significantly.

I checked my calculations for a few different times, and it seems the equations in the paint method themselves do not contain errors... If there is a way to check how off the magnitudes of quasars are, that might really help -- would there be any way to diagnose how accurate the magnitude of quasars would be?

Thank you!

drphilmarshall commented 7 years ago

Hi Jenny! Hope you had a good trip to LA. I took a look through your notebooks, some nice work in there. Well done! I see there's some package cleanup to do, to get things importing properly, and then the notebooks can be simplified some I think.

For the lens galaxies we need a redder SED, since most lens galaxies are massive elliptical galaxies dominated by old stellar populations. In the stellarpop templates folder there are some useful looking options: try BC_Z=1.0_age=9.000gyr.sed

For the quasar magnitudes, here's a file that contains SDSS quasar magnitudes and redshifts for you to read in and compare with your synthetic magnitudes and colors: https://github.com/KIPAC/StatisticalMethods/blob/master/examples/SDSScatalog/data/qso10000.csv

In your corner plots, I see some extreme colors and magnitudes, coming from the comparison samples: you might need to remove those before you plot.

To simplifiy the notebooks, I recommend only producing one cornerplot per notebook, the one that enables the comparison between samples. You might want to play around a bit with the number of pixels to improve the visual appearance - and note that you can use smooth=1 as an option to remove the pixelated effect of the histograms.

Have fun!