PRO eis_split

split_win = 0

status    = eis_open_db(/RASTER)
nRasters  = db_info('entries')

FOR i = 0 , nRasters[0] -1 DO BEGIN

   ra  = db_read_raster_entry(i+1)
   ll  = db_read_linelist_entry(ra.ll_id)

   FOR j = 0 ,  ra.nWindows - 1 DO BEGIN

       wind_width = ra.dataWindows[j]
       line       = eis_line_values(ll.lines[j],wind_width,ra.slitindex)
       ;help,line,/str
       ;print,line.p1 , line.p2

       IF (line.p1 LE 1023) AND (line.p2 GT 1023) THEN BEGIN

           print,'Raster ID = ' + STRCOMPRESS(i+1,/REMOVE)
           print,'    LL ID = ' + STRCOMPRESS(ra.ll_id,/REMOVE)
           print,'     Line = ' + STRCOMPRESS(j+1,/REMOVE)
           p1_str = STRCOMPRESS(line.p1,/REMOVE)
           p2_str = STRCOMPRESS(line.p2,/REMOVE)
           p_str  = STRJOIN([p1_str,' to ',p2_str],/SINGLE)
           print,STRJOIN(['      Win = ',p_str],/SINGLE)
           split_win = split_win + 1


       ENDIF
       ; See planning/utilities/eis_split_window
       ; ll = eis_split_window , ll


   ENDFOR


ENDFOR

print,"EIS_SPLIT Report...."
nSplits = STRCOMPRESS(split_win,/REMOVE)
CASE split_win OF
   0    : mText = "There are NO split windows!"
   ELSE : mText = STRJOIN(["There are ",nSplits," split windows!"],/SINGLE)
ENDCASE

print,mText


END