Conversion of healpix fits file to normal fits file

  • Thread starter Thread starter hommies
  • Start date Start date
  • Tags Tags
    File Normal
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:
;-
 
Back
Top