EIT Software Listings

 

anal
obsolete
response
util

 

Previous Routine
Next Routine

 

Listing of $SSW/soho/eit/idl/obsolete/eit_degrid_fft.pro

 


function eit_degrid_fft, image, fits_header, final = final
;+
;
; NAME:
;    eit_degrid_fft
; PURPOSE:
;    Degrid an EIT image via an FFT transform.  EIT_DEGRID_FFT assumes
;    missing blocks have been raised to the detector offset, and the 
;    detector offset subtracted.
;
; CALLING SEQUENCE:
;    clean_image = eit_degrid_fft(image, header [, /final])
;
; INPUTS:
;    image  = Dark-subtracted EIT image
;    header = FITS header
; OPTIONAL KEYWORDS:
;    final  = ????
;
; RESTRICTIONS:
;    The input image must have the missing blocks raised to detector
;    offset, and the detector offset subtracted.  (Fecit's words)
; 
;    At this time (9-Apr-1996) only supports full-frame full-resolution
;    images.
;
;  TODO:
;    Need to stamp the FITS header so we know this image was degridded
;    with <mumble> version of EIT_DEGRID_FFT.
;
; MODIfICATION HISTORY:
;    23-Mar-1996 - (DMF) - Written 
;     9-Apr-1996 - (BNH) - Cleaned up and documented
;-

if ((n_elements(image) le 0) or (n_elements(fits_header) le 0)) then begin
    message, 'clean_image=eit_degrid_fft(image, header [, /final])'
    return, -1
endif

a = image 
sz_a = size(a)
 
if not keyword_set(final) then final = 0
 
corner_offset = [-1, -1, -20, -20]
 
utc_date_19960327 = anytim2utc('1996/03/27')
utc_date_19960323 = anytim2utc('1996/03/23')
 
n_x = sz_a(1) & n_y = sz_a(2)
 
if ((n_x + n_y) lt 2048) then begin
 
   corner = intarr(4)
   ih = find_fits_keyword(fits_header, "COMMENT   P1_X")
   for i_corner = 0, 3 do begin
      corner(i_corner) = fix(strmid(fits_header(ih + i_corner), 24, 4))
   end
 
; fix for incorrect entry of pixel size.  8-apr-96 JSN
   if (corner(0) mod 2) and (corner(1) mod 2) then $
        corner_offset = [-1,-2,-20,-20] 
   corner = corner + corner_offset
   print, 'EIT_DEGRID-I-CORNERS, subfield corners = ', corner
 
; First case: full FOV, pixel summing
 
endif else corner = [0, 1023, 0, 1023]
    
; if ((n_x + n_y) eq 2048) then begin
 
   degrid = 1
   degrid_file = getenv('SSW_EIT')+'/response/degrid_'
 
   ih = find_fits_keyword(fits_header, "WAVELNTH")
   p_pos = strpos(fits_header(ih), '/')
   wave = strmid(fits_header(ih), p_pos - 4, 3)
 
   ih = find_fits_keyword(fits_header, "FILTER")
   a_pos = strpos(fits_header(ih), "'")
   filter_string = strmid(fits_header(ih), a_pos + 1, 5)
 
; For now, clear means Al +1 and Al +2 means clear (clear?). For
; anything else, punt.
 
   ih = find_fits_keyword(fits_header, "DATE_OBS")
   a_pos = strpos(fits_header(ih), "'")
   date_obs = strmid(fits_header(ih), a_pos + 1, 24)
   utc_date_obs = anytim2utc(date_obs)
 
   if (not final) and (utc_date_obs.mjd lt utc_date_19960327.mjd) $
      and (utc_date_obs.mjd ne utc_date_19960323.mjd) then begin
      if strlowcase(filter_string) eq 'clear' then begin
         degrid_file = degrid_file + wave + '_' + 'al1.dat'
      endif else if strlowcase(filter_string) eq 'al +2' then begin
         degrid_file = degrid_file + wave + '_' + 'clear.dat'
      endif else degrid = 0
   endif else begin
      if strlowcase(filter_string) eq 'clear' then begin
         degrid_file = degrid_file + wave + '_' + 'clear.dat'
      endif else if strlowcase(filter_string) eq 'al +1' then begin
         degrid_file = degrid_file + wave + '_' + 'al1.dat'
      endif else degrid = 0
   end
 
   if degrid then begin
      openr, degrid_unit, degrid_file, /get_lun, /xdr
      degrid_array = fltarr(1024, 1024)
      readu, degrid_unit, degrid_array
      close, degrid_unit & free_lun, degrid_unit
      a = a*degrid_array(corner(0):corner(1), corner(2):corner(3))
   endif else a = float(a)
 
return, a 

end


Web curator: Frédéric Auchère
Responsible NASA official: Joseph B. Gurman, Facility Scientist, Solar Data Analysis Center
joseph.b.gurman@gsfc.nasa.gov
+1 301 286-4767
NASA Goddard Space Flight Center
Solar Physics Branch / Code 682

Last revised: - Wed May 9 21:45:07 2007- F. Auchère