pro sxdelpar, h, parname On_error,2 compile_opt idl2 if N_Params() LT 2 then begin print,'Syntax - SXDELPAR, h, parname' return endif ; convert parameters to string array of upper case names of length 8 char if size(parname,/type) NE 7 then $ message,'Keyword name(s) must be a string or string array' par = strtrim( strupcase(parname),2 ) sz = size(h,/structure) if (sz.N_dimensions NE 1) or (sz.type NE 7) then $ message,'FITS header (1st parameter) must be a string array' nlines = sz.N_elements ;number of lines in header array pos = 0L ;position in compressed header with keywords removed ; loop on header lines keyword = strtrim( strmid(h,0,8), 2 ) for i = 0L, nlines-1 do begin if array_equal(keyword[i] NE par, 1b) then begin h[pos] = h[i] ;keep it pos = pos+1 ;increment number of lines kept if keyword[i] eq 'END' then break ;end of header endif endfor if pos GT 0 then h = h[0:pos-1] else h = 0 ;truncate return end