fitsread.src Copyright (c) Kapteyn Laboratorium Groningen 2010 All Rights Reserved. Name: fitsread.src Creator: hans Host: plato Date: Aug 24, 2010 Contents: fitsread.make fitsread.py fitsread.dc1 #> fitsread.make # # fitsread.make # SHELL = /bin/sh default:: fitsread fitsread : fitsread.py cp fitsread.py fitsread chmod +x fitsread pack:: $$gip_sys/pack.csh fitsread.src fitsread.make fitsread.py \ fitsread.dc1 #< #> fitsread.py #!/usr/bin/env python from gipsy import * import sys, pyfits, string, numpy init() while True: try: hdulist = pyfits.open(usertext('FITSFILE=', 'Name or URL of FITS file'), memmap=True) break except: reject('FITSFILE=', 'Cannot open FITS file') hdulist.info() sys.stdout.flush() nhdu = len(hdulist) if nhdu>1: while True: index = userint('HDU=', 'Give HDU number 0-%d [0]'%(nhdu-1), 1, 0) if index>=0 and index fitsread.dc1 Program: FITSREAD Purpose: Load FITS images from file or URL into a GIPSY set. Category: FITS, UTILITY File: fitsread.src Author: J.P. Terlouw Description: Simple FITS reader for images. It has been written in Python and is based on PyFITS. Keywords: FITSFILE= Filename or URL of the FITS file. HDU= If the FITS file contains more than one HDU, the HDU number. OUTSET= Name of the output set. Example: fitsread FITSREAD FITSFILE=aurora.fits Filename: aurora.fits No. Name Type Cards Dimensions Format 0 PRIMARY PrimaryHDU 125 (530, 530) int16 1 PHOTOMETRIC CALTABLE BinTableHDU 39 16R x 4C [1D, 1D, 1D, 1J] FITSREAD HDU=0 FITSREAD OUTSET=aurora FITSREAD +++ FINISHED +++ Updates: Feb 3, 2009: JPT, Document created. Auf 24, 2010: JPT, Set non-finite pixel values to GIPSY BLANK. #<