Conversion of healpix fits file to normal fits file

In summary: Written by Dustin Lang, 2004-04-26In summary, we are discussing ways to convert a CMB map in healpix fits file format to a normal fits file format in IDL. We have tried using write_fits_map and write_fits_sb, but they did not work for our purposes. Another option suggested is using the pro fits_reproj_healpix, which converts a HealPix image to a flatmap projection FITS file with WCS info. However, this conversion does not preserve the noise properties of the CMB and should not be used for analysis. The procedure used for this is FITS_READ_MAP and the user can specify the projection type (Mollweide or Zenithal Equal Area
  • #1
hommies
3
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
  • #2
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.
 
  • #3
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
 
  • #4
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:
;-
 

1. What is a healpix fits file?

A healpix fits file is a special type of fits file used in astronomy and cosmology. It contains data that is organized in a hierarchical pixelization scheme, which is useful for analyzing spherical data such as maps of the sky.

2. Why would I need to convert a healpix fits file to a normal fits file?

Converting a healpix fits file to a normal fits file may be necessary if you need to use the data in a different software or program that does not support healpix files. It can also make the data easier to work with for certain types of analysis.

3. How can I convert a healpix fits file to a normal fits file?

There are several software programs and scripts available for converting healpix fits files to normal fits files. Some commonly used tools include healpix2fits, HEALPix IDL library, and healpy Python package.

4. What are the potential challenges in converting a healpix fits file?

One potential challenge in converting a healpix fits file is ensuring that the new file maintains the same level of accuracy and precision as the original file. Additionally, some conversion methods may be more time-consuming or require specific software or programming knowledge.

5. Are there any limitations to converting a healpix fits file to a normal fits file?

Yes, there may be limitations depending on the conversion method used. For example, some conversion methods may only work for specific types of healpix files or may not support certain data formats. It is important to carefully research and choose a conversion method that best fits your needs.

Similar threads

  • Cosmology
Replies
16
Views
6K
  • Cosmology
Replies
2
Views
1K
  • Programming and Computer Science
Replies
12
Views
3K
Replies
9
Views
3K
Replies
7
Views
1K
  • Programming and Computer Science
Replies
2
Views
241
  • Computing and Technology
2
Replies
35
Views
3K
Replies
1
Views
773
  • Programming and Computer Science
Replies
12
Views
977
  • Programming and Computer Science
Replies
8
Views
808
Back
Top