; March 21, 1992  Alice Lecinski
;
; This idl procedure can be used to read in and display
; ANY  MK____.[EW]ib file.
;
if ( n_elements(histfilenm) eq 0 ) then begin ;{
    histfilenm=' '
    ahdr=fltarr(8)
    ckey=bytarr(30)
    cpad=bytarr(2)
    histmap=fltarr(30,37)

    bigmap=fltarr(360,181)
    window,xsize=360,ysize=181

endif ;}
mini=0.2 & maxi=14.0

imfilenm=' '
print,'Enter the filename which contains the list of MK????.[EW]ib files to see--> '
read,imfilenm
close,11
openr,11,imfilenm

print,' '
print,'The images listed in file: ',imfilenm,' will now be displayed.'
print,' '
print,'You can use the mouse to move backwards and forwards in your image list.'
print,'Place the mouse in the map window, then:'
print,'     To move forwards, use the left most mouse button.'
print,'     To move backwards, use the middle   mouse button.'
print,' '
print,' '


while ( not eof(11) ) do begin ;{
    readf,11,histfilenm
    close,1
    openr,1,histfilenm
        readu,1,ahdr
        readu,1,ckey
        readu,1,cpad
        readu,1,histmap
    close,1
    print,histfilenm
 
                
    doy = 1  ; Have to skip doy=0 since the doy=0 vector is before
             ; the image actually begins ( or map ends )
    for i=0,350,13 do begin ;{   One day is ~13 degrees...

        lat = 0
            bigmap(i:i+12,0:2) = histmap(doy,lat)
               
        lat = lat + 1
        for j=3,181-4,5 do begin ;{
            bigmap(i:i+12,j:j+4) = histmap(doy,lat)
            lat = lat + 1
        endfor ;}
 
            bigmap(i:i+12,178:180) = histmap(doy,lat)

        doy = doy +1                                  
    endfor ;}
        bigmap(351:359,178:180) = histmap(doy,lat)
 
    if(ahdr(4) eq 2.) then bigmap=rotate(bigmap,7) ; Flip the west limb map.
    tv,bytscl(bigmap,min=mini,max=maxi)
    cursor,x,y,/normal
 
endwhile ;}
close,11
end
