Skip to content
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

red sequence validation test #101

Merged
merged 19 commits into from
Nov 30, 2023
Merged

red sequence validation test #101

merged 19 commits into from
Nov 30, 2023

Conversation

j-dr
Copy link
Contributor

@j-dr j-dr commented Apr 9, 2018

I've implemented a red sequence validation test as discussed in #41. The latest run of this test can be found here: https://portal.nersc.gov/project/lsst/descqa/v2/?run=2018-04-08_16&test=RedSequence_DES_Y1&catalog=proto-dc2_v3.0.

I'm currently comparing to DES Y1, but don't have concrete validation criteria implemented yet. I'm using the actual redmapper catalog as run on protoDC2_v3.0 in order to calculate the red sequence. This is not totally ideal, since if the red-sequence training has issues as it does in this case, then this is not a totally accurate measure of the red sequence.

Pinging @erykoff, @aphearin, @yymao as interested parties.

[Edited by @yymao: This PR fixes #41 ]

@j-dr
Copy link
Contributor Author

j-dr commented Apr 9, 2018

Hmm, looks travis has an issue with how I'm loading the redmapper catalog in the test that wasn't showing up in my runs. @yymao do you have a preferred way for me to do this.

@yymao
Copy link
Member

yymao commented Apr 9, 2018

Thanks, @j-dr!

Indeed, while the code you post here can actually be run without issue, our design is that the tests should agnostic about the catalogs and the tests should not need to know how to import/load catalogs, and that's why GCRCatalogs should not be imported. The "correct" way to fix this issue is either (1) to modify the add-on reader such that it also includes all the original quantities or (2) to modify the GCRCatalogs API to give users a new way to directly grab the add-on catalog (without calling GCRCatalogs.load_catalog again). I need to think about this a bit more.

(cc @EiffL because he's writing tests for add-on catalogs as well)

except:
return TestResult(skipped=True)
print(redmapper)
redmapper = redmapper.get_quantities(['galaxy_id'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j-dr is the only thing you need in this test the galaxy_id in redmapper?

@j-dr
Copy link
Contributor Author

j-dr commented Jul 27, 2018

I just updated this PR to use the base extragalactic catalogs only. It now shows the full distribution of colors for centrals, and the mean and scatter of the color distributions in mass bins. This will be more useful for eyeballing and identifying issues like ones that have come up with discontinuities in g-r with mass and the like. See test output at https://portal.nersc.gov/project/lsst/descqa/v2/?run=2018-07-27_18&test=RedSequence_DES_Y1&catalog=protoDC2_test. Not very pretty yet, but you get the idea. @erykoff @yymao @evevkovacs @aphearin

@yymao
Copy link
Member

yymao commented Aug 16, 2018

Responding to this earlier comment #101 (comment) : we now finally have really redmapper add-on that we can use (e.g. proto-dc2_v4.3_addon_redmapper), and we no longer need to import GCRCatalogs within the test.

I can take a stab to make the necessary changes. @j-dr, is that ok with you?

@yymao yymao closed this Aug 16, 2018
@yymao
Copy link
Member

yymao commented Aug 16, 2018

Sorry, mis-hitted the close button..

@yymao yymao reopened this Aug 16, 2018
@yymao
Copy link
Member

yymao commented Dec 5, 2018

@j-dr The new composite catalog allows you to access the main catalog and the redmapper add-on with a single catalog input, and hence remove the need of loading another catalog during the test.

In particular:

import GCRCatalogs
gc = GCRCatalogs.load_catalog('proto-dc2_v4.3_addon_redmapper')

# to obtain quantities from the main protoDC2 catalog, use `gc.master`
gc.master.get_quantities(['galaxy_id'])

# to obtain quantities from only entries that are redmapper galaxies
gc.get_quantities(['galaxy_id']) # you will obtain a dictionary of masked arrays

# use `.compressed()` to make a masked array regular array, with masked entries removed.
gc.get_quantities(['galaxy_id'])['galaxy_id'].compressed()

@yymao
Copy link
Member

yymao commented Dec 5, 2018

Here's the output of the code snippet above:
image

Copy link
Member

@yymao yymao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments to simplify some of the code

descqa/RedSequence.py Show resolved Hide resolved
descqa/RedSequence.py Outdated Show resolved Hide resolved
'mag_true_{}_sdss',
)
self.possible_mag_fields = [[f.format(self.bands[i]) for f in possible_mag_fields]
for i in range(len(self.bands))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify Lines 55-56:

self.possible_mag_fields = [[f.format(band) for f in possible_mag_fields] for band in self.bands]

descqa/RedSequence.py Outdated Show resolved Hide resolved
mag_fields = []
for i in range(len(self.bands)):
mag_fields.append(gc.first_available(*self.possible_mag_fields[i]))
quantities_needed.add(mag_fields[i])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify Lines 78-81

        mag_fields = [gc.first_available(*fields) for fields in self.possible_mag_fields]
        quantities_needed.update(mag_fields)

descqa/RedSequence.py Outdated Show resolved Hide resolved
descqa/RedSequence.py Outdated Show resolved Hide resolved
descqa/RedSequence.py Outdated Show resolved Hide resolved
Co-authored-by: Yao-Yuan Mao <yymao.astro@gmail.com>
evevkovacs and others added 2 commits November 29, 2023 15:49
Co-authored-by: Yao-Yuan Mao <yymao.astro@gmail.com>
Co-authored-by: Yao-Yuan Mao <yymao.astro@gmail.com>
@evevkovacs
Copy link
Contributor

Sorry for the delay in reviewing this. The email got lost in my stack.

evevkovacs and others added 2 commits November 29, 2023 19:31
Co-authored-by: Yao-Yuan Mao <yymao.astro@gmail.com>
@yymao yymao merged commit 1a9ddae into LSSTDESC:master Nov 30, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

red sequence colors (mean, scatter) as a function of redshift
3 participants