How display a mollview projection of CAMB output fits file ?

Click For Summary
SUMMARY

The discussion focuses on displaying a Mollweide projection of a CAMB output FITS file ('test_scalCls.fits') using IDL and Healpix tools. Users encountered errors related to invalid Nside values and unsupported resolutions while attempting to visualize the data. The key conclusion is that the data in 'test_scalCls.fits' is likely a power spectrum rather than a map, necessitating the generation of a Healpix map from the power spectrum using the Healpix synfast program before visualization.

PREREQUISITES
  • Familiarity with IDL programming and its ASTRO library.
  • Understanding of Healpix 2.11c and its functionalities.
  • Knowledge of CAMB (Code for Anisotropies in the Microwave Background) output formats.
  • Experience with FITS file handling and manipulation.
NEXT STEPS
  • Learn to use Healpix synfast for generating Healpix maps from power spectra.
  • Explore the process of performing spherical harmonic transforms to create maps from alm coefficients.
  • Investigate the use of map2tga and map2gif for visualizing Healpix maps.
  • Study the IDL mollview function to understand its requirements and limitations.
USEFUL FOR

Astronomers, astrophysicists, and data scientists working with cosmological simulations and needing to visualize power spectra and maps derived from CAMB outputs.

fab13
Messages
300
Reaction score
7
hi,

i want to display into IDL a mollview projection of the output fits file ('test_scalCls.fits') of CAMB program (Code for Anisotropies in the Microwave Background) but can't get it.

I have IDL ASTRO, Healpix_2.11c and WMAP librairies and i tried several things:

1*/

HIDL> mollview, 'test_scalCls.fits', /silent

returns :

% VEC2PIX_RING: Invalid Nside -1
% Execution halted at: VEC2PIX_RING 71 /usr/local/Healpix_2.11c/src/idl/toolkit/vec2pix_ring.pro
% DATA2MOLL 242 /usr/local/Healpix_2.11c/src/idl/visu/data2moll.pro
% MOLLVIEW 492 /usr/local/Healpix_2.11c/src/idl/visu/mollview.pro
% $MAIN$

2*/

read_fits_map, 'test_scalCls.fits', map, hdr, xhdr, NSIDE=nside

It seems i get the data in the "map" array but i don't know how to use these data in order to display a mollview projection.

3*/

I found this thread: https://www.physicsforums.com/showthread.php?t=279764, so i did :

fits_reproj_healpix, 'test_scalCls.fits', 'moll_last.fits', size=1, proj='Mol'

returns :

% FITS_REPROJ_HEALPIX: WARNING - SKYCOORD keyword not found in header
% FITS_REPROJ_HEALPIX: WARNING - Native Galactic coordinates assumed
% GET_HEAL_LUT: Reading the look-up table mollweide_h10s_lut.fits
We do not support the selected resolution...
Number of input pixels: 2001
N_Pixels, Resolution: 2001 -1
% FITS_REPROJ_HEALPIX: Map resolution too high or low for the current look-up tables...
% Execution halted at: FITS_REPROJ_HEALPIX 106 /home/fab/WMAP/pro/fits_reproj_healpix.pro
% FITS_REPROJ_HEALPIX 106 /home/fab/WMAP/pro/fits_reproj_healpix.pro
% $MAIN$

---------------------------------------------------------------------------------------------------------------------------------------

4*/ I tried to display it with mapview but it fails :

HIDL> mapview
% Compiled module: MAPVIEW.
MAPVIEW v1.3 (07 Jul 2004) -- WMAP project HEALPix map viewer
% Compiled module: XREGISTERED.
% Compiled module: NPIX2NSIDE.
Waiting for file name to be input
% Compiled module: LOADCT.
% Compiled module: FILEPATH.
% LOADCT: Loading table RAINBOW
% Compiled module: FSC_FILESELECT.
% Compiled module: CW_BGROUP.
% Compiled module: EULER_MATRIX_NEW.
% Compiled module: HEALPIX_TO_IMAGE.
% Compiled module: GET_HEAL_LUT.
% Compiled module: CONCAT_DIR.
% Compiled module: READFITS.
% Compiled module: SXPAR.
% Compiled module: GETTOK.
% Compiled module: VALID_NUM.
% Compiled module: GET_HEAL_RES.
% Compiled module: XMANAGER.
HIDL>
% Compiled module: VEC2ANG.
% Compiled module: ANG2PIX_NEST.
% Compiled module: NSIDE2NPIX.
% Compiled module: INIT_XY2PIX.
HIDL>
Reading /home/fab/test_scalCls.fits
% Compiled module: FITS_OPEN.
% Compiled module: SXDELPAR.
% Compiled module: FITS_READ.
% Compiled module: FITS_CLOSE.
% Compiled module: TBINFO.
% Compiled module: FXPAR.
0
% Compiled module: TBGET.
% Compiled module: TAG_EXIST.
% Compiled module: LOADCT_012.
% LOADCT: Loading table RAINBOW
We do not support the selected resolution...
Number of input pixels: 2001
Map resolution too high or low for the current look-up tables...
N_Pixels, Resolution: 2001 -1
% Stop encountered: HEALPIX_TO_IMAGE 111 /home/fab/WMAP/pro/healpix_to_image.pro

------------------------------------------------------------------------------------------------------------------------------------

5*/ i tried with skyviewer and ds9 too, in vain.


Thanks for your help !
 
Space news on Phys.org
So, it's looking like the data you stored in the "map" file isn't actually a map. With npixels = 2001, I'm willing to bet that this is the power spectrum, not a map (which would make sense, as this is CAMB's primary task).

If you want to display a typical map that you would get from this power spectrum, then you need to do the following:

1. Read in the power spectrum as a power spectrum (not a Healpix map).
2. Generate a random set of alm's from that power spectrum.
3. Perform a spherical harmonic transform to produce the map that is represented by the generated alm's.
4. Display the map.

Now, I don't personally use IDL for these tasks. I instead use the command-line tools offered by Healpix. For example, I would make use of the Healpix synfast program to perform steps 1-3 (you can use the interactive mode or use a parameter file). This will output a Healpix map in .fits format, which can then be displayed. Usually I use the map2tga program that comes with the Healpix C++ code, though map2gif will work just as well, as will the mollview code you have above.