function norh_img2idx,header ;+ ; NAME: ; NORH_IMG2IDX ; ; PURPOSE: ; This procedure converts the NORH image header ; to index structure. ; ; CALLING SEQUENCE: ; index=norh_img2idx(header) ; ; INPUTS: ; header: FITS header read from the image file ; OUTPUTS: ; index: index structure ; ; HISTORY: ; Writtern 1998-05-29 JS and TY ; Revised 1998-08-12 TY for NORH fits 2.0 ; Revised 1998-11-17 TY for defined hdst ; Revised 1998-11-8 TY for 'cellsize' ; Revised 1999-11-23 TY for 'jst-strt' and 'jst-end' ; Revised 2000-02-25 TY for 'expdur' ;- ; define the structure norh_mkst_index,index_el sz=size(header) if (sz(0) ge 2) then mx=sz(2) else mx=1 index=replicate(index_el,mx) norh_hdst_img,hdst for m=0,mx-1 do begin hd=reform(header(*,m)) nxhd=n_elements(hd) if (nxhd ge 128) then hd=[hd(0:126),hd(nxhd-1)] norh_fits_interp,hd,hd_st,instruc=hdst ; whr=where(strlowcase(tag_names(hd_st)) eq 'hdrident',cnt) ; if (cnt ne 0) then begin if (hd_st.hdrident eq 'HeliogFITS 2.0') then begin ; read JST time jststring=hd_st.jstdate+' '+hd_st.jsttime ; JST time to UT structure daytimejst=anytim(jststring,/ints) daytimeut=norh_jst2ut(daytimejst,/ints) ; get exposure duration jststrt =hd_st.jstdate+' '+hd_st.jst_strt jstend =hd_st.jstdate+' '+hd_st.jst_end expdur = anytim(jstend)-anytim(jststrt) ; endif else begin ; message,'Unknown version' ; endelse endif else begin ; read JST time dd=fix(strmid(hd_st.jstdate,0,2)) mm=fix(strmid(hd_st.jstdate,3,2)) yy=fix(strmid(hd_st.jstdate,6,2)) hh=fix(strmid(hd_st.jsttime,0,2)) mn=fix(strmid(hd_st.jsttime,3,2)) ss=fix(strmid(hd_st.jsttime,6,2)) ms=fix(strmid(hd_st.jsttime,9,3)) ; JST time to UT structure daytimejst=anytim2ints([hh,mn,ss,ms,dd,mm,yy]) daytimeut=anytim2ints([hh,mn,ss,ms,dd,mm,yy],offset=-9.*60.*60) ; get exposure duration yyst=string(yy,format='(i2.2)') mmst=string(mm,format='(i2.2)') ddst=string(dd,format='(i2.2)') jststrt ='19'+yyst+'-'+mmst+'-'+ddst+' '+hd_st.jst_strt jstend ='19'+yyst+'-'+mmst+'-'+ddst+' '+hd_st.jst_end expdur = anytim(jstend)-anytim(jststrt) endelse ; input to index index(m).gen.day=daytimeut.day index(m).gen.time=daytimeut.time index(m).gen.dayjst=daytimejst.day index(m).gen.timejst=daytimejst.time index(m).norh.obs_freq=hd_st.obs_freq index(m).norh.polariz=hd_st.polariz index(m).norh.shape=[fix(hd_st.naxis1),fix(hd_st.naxis2)] index(m).norh.sec_per_pix=hd_st.cdelt1 index(m).norh.solp=hd_st.solp index(m).norh.pmat=[hd_st.pmat1,hd_st.pmat2,hd_st.pmat3,hd_st.pmat4] index(m).norh.expdur=expdur ; whr=where(tag_names(hd_st) eq 'PFICENX',count) ; if (count ne 0) then begin ; OLD 'fujiki' PFI if (hd_st.pficenx ge -99999.) then begin index(m).norh.oldpfi=1 fpixsz=4.91104 index(m).norh.solcen=[ $ (hd_st.crpix1-hd_st.pficenx)*fpixsz/hd_st.cdelt1+0.5*fix(hd_st.naxis1) $ ,(hd_st.crpix2-hd_st.pficeny)*fpixsz/hd_st.cdelt2+0.5*fix(hd_st.naxis2)] endif else begin ; FFI or New PFI index(m).norh.oldpfi=0 index(m).norh.solcen=[hd_st.crpix1-hd_st.crval1/hd_st.cdelt1 $ ,hd_st.crpix2-hd_st.crval2/hd_st.cdelt2]-0.5 endelse ; whr=where(tag_names(hd_st) eq 'SOLR_FAC',count) ; if (count ne 0) then begin if (hd_st.pficenx ge -99999.) then begin index(m).norh.solrfac=hd_st.solr_fac endif else begin index(m).norh.solrfac=1.0125 endelse ; whr=where(tag_names(hd_st) eq 'PROGNAME',count) ; if (count ne 0) then begin ; index(m).norh.progname=hd_st.progname ; endif else begin ; ; index(m).norh.progname='unknown' ; endelse whr=where(tag_names(hd_st) eq 'CELLSIZE',count) if (count ne 0) then begin ; cellsize=hd_st.cellsize endif else begin ; cellsize=-1 endelse norh_prog2pinf,index(m).norh.progname,index(m).norh.obs_freq $ ,sec_per_pix_dty=sec_per_pix_dty,efl_in_pix_dty=efl_in_pix_dty,roll=roll $ ,cellsize=cellsize index(m).norh.roll=roll index(m).norh.sec_per_pix_dty=sec_per_pix_dty index(m).norh.efl_in_pix_dty=efl_in_pix_dty index(m).norh.cellsize=cellsize endfor return,index end