Closed aamirmali closed 4 years ago
@msyriac is also invited to comment on this.
combined_solardip
map which contains all components, or pick them yourself, is N_side 4096 enough?SONoiseSimulator
object with survey_efficiency
and LA_years
/SA_years
to scale to a short scan, then call simulate
and provide hitmap
as an array or a filename.Never tested this before, please notify down here if anything breaks and provide example notebook.
@aamirmali , this is an interesting use case! For the noise, you can do both, i.e. specify your custom hitmap, and also re-scale the white noise level.
def simulate(
self,
tube,
output_units="uK_CMB",
seed=None,
nsplits=1,
mask_value=None,
atmosphere=True,
hitmap=None,
white_noise_rms=None,
)
You provide the hitmap with the hitmap argument (assuming you don't want the default one for that tube), and you provide the new white noise level in white_noise_rms. Note that both the 1/f and white noise parts will be rescaled by the same factor.
If you use this in "CAR" mode (i.e not healpix), this will be very efficient for small patches. I think ACT folks use a TAN projection for planet mapping, so if you really want that, I could modify some of the CAR-specific aspects to be more general.
As for the CMB+foregrounds part, similar considerations apply in terms of getting this more efficiently in "CAR" mode. However, I think the API for this is a bit under-developed. Do you need multiple realizations of CMB+foregrounds as well (well, only multiple realizations of CMB would be possible in our current framework anyway), or do you just need multiple realizations of the instrument noise?
@msyriac and @zonca
Thank you so kindly for the helpful replies! fair warning If my questions are novice level, but I wasn't quite able to get things working as expected.
for starters, I'm a bit more familiar with healpy than pixell, so when I got an error when trying the CAR way, I just decided to stick to healpy at least as a first attempt. I instantiated the SONoiseSimulator object with the LA_years = 1 (since this is an int and that was the lowest I could give) and gave a ridiculously low scan_efficiency corresponding to 8 minutes/1 year (the approximate duration of a single candidate planet scan I'm studying). Since that is passed early in the simulator object, I'm not sure how this noise depth is processed: does it scan the entire LAT sky fraction with this low scan efficiency and then you can subselect some part of that at an already set depth with the hit_maps, or does it assign the appropriate noise weighting respecting the hit_maps (i.e. concentrating all those 8 minutes of sensitivity on that small patch)? if not, I can try to think about how best to compute a wnl rescaling as Mathew suggested.
In any case, I wasn't able to load the hitmap in the simulator function. I have my hitmap as a .fits file outputted from toast. Is that not the right format? I have a minimal working example as an ipynb, but I can't attach that to this issue. Should I send as an e-mail?
Thank you both so much for your help!
best is if you paste the notebook content (drag into the text box) into gist.github.com and put link here
https://gist.github.com/aamirmali/d1cff8670b9de2e816c46a777d135d90
sure! thanks so much.
The noise sim code is set up to simulate dichroic arrays, so the hitmap is expected to be a (2,npix) array, where the first dimension indexes hitmaps for each of the two arrays.
First pass seems to have worked. Will have to check on the normalization for the WNL, but will check that likely tomorrow (and/or if you know if it assigns all the integration time to that patch with hits). Thanks so much for help getting started!
Correct, the length of the observation defines the noise level in the map, whatever the sky coverage.
Then the hitcounts relatively scales the pixel noise.
When you have validate this could you please share the notebook and also your hitmap?
This is a great example to add to mapsims_tutorials
@aamirmali do you mind to share your notebook? I would like to turn it into an example for the tutorials, thanks
@aamirmali do you mind to share your notebook? I would like to turn it into an example for the tutorials, thanks
thanks @aamirmali for the notebook, see https://gist.github.com/aamirmali/0bd0bfeab5fb00aa67d05c5e6838c12e
I added a notebook based on this to the mapsims
tutorials: https://github.com/simonsobs/mapsims_tutorials/blob/master/4a_noise_onthefly_customhitmap.ipynb
I'm wondering if there is a way to implement a simulation of a short duration targeted but high resolution observation and get the appropriate noise and sky models. For instance, if we did a short (hours) targeted scan of a small patch (like I would do if I were scanning a planet) it would have the appropriate noise and map depth etc. from the short scan and include the appropriate sky components (CMB, dust, etc). I'm particularly interested in producing several realizations. I can do this in Toast in TDS, but it is computationally intensive to generate and map multiple realizations over all optics tubes/frequencies. I see that MBS can take in hitmaps from e.g. toast (I have hit maps) but the "on the fly" tutorial seemed to indicate that it used the hit maps only for relative weighting, not for scaling the actual noise (which I think is set by years of observation etc.). Maybe MBS isn't the right way to do this and I should just keep using TDS?