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

External noise curves and hitmaps #73

Merged
merged 18 commits into from
Aug 6, 2020
Merged

External noise curves and hitmaps #73

merged 18 commits into from
Aug 6, 2020

Conversation

wcoulton
Copy link
Contributor

@wcoulton wcoulton commented Jul 28, 2020

The functionality of the SONoiseSimulator class has been extended so that external noise curves and hitmaps can be used to simulate maps. This was done by slightly restructuring the noise.py module so that there is a shared base class, and SONoiseSimulator and ExternalNoiseSimulator derived classes. A test/ example file: tests/test_noise_extern.py is supplied to show how to use the code and to check that the ExternalNoiseSimulator and SONoiseSimulator produce the same output if using the same noise curves and hitmaps.

(Partially addresses #47 )

@wcoulton wcoulton requested a review from msyriac July 28, 2020 13:46
@msyriac msyriac changed the title External noise curves and bitmaps External noise curves and hitmaps Jul 28, 2020
Copy link
Member

@zonca zonca left a comment

Choose a reason for hiding this comment

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

Very useful contribution, thanks!
Just a bit of feedback,
can you make sure that the test function runs as part of the test suite?


# An example simple survey with external noise curves and hitsmaps.
class surveyFromExternalData:
def __init__(self,nbands,fwhms,noise_ell=None,noise_TT=None,noise_PP=None,noise_files=None,hitsmaps=None,hitsmap_filenames=None,ivar_maps=None,ivar_map_filenames=None,white_noises=None):
Copy link
Member

Choose a reason for hiding this comment

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

need to run black on this

nside = 16
SONoiseSimulator = mapsims.noise.SONoiseSimulator(nside=nside)

ell, noise_ell_T, noise_ell_P = SONoiseSimulator._get_survey('LT3').get_noise_curves(
Copy link
Member

Choose a reason for hiding this comment

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

I think get_survey should not have an underscore, it seems pretty useful to use externally


# Test that this code and the SONoiseSimulator agree if the above used the same noise curves and hitsmap.
nside = 16
SONoiseSimulator = mapsims.noise.SONoiseSimulator(nside=nside)
Copy link
Member

Choose a reason for hiding this comment

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

better call the object lowercase, like noise_sim

soNoiseSim = SONoiseSimulator.simulate('LT3',seed=1)


externSurvey = surveyFromExternalData(6,fwhms=[1.]*6,noise_ell=ell,noise_TT=noise_ell_T,noise_PP=noise_ell_P,hitsmaps=hitsMaps_all)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't fwhms have units?

@zonca
Copy link
Member

zonca commented Aug 6, 2020

this is good, thank you very much for working on this, CI is failing but is unrelated, I'll merge this and work on fixing that next

@zonca zonca merged commit c869c42 into master Aug 6, 2020
@zonca zonca deleted the externalNoise branch August 6, 2020 22:55
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.

3 participants