; NAME: ; renamefits ; ; PURPOSE: ; To rename a FITS file and update the header. ; ; CALLING SEQUENCE: ; renamefits,ifilename,ofilename,KEYWORD=keyword,CANCEL=cancel ; ; INPUTS: ; ifilename - The input FITS file ; ofilename - The output FITS file ; ; OUTUTS: ; Writes a FITS file to disk called ofilename ; ; KEYWORD PARAMETERS: ; KEYWORD - The header keyword to change (default =IRAFNAME). ; CANCEL - Set on return if there is a problem ; ; PROCEDURES CALLED: ; Requires the Astronomy User's Library ; ; PROCEDURE: ; Duh ; ; MODIFICATION HISTORY: ; 2002-02-10 - Written by M. Cushing, Institute for Astronomy, UH ; pro renamefits,ifilename,ofilename,KEYWORD=keyword,CANCEL=cancel cancel = 0 ; Check parameters if n_params() lt 2 then begin ifilename = '' ofilename = '' keyword = '' read, ifilename,PROMPT='Please enter FITS file: ' read, ofilename,PROMPT='Please enter output file name: ' read, keyword, PROMPT='Please enter FITS header keyword (IRAFNAME): ' if keyword eq '' then keyword = 'IRAFNAME' endif else if n_elements(KEYWORD) eq 0 then keyword = 'IRAFNAME' zparcheck, 'renamefits', ifilename, 1,7, 0, 'Ifilename' zparcheck, 'renamefits', ofilename, 2,7, 0, 'Ofilename' i = readfits(ifilename,hdr) fxaddpar,hdr,keyword,ofilename writefits,ofilename,i,hdr end