galsci / mapsims

Map based simulations software for CMB Experiments
BSD 2-Clause "Simplified" License
3 stars 1 forks source link

first try at getting lensed CMB maps in #4

Closed ajvanengelen closed 5 years ago

ajvanengelen commented 5 years ago

This is a tweak of a similar implementation in actsims https://github.com/ACTCollaboration/actsims/blob/96f4b98d9e580c33fb73f1334f476817b0286782/actsims/simTools.py#L24

This is just draft code and has not been tested! But we (Mat and Alex) are submitting it for a first review.

It is decoupled from the actsims repo but by default will load up the same lensed alm's.

ajvanengelen commented 5 years ago

Indeed. Even putting aside bandpass integration for now, passing even just the central frequencies would be better than passing an integer nfreqs. In actsims I pass around lists such as [‘f150’] or [‘f090’, ‘f150’]. What will we do in mapsims?

On Dec 6, 2018, at 12:45 PM, Mathew S. Madhavacheril notifications@github.com wrote:

@msyriac commented on this pull request.

In mapsims/cmb.py https://github.com/simonsobs/mapsims/pull/4#discussion_r239548765:

  • returns (nfreqs,ncomp,Ny,Nx) rectangular pixel ndmap.
  • '''
  • ncomp = 3 if pol else 1
  • filename = _get_cmb_map_string(cmb_dir,iteration_num,cmb_set,lensed,aberrated)
  • The hdu = (1, 2,3) means get all of T, E, B

  • Note the alm's are stored as complex32, so upgrade this for processing

  • alm_teb = np.complex128(hp.fitsfunc.read_alm(filename, hdu = (1,2,3) if pol else 1))
  • Here we can multiply the alms by the appropriate beam;

  • hp.sphtfunc.almxfl can be used. Not included yet. Once we

  • do, we will have to call the inverse SHT nfreqs times, as in actsims.

  • if nside is not None:
  • Then we are outputting a healpix map

  • map_tqu = hp.alm2map(alm_teb, nside)
  • output = np.tile(map_tqu, (nfreqs, 1, 1)) # if nfreqs>1 else map_tqu
  • Here we want to multiply the map by the modulation factor. FIXME: not implemented yet

    So instead of nfreqs, we'll need some way to specify the frequency bandpasses in the interface to this function right? Should we go with some effective central frequency? Or do we want to do a bandpass integration? What will PySM be doing?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simonsobs/mapsims/pull/4#discussion_r239548765, or mute the thread https://github.com/notifications/unsubscribe-auth/APAXHDMLYVBDTYsJrTDDJfo0bigj7MFhks5u2VfEgaJpZM4ZFxor.

msyriac commented 5 years ago

I've made a first pass at integrating mapsims.cmb and so_pysm_models.alms. Could you have a look?

msyriac commented 5 years ago

@ajvanengelen I've put a placeholder for modulation here: https://github.com/msyriac/so_pysm_models/blob/precomputed_alms_with_car/so_pysm_models/alms.py#L64

zonca commented 5 years ago

thanks @msyriac !