-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
There was a problem hiding this 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?
mapsims/tests/test_noise_extern.py
Outdated
|
||
# 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): |
There was a problem hiding this comment.
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
mapsims/tests/test_noise_extern.py
Outdated
nside = 16 | ||
SONoiseSimulator = mapsims.noise.SONoiseSimulator(nside=nside) | ||
|
||
ell, noise_ell_T, noise_ell_P = SONoiseSimulator._get_survey('LT3').get_noise_curves( |
There was a problem hiding this comment.
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
mapsims/tests/test_noise_extern.py
Outdated
|
||
# 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) |
There was a problem hiding this comment.
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
mapsims/tests/test_noise_extern.py
Outdated
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) |
There was a problem hiding this comment.
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?
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
Co-authored-by: Andrea Zonca <[email protected]>
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 |
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 )