;+
; NAME:
;       FITS_HDR__READ
;
; PURPOSE:
;
; CATEGORY:
;       Hansteen/Wikstol Data analysis SW
;
; CALLING SEQUENCE:
;       An object of class FITS_HDR is declared with this statement: 
;                   hdrobj = obj_new('fits_hdr')
;
; INPUTS:
;       file:  Name of FITS file (string) containing FITS data and headers.
;
; KEYWORD PARAMETERS:
;
; OUTPUTS:
;
; CALLS:
;
; PROCEDURE:
;
; RESTRICTIONS:
;
; MODIFICATION HISTORY:
;
;          4-Jul-2008: A. Gardini    - Added the init keyword.
;-
pro fits_hdr::readforeign, file, init=init
  if n_elements(init) eq 1 then return

  if n_params() ne 1 then begin
    message, 'No datafile specified!', /informational
    message, 'usage: data->read, file', /informational
    return
  endif

  dum=readfits(file,hdr)

  self.main_hdr = ptr_new(hdr)

  ; extract information from fits hdr:
  self.date = fxpar(hdr, 'date')         ; Date FITS file was written
  self.origin = fxpar(hdr, 'origin')     ; Institue where file was created
  self.telescop = fxpar(hdr, 'telescop') ; Solar B
  self.instrume = fxpar(hdr, 'instrume') ; EIS
  self.obs_prog = fxpar(hdr, 'obs_prog') ; Observing program name
  self.obs_title = fxpar(hdr, 'title')   ; Observing program title
  self.datatype = fxpar(hdr, 'datatype')   ; Data type ['pixel data' or 'moments']
  self.date_obs = fxpar(hdr, 'date_obs') ; Start date and time of observation
  self.date_end = fxpar(hdr, 'date_end') ; End date and time of observation
  self.obt_time = fxpar(hdr, 'obt_time') ; Spacecraft start time (TI units)
  self.xcen = fxpar(hdr, 'xcen')         ; Preliminary center pointing in x
  self.ycen = fxpar(hdr, 'ycen')         ; Preliminary center pointing in y
  cdelt1 = fxpar(hdr,'cdelt1')           ;
  cdelt2 = fxpar(hdr,'cdelt2')           ;
  crpix1=fxpar(hdr,'crpix1')             ;
  crpix2=fxpar(hdr,'crpix2')             ;
  crval1=fxpar(hdr,'crval1')             ;
  crval2=fxpar(hdr,'crval2')             ; 
end

