Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

pysm.Instrument seems not working properly in some cases #30

Open
fincardona opened this issue Mar 28, 2019 · 1 comment
Open

pysm.Instrument seems not working properly in some cases #30

fincardona opened this issue Mar 28, 2019 · 1 comment

Comments

@fincardona
Copy link
Contributor

fincardona commented Mar 28, 2019

Hello,
I have a problem using pysm.Instrument.

I use this standard sky configuration:

nside = 128
sky_config = {
'synchrotron': models('s1', nside),
'dust': models('d1', nside),
'freefree': models('f1', nside),
'cmb': models('c1', nside),
'ame': models('a1', nside)} 

then I create a sky with:

sky = pysm.Sky(sky_config)

Now, I create the two following different instruments:

instrument_mono_noiseless = pysm.Instrument({
    'nside': nside,
    'frequencies' : np.array([143]), 
    'use_smoothing' : True,
    'beams' : np.array([7.1]),  
    'add_noise' : False, 
    'noise_seed' : None,  
    'sens_I': None, 
    'sens_P': None, 
    'use_bandpass' : False,  
    'channel_names' : ['143_GHz'],
    'channels' : None,
    'output_units' : 'uK_RJ',
    'output_directory' : "./",
    'output_prefix' : "noiseless_mono",
    'pixel_indices' : None})
instrument_mono = pysm.Instrument({
    'nside': nside,
    'frequencies' : np.array([143]), 
    'use_smoothing' : True,
    'beams' : np.array([7.1]),  
    'add_noise' : True, 
    'noise_seed' : 0,  
    'sens_I': np.ones(1), 
    'sens_P': np.ones(1), 
    'use_bandpass' : False,  
    'channel_names' : ['143_GHz'],
    'channels' : None,
    'output_units' : 'uK_RJ',
    'output_directory' : "./",
    'output_prefix' : "mono",
    'pixel_indices' : None})

I observe the sky through these two instruments with instrument_*.observe(sky) and then I read the corresponding maps that have been produced.

In the first case the created map does not have the polarization components but only the intensity one. In fact, you will get an error message if you try:

hp.read_map('noiseless_mono_nu0143p00GHz_total_nside0128.fits', field=(0, 1, 2))

while the right command would be:

hp.read_map('noiseless_mono_nu0143p00GHz_total_nside0128.fits', field=(0))

but this means that Q and U maps have not been generated.

In the second case, the three maps (I, Q, U) are generated but in a wrong way since the Q and U maps are in the same order of magnitude of the I map:

hp.read_map('mono_nu0143p00GHz_total_nside0128.fits', field=(0, 1, 2))

array([[-36.27698898,  14.9692564 ,  25.86756897, ...,  76.63456726, 
         81.74451447,  67.1904068 ],
       [-36.27647781,  14.91915131,  25.87987328, ...,  76.58881378, 
         81.76040649,  67.25320435],
       [-36.32805252,  14.94966221,  25.84389114, ...,  76.66394043, 
         81.7594986 ,  67.2399292 ]])

Is there something I'm doing wrongly somewhere?

@NicolettaK
Copy link

Hi, I think the problem is related to the number of frequencies passed to pysm.Instrument. When only one frequency channel is given the smooth function doesn't work properly, if more frequencies are given then everything appears to work well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants