Conversion of healpix fits file to normal fits file

  • Context: Undergrad 
  • Thread starter Thread starter hommies
  • Start date Start date
  • Tags Tags
    File Normal
Click For Summary

Discussion Overview

The discussion revolves around converting a CMB map from Healpix FITS file format to a standard FITS file format using IDL. Participants are exploring various methods and tools available for this conversion, including specific functions and their limitations.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant seeks assistance with converting a CMB map in Healpix format to a standard FITS file format.
  • Another participant suggests using the functions write_fits_map or write_fits_sb, and proposes reading the image with a Healpix fits reader followed by using writefits to create a standard FITS file.
  • A participant reports that the suggested methods do not yield the desired output, noting that WRITE_FITS_MAP still produces a Healpix file and that write_fits_sb is incompatible with their needs in IDL.
  • Another suggestion is made to try fits_reproj_healpix, which could allow the use of standard astronomical display software with the converted file, while also providing details on its usage and limitations regarding noise properties of the CMB.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of the proposed methods for conversion, and there is no consensus on a definitive solution. The discussion remains unresolved regarding the best approach to achieve the desired file format.

Contextual Notes

Limitations include the potential inability of certain functions to produce the required file format and the implications of using flat map projections on the noise properties of the CMB.

hommies
Messages
3
Reaction score
0
im working with idl and we are trying to convert a cmb map in healpix fits file format to a normal fits file format. any help!
 
Space news on Phys.org
Can you do this with write_fits_map or write_fits_sb? If not, can you just read in the image with the healpix fits reader, then use writefits to write the image into a standard fits file? syntax is

writefits, 'MyCMBMap.fits', data, header

for standard writefits.
 
thanks for the help. tried all the suggestions but they don't seem to work. WRITE_FITS_MAP still outputs a file in healpix convention and write_fits_sb doesn't output the type of fits file we want since we can't use atv on it in idl. I don't see why the last option should work either because the file would still be in healpix format
 
Dunno, could try fits_reproj_healpix, should be able to use atv or ds9 with the converted file?

pro fits_reproj_healpix, infile, outfile,coord=coord,projection=projct,size=size
;+
; NAME:
; FITS_REPROJ_HEALPIX
; PURPOSE:
; Convert a HealPix image to a flatmap projection FITS file with WCS info
; EXPLANATION:
; Writes a FITS file containing a flatmap projection in either a Mollweide
; or Zenithal Equal Area projection, and write the appropriate World
; Coordinate System (WCS, see Calabretta & Greisen, 2002, A&A, 395, 1077)
; information into the FITS header. This allows coordinates to be
; displayed by standard astronomical display software (e.g. DS9, SAOImage).
;
; Note that the conversion to a flat map projection does not preserve the
; noise properties of the CMB, and should not be used for a CMB analysis.
;
; CALLING SEQUENCE:
; FITS_REPROJ_HEALPIX, INFILE, OUTFILE, [COORD={'G','C','E'},
; PROJECT=['M','Z'],SIZE=[1-5],$
; INPUT ARGUMENT:
; INFILE - Scalar string giving name of the FITS file containing the
; image in HealPix projection.
; 'map_k_imap_yr1_v1.fits'
; OUTPUT ARGUMENT:
; OUTFILE - Scalar string giving the name of the FITS file containing
; the flat map projection with astrometry.
;
; OPTIONAL INPUT KEYWORDS:
; User will be prompted for the following values if they are not supplied
; as keywords:
;
; PROJECT - Scalar string specifying either a "Mollweide" or a "Zenithal"
; Equal Area projection. Only the first letter is needed.
;
; SIZE - Scalar integer giving the size of the output image described by
; the table:
; 1 -- Small (512 x 256)
; 2 -- Medium (1024 x 512)
; 3 -- Large (2048 x 1024)
; 4 -- X large (4096 x 2048)
; 5 -- XX large (8192 x 4096, mollweide, native
; coordinates only)
;
; COORD - One of the three words "Galactic" (default), "Celestial", or
; "Ecliptic' giving the output projection. Only the first
; letter is needed.
;
; EXAMPLE:
; Convert the K band all-sky HealPix map to a medium (1024 x 512) size
; Mollweide projection stored in a FITS file moll_k_yr1_v1.fits

; IDL> infile = 'map_k_imap_yr1_v1.fits'
; IDL> fits_reproj_healpix, infile, 'moll_k_yr1_v1.fits',size=2,proj='Mol'
;
; NOTES:
; A Mollweide projection is written in a single FITS file extension. A
; Zenithal Equal Area projection is written as two image in two extensions
; -- the first centered on the North Pole, and the second on the South
; Pole.
; PROCEDURES USED:
; FITS_READ_MAP GET_HEAL_LUT, GET_HEAL_RES()
; MODIFICATION HISTORY:
;-
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
12
Views
2K
  • · Replies 29 ·
Replies
29
Views
4K