HTML automatically generated with rman
Table of Contents
ccdfits - convert an image to a fits file
ccdfits in=image
out=fits [parameter=value]
ccdfits writes a fits file to disk.
The input must be in image(5NEMO)
format, the output will be in standard
fits(5NEMO)
format on disk.
An experimental version of this program that
uses the standard cfitsio(3)
library is known as ccdfitsio(1NEMO)
.
A peculiar
option is the use of the fitshead= keyword. In this mode the header of the
output fits file will be replaced with that of the filename in the fitshead=
keyword. This is dangerous, it is the responsility of the user to ensure
the dimensions (NAXIS,1,2,3) and BITPIX of the two are the same, or else
an illegal FITS file will be created. The program scanfits(1NEMO)
is used
behind the scenes to achieve this feat.
The following parameters
are recognized in order; they may be given in any order if the keyword
is also given. Use --help to confirm this man page is up to date.
- in=image-file
- input file, in image(5NEMO)
format [no default].
- out=fits-file
- output file,
will be in fits(5NEMO)
format [no default].
- bitpix=number
- Bitpix applied
for scaling. Options are 16, 32 or -32. [default: -32].
- scale=number
- Scaling
factors for CDELT keyword. If the second or third number is omitted, it
is repeated from the previous number. [default: 1,1,1].
- iscale=bscale,bzero
- Scaling factors for intensity (should only be used for BITPIX > 0) [default:
1,0].
- object=name
- Name of your object/image. By default, the Object name
inherited from the original. [default: none].
- comment=comments
- Comment using
the COMMENT keyword. [default: none]
- cdmatrix=t|f
- Use CD matrix instead of
CDELT? [t/f]. Default: f.
- blocking=factor
- Blocking factor (multiplicity of
blocksize in terms of 2880 bytes) used when writing the fits file. [default:
1].
- refmap=
- Reference map or cube (a fits file) from which the WCS is inherited.
It has to match the output cube which is created. Deprecated. By default
none is used.
- crpix=
- Use these pixels (2 or 3 need to be given, depending
if a map or cube is output) as reference pixel, instead of the one defined
in the reference map. By default not used.
- crval=
- Use these values (2 or
3 need to be given, depending if a map or cube is output) as value at the
reference pixel, instead of the one defined in the reference map or defined
by the input. By default not used.
- cdelt=
- Use these values (2 or 3 need to
be given, depending if a map or cube is output) as pixel increments, instead
of the one defined in the reference map or defined by the input. By default
not used.
- radecvel=t|f
- If no reference map used, this can be used to enforce
a more reasonable axis descriptor (RA/DEC/VEL) for astronomical data packages
which cannot handle theory data too well (e.g. miriad, karma etc.). We also
add CUNITn and BUNIT (albeit in JY/PIXEL). See also ccdsky(1NEMO)
for a
smart scaling placing the object at a computed distance. [Default: f].
- dummy=t|f
- Write dummy (NAXISn=1) axes too? If not, axes with length 1 are written
last. Default: t
- nfill=0
- Number of dummy comment lines to add to a fits
header to test I/O routines. Default: 0
- ndim=
- This is a hack. If used, this
will be the value of NAXIS written to the FITS file. Only useful of dummy=f
and your FITS reader still cannot handle dummy trailing axes. For ndim=4
the axis will be labeled as STOKES, which is useful for packages such as
CASA. Default: not used.
- select=1
- Select this image (1 being the first) to
grab in an file with multiple Image’s. [Default: 1]
- fitshead=
- If used, the
header of this fitsfile will be used instead of the one from the converted
input image. Default; not used.
To convert an image to unsigned
16 bit integers use the following math:
a = "(a < 0 ? a+65536 : a)"
or using ccdmath:
ccdmath in=map1 out=map2 fie="iflt(%1,0,%1+65536,%1)"
A reference map (refmap=) does not have to be a full FITS cube. If the NEMO
fitsio(3NEMO)
routines are used, the header will suffice, since the data
is never needed. You can see scanfits(1NEMO)
for this:
scanfits in=cube.fits out=cube.fitshdr select=header
ccdfits ... refmap=cube.fitshdr ...
For historic amusement, but completely irrelevant for the 21st
Century:
In the old days (somewhere before the 90s) there were actually
software systems that could only directly read FITS files from tape, not
from disk. The disk-fits file must be written to tape in ’raw’ format with
a block length of 2880 bytes, which can be done with dd(1)
:
% dd if=fits.dat of=/dev/rmt0 obs=2880
Under VMS the tape has to be mounted with the blocksize:
$ MOUNT MT:/FOREIGN/BLOCK=2880/RECORD=2880
$ COPY MT: FITS.DAT
and the file on disk must be recorded to have a 2880 blocksize:
$ FIXATR/RFM=FIX:2880 FITS.DAT
In case FTP is used to transfer files, remember that FTP cannot handle
files with this format (some FTP’s at least). So it’s best to have them in
regular 512 byte blocks before moving, and at 2880 blocksize when using
programs such as DISKFITS in the VMS version of GIPSY.
You could also try
the following command procedure on VMS (Bob Hanisch, ST ScI):
$!----------------------------------------------------------------------
$! FIXFITS filename
$! FIXFITS CONVERTs a file to the desired AIPSFITS disk format
$!----------------------------------------------------------------------
$ create/fdl=sys$input: temp.dat
RECORD
CARRIAGE_CONTROL NONE
SIZE 2880
FORMAT FIXED
$! now convert - old fails some
$! convert/append ’P1’ TEMP.DAT
$! now convert - new method
$ copy ’P1’ TEMP.DAT/overlay
$ rename temp.dat ’P1’
$! clean up
$ purge ’P1’
$!
ccdsky(1NEMO)
, ccdfitsio(1NEMO)
, scanfits(1NEMO)
, snapccd(1NEMO)
,
ccdmath(1NEMO)
, iofits(1NEMO)
, image(5NEMO)
, fits(5NEMO)
, dd(1)
Peter
Teuben
~/src/pjt/image ccdfits.c ccdfits.1
29-apr-88 V1.0: created, calling WERONG fortran subroutines PJT
2-jun-88 V1.1: new filestruct, renamed wfits to ccdfits PJT
1-oct-90 V2.1: new fitsio and keyword comment=, scale now 1 PJT
11-oct-90 V2.2: added blocking= factor PJT
nov-92 documented the FITFITS VMS procedure PJT
dec-99 some more documentation PJT
apr-01 V3.0 reference map/pixel to inherit a WCS from PJT
6-may-02 V4.0b properly implemented dummy= PJT
4-jan-04 V5.2 docomented the recent changes to crval/cdelt/crpix= PJT
20-jun-09 V5.4 added select= to grab not the first image PJT
26-may-2016 V5.8 added CUNITn and BUNIT and better parameters for radecvel=true PJT
27-dec-2020 V6.3 added fitshead= PJT
22-may-2021 V6.3d: object inherited from Image PJT
Table of Contents