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

Light quickquasars #552

Merged
merged 4 commits into from Feb 23, 2021
Merged

Light quickquasars #552

merged 4 commits into from Feb 23, 2021

Conversation

alxogm
Copy link
Contributor

@alxogm alxogm commented Feb 16, 2021

We identified the need to have a lighter version of quickquasars mocks, in order to produce several realizations of them. We are reducing the file size by not saving the resolution matrix for each quasar in a pixel, since it is actually the same one. Instead we save only one resolution matrix once in the truth files.

We also identified we were saving the continuum with a very fine wavelength bin size, so we changed it from 0.2 to 2.

These changes allows to reduce the files for one pixel as follows:

Original
498M 0.4-1/spectra.fits
257M 0.4-1/truth-16-0.fits
596K 0.4-1/zbest-16-0.fits

This branch
102M 0.4-light1/spectra.fits
27M 0.4-light1/truth-16-0.fits
596K 0.4-light1/zbest-16-0.fits

One we check a full run proceeds without errors, I'll change it to ready for review. @jvstermer it would be good if you can test that the the wavelength binsize for the continuum is good enough.

@moonlovist it would be very useful if you can test this branch too. Thanks for your help identifying where to improve.

alxogm added 2 commits February 14, 2021 22:50
- fixed bug in saving continuum
Changed flag to save resolution matrix
@alxogm
Copy link
Contributor Author

alxogm commented Feb 16, 2021

A full run was successful. Comparison of two runs with the same options:
770G /global/cfs/projectdirs/desi/mocks/lya_forest/develop/london/qq_desi/v9.0/v9.0.1/desi-1.4-4/spectra-16/
133G /global/cfs/projectdirs/desi/users/alxogm/desi/mocks/qq_cheksize_full/spectra-16

@andreufont I think this is ready for review.

@alxogm alxogm marked this pull request as ready for review February 16, 2021 07:55
Copy link
Contributor

@andreufont andreufont left a comment

Choose a reason for hiding this comment

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

@alxogm - these changes look great, and the improvement in disk space is amazing. I only added a couple of minor comments asking for documentation.

py/desisim/scripts/quickquasars.py Show resolved Hide resolved
py/desisim/scripts/quickquasars.py Show resolved Hide resolved
use_poisson : if False, do not use numpy.random.poisson to simulate the Poisson noise. This is useful to get reproducible random realizations.
use_poisson : if False, do not use numpy.random.poisson to simulate the Poisson noise. This is useful to get reproducible random
realizations.
save_resolution : if True it will save the Resolution matrix for each spectra. False is useful for mocks to save diskspace.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add that if save_resolution=False, this function returns a resolution matrix.

@Waelthus
Copy link

Waelthus commented Feb 16, 2021

There will be minor changes to picca required for those data. The resolution HDUs are still there if I got the change right, so reading them should not be an issue. There is a minor issue about reading for Pk1d, it's a simple fix, but I'm not completely sure right now if you're storing it in 2d (ndiag,npix) or 3d (1,ndiag,npix) format. And is the new mode encoded somewhere in the headers? Depending on that I can fix the picca part of it easily...
Can't test at the moment due to not having permission for the new mocks.

@alxogm
Copy link
Contributor Author

alxogm commented Feb 16, 2021

Thanks @andreufont, I think I have addressed your comments, and @Waelthus has access to the mock for adding a fix to picca. some tests are not passing, but I think is due to some warnings not related to this PR.

@andreufont
Copy link
Contributor

andreufont commented Feb 16, 2021

The changes look great, happy for me to merge the PR.

Not sure whether we should worry about the failed Travis tests though...

@alxogm
Copy link
Contributor Author

alxogm commented Feb 17, 2021

The changes look great, happy for me to merge the PR.

Not sure whether we should worry about the failed Travis tests though...

I tried restarting the tests a couple of times, but they fail and I see only warnings, unrelated to this PR. @sbailey or @weaverba137 Could you confirm is ok to merge? Thanks!

@alxogm
Copy link
Contributor Author

alxogm commented Feb 23, 2021

The changes look great, happy for me to merge the PR.
Not sure whether we should worry about the failed Travis tests though...

I tried restarting the tests a couple of times, but they fail and I see only warnings, unrelated to this PR. @sbailey or @weaverba137 Could you confirm is ok to merge? Thanks!

Hi @sbailey, maybe you missed this, can we merge even though some tests unrelated to this PR are not passing?

@sbailey
Copy link
Contributor

sbailey commented Feb 23, 2021

Thanks for pinging me again. Yes it's ok to merge despite the "suspiciously low XYZ flux..." unrelated errors.

@sbailey sbailey merged commit 7048de7 into master Feb 23, 2021
@sbailey sbailey deleted the light_quickquasars branch February 23, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants