-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redmapper conditional luminosity function test #102
Conversation
@chto thanks. I haven't looked at the code in detail but wonder if this test can be consolidated with the existing code in |
@yymao I am not sure. descqa/clf_test.py mainly deals with halo catalog, while this one deals with redmapper catalog, which requires consideration of limiting magnitude, membership probability, etc. |
@chto hmm, ok. I'll have to take a closer look at the code to be sure. My thought was that test can use different sources (true halos or redmapper groups) as halos. In the case of true halos, the membership probabilities are just 1 and 0. Anyway, I'll come back to this tomorrow. |
@chto also, can you clean up the code a bit. In particular,
Also, there's a large number of |
@yymao Sure. I will try to make this more readable shortly. |
@yymao I tried to make the code more readable and tried to avoid "for i in range" statement. But, there are still places where I need the index of the array, so I cannot avoid that statement completely. |
… could be automatically installed
@chto thanks. I'm traveling this week but will try to find time taking a look at your updates. |
@yymao @j-dr I add the clf measurement on sdss as a validation data. |
@evevkovacs, However, I notice that |
@rmjarvis @chto Is this the correct kcorrect_python, that's the webpage linked form pypi? My attempt to do a pip install failed, using the tarball and just doing a |
Oof. The only |
Oh dear. This doesn't seem like a good solution after all. Should we go back to Erin Sheldon's version https://github.com/esheldon/kmeans_radec |
kcorrect_python has nothing to do with the TreeCorr kmeans. This is an orthogonal issue. |
The last commit to kcorrect_python was over three years ago. I'd probably recommend not using that and finding some other package that can perform the same (or equivalent) calculation. Maybe something in astropy? |
There is nothing in astropy that does "kcorrections" (TM). Depends on what functionality we're using on how hard it is to put together a replacement. |
Sorry I misunderstood the nature kcorrect_python issue. |
Yeah, I found some discussions about making an affiliated package for kcorrect, but it doesn't seem to have gone anywhere. What I did find was the astrophysics package, which claims to implement the Blanton k correction: |
Ugh. Never mind. That project also seems to be defunct now. :( |
I can't find anything that does this as part of a maintained python package. OTOH, the license for kcorrect_python is listed as "Public Domain", so you could just copy the relevant parts of that code into this repo, make them work for python 3, and then just use that going forward. That would be better IMO than depending on an unmaintained package. |
@chto. How critical is to run this kcorrect_python for the test? Could it be dropped? Alternatively, could it be applied one time to the validation data, so that we don't need to run it each time for the test? I am not sure how the module is used, so I am just throwing out ideas for how to get around the issue. |
Want to echo @evevkovacs's comment above --- When I was cleaning up the test code in this PR, I already made If approximated k-correction is acceptable, you can also consider using http://kcor.sai.msu.ru/calc_kcor.py --- This is not a package but a single python function that contains fitting functions for approximated k-correction. The source is licensed under BSD so we could include it in our source with proper attribution. |
@yymao I think it is the other way around. The k-correction is done on the simulated catalog in the same way as we do on the comparison data. I think maybe we can remove k-correction on both side but there will be an issue if the filters used in the simulation are different from the comparison data (SDSS). Further, I don't think the approximated k-correction mentioned above can handle arbitrary filters. Here is my proposal:
|
@chto --- thanks, that sounds like a good solution to me. If you can help implement it that'd be great. |
@yymao Sure. Working on it. |
@chto @yymao I took a quick look in the code and noticed that "possible_mag_fields" includes only "mag_{}lsst". (You are trying to compare to SDSS data, and that is why you are doing k-corrections, right?) But did you know that cosmoDC2 has SDSS magnitudes already available ('mag{}sdss')? I would suggest prepending 'mag{}_sdss' to the list of possible_mag_fields and if they are available, also skipping the call to kcorrect. This would be a minor modification to step 1, above. There are also fits to k-corrections between various filters in CheckColors.py derived by Nacho Sevilla. |
@yymao @evevkovacs I have implemented suggestions above and the code runs on proto-dc2_v3.0_redmapper. However, I also notice that it cannot be run on cosmoDC2_v1.1.4_redmapper_v0.5.7, because the naming conventions are different and also miss a required field, lim_limmag_dered. Also, there is no SDSS magnitudes in cosmoDC2_v1.1.4_redmapper_v0.5.7. |
@chto So you could add a variable like possible_redmapper_quantities and list the allowed values that work for both redmapper catalogs, and then use the grc function "first_available" to get whichever one is given in the version of the catalog is being used. Please ask @erykoff about lim_limmag_dered; I would think that there is a substitute or work-around for this quantity. For the missing SDSS magnitudes, why not use the conversion from lsst to sdss filters that I pointed you to in CheckColors.py . Thanks |
@evevkovacs |
@chto Sorry I wasn't clear. I wanted to run on cosmoDC2_v1.1.4_redmapper_v0.5.7 and was suggesting that you use the lsst to sdss conversion in CheckColors.py to get around the problem of not having mag_{}_sdss available. |
I have implemented a conditional luminosity function measurement on redmapper catalog. [as discussed in #9 ] The run on protoDC2-v2 redmapper catalog looks like
![clf_redmapper](https://user-images.githubusercontent.com/16754618/38536353-967bf652-3c3d-11e8-9b05-0f50a9278c38.png)
[I somehow got permission denied to the DESCQA web directory, so I cannot post the link ].
Pining @j-dr @yymao @erykoff as interest parties.
[Edited by @yymao: This PR fixes #9 ]