drphilmarshall / OM10

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

Simple LensPop magnitude calculation demo #46

Closed drphilmarshall closed 7 years ago

drphilmarshall commented 7 years ago

While figuring out #45 you can make a very short notebook that simply uses the ABFilterMagnitude function from lenspop.stellarpops to compute apparent magnitudes in the ugrizy filters given an AB absolute magnitude in the rest-frame r band, as computed by lenspop.EarlyTypeRelations. If you begin this notebook with import lenspops you'll then need to edit your local clone of LensPops until the functions you need can indeed by imported as a package. For a typical lens galaxy, you can assume vdisp=250.0 and zd=0.4. For a typical AGN source, you can assume 2.0, and you'll need to figure out how LensPops assigns quasar sources their absolute magnitudes. Nice if you can lay out the calculation so the K-corrections are separate from the distance moduli. Have fun!

jennykim1016 commented 7 years ago

@drphilmarshall I think I made a graph that calculates rest frame apparent magnitude in r, g, i, z bands. graph

Would there be any good way to test whether the magnitudes that I calculated are reasonable? Knowing that the HST's limiting magnitude is around 22, I think AGN's apparent magnitude should be at most around 22-23.

I have been pushing the changes to the fork, and the code that calculates the magnitudes is color.py, and the demo notebook is Graph.ipynb. color.py code needs more decompositions, comments, and stylistic improvements because the code is a bit hard to read right now. I will keep working on it!

Thank you so much, and have a nice weekend.

jennykim1016 commented 7 years ago

@drphilmarshall Assuming that I calculated the reasonable magnitude above, I modified OM10 code and calculated the magnitude. I pushed all the updates including python codes and notebooks to my fork. I did not make a pull request to your original directory yet.

The demo notebook is Graph.ipynb, the code used to produce demo notebook is color.py, and the final notebook showing the colored output is OM10/notebooks/Painting with lenspop.ipynb. The only problem I have is that the code takes too long time to compute magnitudes for around 15,000 lenses - it took 18 hours to finish running. Still, the magnitude seems reasonable - there are some outliers between 14-16, but most of them are near 20. Could you please check the final results? If everything looks okay, then I will make a pull request.

I will fly back to Korea next Friday, and I think I would have plenty of time to study and work on codes during the vacation. I think this was the only task given to me; would there be anything that I could study on/work on during the winter vacation?

Thank you!

drphilmarshall commented 7 years ago

That's great, Jenny! You should start the pull request right away, so that we can easily view and comment on your new code. I took a look at your painting notebook: very good to see that your code is robust enough to cope with all systems. It looks like you have not pushed Graph.ipynb, but that's OK - let's just work on one notebook, painting with lenspop. First thing will be to make a smaller sample of lenses to work with! (Also, note that when you choose the synthetic option, you don't need to provide any filenames.)

The first plot you made looked promising to me, but now let's make some more "diagnostic" plots, in the painting with lenspop notebook. The goal is to find the problems with our approach so that we can solve them.

To get the updates I made (including the tutorial notebook) you need to git pull from the base repo. First you make a new remote connection to it, and then pull like this:

git remote add base https://github.com/drphilmarshall/OM10.git
git pull base master

Watch out: if this causes conflicts you will need to read the message carefully, and edit the files that contain conflicts until everything works again. (Search for <<<<<< and >>>>>> in the files to make sure you have found them all.)

drphilmarshall commented 7 years ago

Closed via #49 !