casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
task_exportfits.py
Go to the documentation of this file.
00001 import os
00002 from taskinit import *
00003 
00004 def exportfits(
00005         imagename, fitsimage, velocity, optical, bitpix,
00006         minpix, maxpix, overwrite, dropstokes, stokeslast
00007 ):
00008         """Convert a CASA image to a FITS file:
00009         CASA-produced images can be written to disk for transporting
00010         to other software packages.  No subimaging of the fits image
00011         can be made with this task.
00012 
00013         Keyword arguments:
00014         imagename -- Name of input CASA image
00015                 default: none; example: imagename='3C273XC1.image'
00016         fitsimage -- Name of input image FITS file
00017                 default: none; example='3C273XC1.fits'
00018         velocity -- Prefer velocity (rather than frequency) as spectral axis
00019                 default: False
00020         optical -- Use the optical (rather than radio) velocity convention
00021                 default: True;
00022         bitpix -- Bits per pixel
00023                 default: -32 (floating point)
00024                 <Options: -32 (floating point), 16 (integer)>
00025         minpix -- Minimum pixel value
00026                 default: 0 (if minpix > maxpix, value is automatically determined)
00027         maxpix -- Maximum pixel value
00028                 default: -1 (if minpix > maxpix, value is automatically determined)
00029         overwrite -- Overwrite pre-existing imagename
00030                 default=False; example: overwrite=True
00031         dropstokes -- Drop the Stokes axis?
00032                 default: False; example: dropstokes=True
00033         stokeslast -- Put the stokes axis last in header?
00034                 default: True; example: stokeslast=False
00035 
00036         """
00037 
00038         #Python script
00039         casalog.origin('exportfits')
00040         _myia = iatool()
00041         _myia.open(imagename)
00042         _myia.tofits(
00043                 outfile=fitsimage, velocity=velocity, optical=optical,
00044                 bitpix=bitpix, minpix=minpix, maxpix=maxpix,
00045                 overwrite=overwrite, dropstokes=dropstokes, stokeslast=stokeslast
00046         )
00047         _myia.close()