C+ C NAME: C program ashi_img_comb C PURPOSE: C To read the ASHI image grd files, rotate, stretch and combine them together C CALLING SEQUENCE: C ./ashi_img_comb C INPUTS: C N integer number of distance determinations = 4 C distx(N,I) real X distance in pixels from the axis C disty(N,I) real Y distance in pixels from the axis C offset1 real offset for determination 1 C offset2 real offset for determination 2 C offset3 real offset for determination 3 C offset4 real offset for determination 4 C C FUNCTIONS/SUBROUTINES: C read_grd_image C C MODIFICATION HISTORY: C November 2022, Bernard Jackson (UCSD) C- program ashi_img_comb parameter(NOBS = 4591) ! Potential Number of valid images parameter(NTOT = 35) ! Potential number of stellar values parameter(NXY = 2048) ! Maximum number of x or y values in each grd image parameter(ihead = 5) ! # of lines in the GRD file header parameter(NRA = 3600) ! size in RA of images parameter(NDEC = 1800) ! size in Dec of images parameter(NBAK = 100) ! Background images to subtract real st (NOBS), ! Sidereal time for each measurement & rotrmm (NOBS), ! mean rotation from Matthew's center & rotrmb (NOBS), ! mean rotation from Bernie's center & xp (NOBS), ! mean X location of the pole in the original images & yp (NOBS), ! mean Y location of the pole in the original images & centxp (NOBS), ! Pole X mean center on unrotated image from Polaris & centyp (NOBS), ! Pole Y mean center on unrotated image from Polaris & centx (NOBS), ! Matthew's or Bernie's mean X center & centy (NOBS), ! Matthew's or Bernie's mean Y center & PDIST (NOBS), ! mean distance to the pole that needs to be calculated & XDIST (NOBS), ! The distcx carried through the rotations (same as at start) & YDIST (NOBS), ! The Warped distcy & BACKM (NOBS), ! The Minimum Background distance for this image set & PED (NOBS) ! A pedestal determined by an image portion distant from the image center integer IVAL (NOBS) ! The num3 image at the center of the composite real RA (NTOT), ! Star RA (degrees) & DEC (NTOT), ! Star Dec (degrees) & amagsv(NTOT) ! Stellar V mag value character cfilei*52 /'./ASHI_grd_files/ASHI_Flight_Grds/ASHI_img_00000.grd'/ ! Location and name of an output file if there is one character cfileii*57 ! Cycle 2 input files character cfileo*57 ! Location and name of the output file if there is one character cfileibk*54 ! Location and name of the background input file if there is one character cfileibak(NOBS)*54 ! Name of any background input file if there is one character cimghead(ihead)*9 ! Grd file 5 line header character cfile*21 /'Star_Bright_500_3.txt'/ character cfilrm*29 /'pr_t_lat_lon_2rot_delt_rm.txt'/ ! ST and Rotations from Matthew's and Bernie's center with sidereal time character cfilrb*26 /'pr_star_pole_cen_xy_rm.txt'/ ! Polaris location, pole location, and centroid of Bernie's center character cfilcxy*21 /'rot_cents_x_and_y.txt'/ ! The rotated x and y centers derived in the rotation subroutines real aimagexy (NXY,NXY), ! Original image read in in floating point & aimagexyr (NXY,NXY), ! Rotated image in floating point & aimagexyn (NXY,NXY), ! image pixel hit number in floating point & aimagexyo (NXY,NXY), ! image pixel amplitudes removed & aimage (NXY,NXY,NOBS), ! images to combine & aimagebak (NXY,NXY), ! background image to remove & aimagebakk(NXY,NXY) ! Dummy background image needs a zero C For cycle 5 real aimagexyrd(NXY,NXY), & aimagexyre(NXY,NXY), & aimagexyrb(NXY,NXY) integer imagexyd(NXY,NXY), & imagexye(NXY,NXY), & imagexyb(NXY,NXY) C End For cycle 5 real cimradec (NRA,NDEC), ! composite images in RA, DEC & ocimradec(NRA,NDEC) ! thrown out composite images in RA, DEC integer ncimradec(NRA,NDEC) ! Number of hits in composite images in RA, DEC integer imagexy(NXY,NXY) ! Original image read in in fixed point real*8 doys8(NOBS) ! Input Julian date of observation in UT time. distcx = 1126.5 ! center of the image in X as determined by Matthew distcy = 1000.5 ! center of the image in Y as determined by Matthew C dmax = 900.0 ! Distance from center beyond which image is zero dmax = 950.0 ! Distance from center beyond which image is zero (includes corral) C irotm = 0 irotm = 1 ! Read in ST and the rotation to get the pole to a vertical position print*, 'In program ashi_im_comb' if(irotm.eq.1) call read_rot_rm_matc(cfilrm,NOBS,doys8,st,rotrmm) ! Read in the sidereal time and mean rotation from Matthew's center irotb = 1 ! Read in the unrotated mean pole position if(irotb.eq.1) call read_cen_rm_bvjc(cfilrb,NOBS,centxp,centyp,centx,centy) ! Read in the mean rotation of the pole and Bernie's cent cfileibk = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_Back.grd' bakmin = 171.000 irotm = 1 if(irotm.eq.1) then ! overwrite mean centx and centy with Matthew's centers do I=1,NOBS centx(I) = distcx centy(I) = distcy doys8(I) = doys8(I) - 2459579.5d0 cfileibak(I) = cfileibk BACKM(I) = bakmin PED(I) = 0.0 end do end if NYDIS = 0 if(irotb.eq.1) then ! determine the mean distance from Matthew's center to the pole position in pixels. do I=1,NOBS PDIST(I) = sqrt((centxp(I)-distcx)**2 + (centyp(I)-distcy)**2) C if(I.le.30) print*, I, PDIST(I) C print*, I, PDIST(I)/10.396 end do end if C stop C itype integer Type of file input and output C 0 = read in and write out a grd file with <= 5 integer digits C 1 = read in a grd file with <= 5 integer digits; write out a grd file with F8.1 floating values C 2 = read in a grd file with <= 5 integer digits; output a file with F8.1 floating values C 3 = read in and write out a grd file with F8.1 floating values C 4 = input a grd file with <= 5 integer digits; output with <= 5 integer digits values C 5 = input a grd file with <= 5 integer digits; output a file with F8.1 floating values C 6 = input a grd file with <= 5 integer digits; write out a grd file with F8.1 floating values C 7 = input a grd file with <= 5 integer digits; write out a grd file with <= 5 integer digits values C 8 = input a grd file with F8.1 floating values; write out a grd file with F8.1 floating values C 9 = input a grd file with F8.1 floating values; write out a grd file with <= 5 integer digits values C 10 = input a grd file with F8.1 floating values; output a grd file with F8.1 floating values C 11 = input a grd file with F8.1 floating values; output a file with F8.1 floating values C 12 = read in a grd file with F8.1 floating values and output the file - 1 value input short each line C 13 = read in a grd file with F8.2 floating values and output the file C 14 = read in and write out a grd file with F9.2 floating values C 15 = input and write out a grd file with F9.2 floating values C C itype = 0 itype = 2 C C indx integer Type of operation for the rot_image_2pole subroutine C 0 = Rotate the image so that the pole is at the top (always do this) C 1 = indx 0 + shift index in y so pole is at the a given pixel location C 2 = indx 0 + 1 + warp the image relative to the y center pixel location C 3 = indx 0 + 1 + 2 + change the image to spherical coordinates C 4 = indx 0 + 1 + 2 + 3 + rotate the image location around the pole according to the new sidereal time C indx = 3 ! convert to spherical coords C indx = 2 ! rotate and warp image icycle = 0 ! go through the read sequence and rotation only once indx = 3 if(indx.eq.3) then call read_centxy(cfilcxy,NOBS,XDIST,YDIST,PDIST,BACKM,PED) icycle = 1 end if C inum1 = 2802 C inum1 = 800 C inum2 = 2804 C inum3 = 2805 C inum4 = 2813 C inum2 = 2813 C inum2 = 2350 C inum3 = 2900 C inum3 = 4180 C inum1 = 4180 C inum2 = 4184 C inum3 = 4185 C inum4 = 4191 C inum4 = 4580 C inum1 = 2801 C inum2 = 2813 C inum3 = 2814 C inum4 = 2850 C inum1 = 4150 C inum2 = 4159 C inum3 = 4160 C inum4 = 4199 C inum1 = 580 C inum2 = 580 C inum3 = 582 C inum4 = 582 C if(itype.eq.0.or.itype.eq.6.and.inum.eq.500) cfileo = './ASHI_grd_files/ASHI_i90_10500.grd' ! fixed if(itype.eq.1.or.itype.eq.3.or.itype.eq.7.or.itype.eq.8.and.inum.eq.500) cfileo = './ASHI_grd_files/ASHI_img_20500.grd' ! floating C C L11 = 101 C L22 = 150 C C L11 = 4401 C l22 = 4450 C L11 =101 C L22 =120 C L11 =401 C L22 =420 L11 = 641 ! 3 part first part L22 = 660 ! 3 part first part C L11 = 1941 ! 3 part second part C L22 = 1960 ! 3 part second part C L11 = 3241 ! 3 part third part C L22 = 3260 ! 3 part third part L1 = L11 L2 = L22 C icycle = 5 ibak = 0 C ibak = 1 if(ibak.eq.1) then bakmin = 2000.0 1001 continue print*,' ' print*, 'after 1001 L1, L2',L1,L2 do L=L1,L2 inum1 = L1 inum2 = L1 + (L2 - L1)/2 inum3 = inum2 + 1 inum4 = Inum3 + (L2 - L1)/2 C if(L.eq.inum4) write(*,'(A,7I7)') 'to here 1a',L,L1,L2,inum1,inum2,inum3,inum4 if(L.eq.inum4) then C write(*,'(A,7I7)') 'to here 1b',L,L1,L2,inum1,inum2,inum3,inum4 write(*,'(A,2X,A)') 'cfileibk',cfileibk if(inum1.ge.100.and.inum1.le.999) write(cfileibk(28:30),'(I3)') inum1 if(inum1.ge.1000.and.inum1.le.9999) write(cfileibk(27:30),'(I4)') inum1 if(inum2.ge.100.and.inum2.le.999) write(cfileibk(33:35),'(I3)') inum2 if(inum2.ge.1000.and.inum2.le.9999) write(cfileibk(32:35),'(I4)') inum2 if(inum3.ge.100.and.inum3.le.999) write(cfileibk(38:40),'(I3)') inum3 if(inum3.ge.1000.and.inum3.le.9999) write(cfileibk(37:40),'(I4)') inum3 if(inum4.ge.100.and.inum4.le.999) write(cfileibk(43:45),'(I3)') inum4 if(inum4.ge.1000.and.inum4.le.9999) write(cfileibk(42:45),'(I4)') inum4 cfileibak(inum2) = cfileibk C write(*,'(A,A)') 'before read_grd_image ',cfileibak(inum2) ityp = 12 call read_grd_image(ityp,cfileibak(inum2),cfileo,NXY,dmax,cimghead,aimagebak,imagexy) bakmi = 2000.0 do J=1,NXY do I=1,NXY dx = float(I) - distcx if(YDIST(inum2).lt.1.0) YDIST(inum2) = distcy ! Safety if no composite value is available dy = float(J) - YDIST(inum2) azideg = atan2d(dy,dk) distbak = sqrt(dy**2 + dx**2) C if(I.eq.1000.and.J.eq.1000) print*, dx,dy,YDIST(inum2),azideg,distbak,aimagebak(I,J) if(distbak.lt.700) then if(aimagebak(I,J).lt.bakmi.and.aimagebak(I,J).ne.0.0) bakmi = aimagebak(I,J) end if if(distbak.gt.800) then if(nint(azideg).eq.0) write(*,'(A,2I5,3F10.2)') I,J,azideg,distbak,aimagebak(I,J) end if end do end do write(*,'(A,F12.5)') ' This minimum background value is:', bakmi BACKM(inum2) = bakmi L2ML1 = L2 - L1 L1 = L2 + 1 L2 = L1 + L2ML1 if(bakmi.lt.bakmin) bakmin = bakmi if(L1.lt.4550) go to 1001 C if(L1.lt.3321) go to 1001 end if C end do write(*,'(A,F12.5)') ' The final minimum background value is:', bakmin C iwritebak = 0 if(iwritebak.eq.1) then C Begin below the check that each background file is read correctly and print it out. itype = 8 cfileo = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_BBak.grd' print*, cfileibak(inum2) print*, cfileo if(inum1.ge.100.and.inum1.le.999) write(cfileo(28:30),'(I3)') inum1 if(inum1.ge.1000.and.inum1.le.9999) write(cfileo(27:30),'(I4)') inum1 if(inum2.ge.100.and.inum2.le.999) write(cfileo(33:35),'(I3)') inum2 if(inum2.ge.1000.and.inum2.le.9999) write(cfileo(32:35),'(I4)') inum2 if(inum3.ge.100.and.inum3.le.999) write(cfileo(38:40),'(I3)') inum3 if(inum3.ge.1000.and.inum3.le.9999) write(cfileo(37:40),'(I4)') inum3 if(inum4.ge.100.and.inum4.le.999) write(cfileo(43:45),'(I3)') inum4 if(inum4.ge.1000.and.inum4.le.9999) write(cfileo(42:45),'(I4)') inum4 print*, cfileo call read_grd_image(itype,cfileibak(inum2),cfileo,NXY,dmax,cimghead,aimagebak,imagexy) stop end if end if C End above to check background file read correctly and print it out. C print*,' ' print*,' ' print*,'The background minima have been determined. Now begin the image reads.' L1 = L11 L2 = L22 1000 continue print*,' ' print*,'New image set read' print*, 'L1, L2',L1,L2 do L=L1,L2 inum1 = L1 inum2 = L1 + (L2 - L1)/2 inum3 = inum2 + 1 inum4 = inum3 + (L2 - L1)/2 print*, 'inum1,inum2,inum3,inum4',inum1,inum2,inum3,inum4 if(icycle.eq.0) then do K=inum1,inum2 if(itype.eq.2) then write(*,'(A)') cfilei if(K.ge.1.and.K.le.9) write(cfilei(48:48),'(I1)') K if(K.ge.10.and.K.le.99) write(cfilei(47:48),'(I2)') K if(K.ge.100.and.K.le.999) write(cfilei(46:48),'(I3)') K if(K.ge.1000.and.K.le.9999) write(cfilei(45:48),'(I4)') K write(*,'(A)') cfilei call read_grd_image(itype,cfilei,cfileo,NXY,dmax,cimghead,aimagexy,imagexy) do J=1,NXY do I=1,NXY aimage(I,J,K) = aimagexy(I,J) aimagexy(I,J) = 0.0 end do end do ibak = 0 if(ibak.eq.1) then if(K.eq.inum1) then C print*,' ' print*,'This is a background image read' ityp = 12 call read_grd_image(ityp,cfileibak(inum2),cfileo,NXY,dmax,cimghead,aimagebakk,imagexy) print*,' ' C do J=1,NXY do I=1,NXY aimagebak(I,J) = aimagebakk(I,J) C if(I.eq.1000.and.J.eq.1000) print*,'to here 3', I,J, aimagebak(I,J) aimagebakk(I,J) = 0.0 ! Zero aimagebakk(I,J) once read end do end do end if end if end if end do end if C if(icycle.eq.0) then print*,'Just before rot_image_2pole' if(indx.le.2) then dmax = 950.0 call rot_image_2pole(indx,NXY,inum1,inum2,inum3,inum4,NOBS,NRA,NDEC,centx,centy,dmax,rotrmm,PDIST,doys8,st, & aimagebak,aimage,bakmin,aimagexyr,aimagexyn,aimagexyo,cimradec,ncimradec,ocimradec,XDIST,YDIST,BACKM,PED) end if end if C if(icycle.eq.1) then if(indx.gt.2) then cfileii = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_Stars.grd' if(inum1.ge.100.and.inum1.le.999) write(cfileii(28:30),'(I3)') inum1 if(inum1.ge.1000.and.inum1.le.9999) write(cfileii(27:30),'(I4)') inum1 if(inum2.ge.100.and.inum2.le.999) write(cfileii(33:35),'(I3)') inum2 if(inum2.ge.1000.and.inum2.le.9999) write(cfileii(32:35),'(I4)') inum2 if(inum3.ge.100.and.inum3.le.999) write(cfileii(38:40),'(I3)') inum3 if(inum3.ge.1000.and.inum3.le.9999) write(cfileii(37:40),'(I4)') inum3 if(inum4.ge.100.and.inum4.le.999) write(cfileii(43:45),'(I3)') inum4 if(inum4.ge.1000.and.inum4.le.9999) write(cfileii(42:45),'(I4)') inum4 print*, cfileii itype = 14 ! reads in and outputs a composite image call read_grd_image(itype,cfileii,cfileo,NXY,dmax,cimghead,aimagexyr,imagexy) do JJJ=1,NXY do III=1,NXY aimage(III,JJJ,inum2) = aimagexyr(III,JJJ) end do end do end if C if(inum4.ge.4520) then ! normal whole C if(inum4.ge.1940) then ! 3 part attempt 10/30/2023 C if(inum4.ge.3240) then ! 3 part attempt 10/30/2023 if(inum4.ge.4540) then ! 3 part attempt 10/30/2023 C if(inum4.ge.820) then print*, '1 to end of reads set icycle to 2, inum4 =',inum4 C inum1 = 2001 ! normal whole from 2001 - 4500 inum1 = 641 ! 3 part attempt 10/30/2023 C inum1 = 1941 ! 3 part attempt 10/30/2023 C inum1 = 3241 ! 3 part attempt 10/30/2023 C inum1 = 401 C inum2 = 490 C inum2 = 2800 C inum2 = 2790 ! normal whole from 2001 - 4500 around bad spot, else these join C inum2 = 700 ! 3 part attempt 10/30/2023 inum2 = 2790 ! 3 part attempt 1941 - 1920 around bad spot, else these join C inum2 = 3300 ! 3 part attempt 10/30/2023 C inum3 = 541 C inum3 = 501 C inum3 = 2901 ! normal whole from 2001 - 4500 around bad spot, else these join C inum3 = 701 ! 3 part attempt 10/30/2023 inum3 = 2901 ! 3 part attempt 1941 - 1920 around bad spot, else these join C inum3 = 3301 ! 3 part attempt 10/30/2023 C inum4 = 820 C inum4 = 2000 C inum4 = 4500 C inum4 = 4520 ! normal whole from 2001 - 4500 C inum4 = 1940 ! 3 part attempt 10/30/2023 C inum4 = 3240 ! 3 part attempt 10/30/2023 inum4 = 4540 ! 3 part attempt 10/30/2023 indx = 3 icycle = 2 C if(inum4.gt.2000) stop C if(inum4.gt.4520) stop ! normal whole from 2001 - 4500 C if(inum4.gt.1940) stop ! 3 part attempt 10/30/2023 C if(inum4.gt.3240) stop ! 3 part attempt 10/30/2023 if(inum4.gt.4540) stop ! 3 part attempt 10/30/2023 C if(inum4.gt.820) stop go to 1002 end if end if 1002 continue C if(icycle.eq.5) then if(icycle.eq.7) then ! This will never happen do I=1,2024 do J=1,2024 do K=1,2 aimagexyre(I,J) = 0.0 imagexye (I,J) = 0 aimagexyrb(I,J) = 0.0 imagexyb (I,J) = 0 aimagexyrd(I,J) = 0.0 imagexyd (I,J) = 0 end do end do end do dmax= 3000 cfileii = './ASHI_grd_files/ASHI_img_2001-2790_2901-4520_StarT.grd' print*, cfileii itype = 14 ! reads in and outputs a composite image call read_grd_image(itype,cfileii,cfileo,NXY,dmax,cimghead,aimagexyre,imagexye) cfileii = './ASHI_grd_files/ASHI_img_0401-0490_0501-2000_StarT.grd' print*, cfileii itype = 14 ! reads in and outputs a composite image call read_grd_image(itype,cfileii,cfileo,NXY,dmax,cimghead,aimagexyrb,imagexyb) do I=1,2024 do J=1,2024 if(aimagexyre(I,J).gt.0.0.and.aimagexyrb(I,J).gt.0.0) then aimagexyrd(I,J) = (aimagexyre(I,J) - aimagexyrb(I,J))*0.035 ! 0.035 is the conversion from ADU to brightness in S10 imagexyd(I,J) = imagexye(I,J) C aimagexyrd(I,J) = aimagexyrd(I,J)*(-float(I)/(4.0/2048.0)) + 4.0 if(I.le.2048.and.aimagexyrd(I,J).lt.4000.0) aimagexyrd(I,J) = aimagexyrd(I,J) -float(I)*9.0/2048.0 + 4.0 end if end do end do itype = 15 cfileo = './ASHI_grd_files/ASHI_img_2001-4520-0501-2000_Sdiff.grd' print*, cfileo call read_grd_image(itype,cfilei,cfileo,NXY,dmax,cimghead,aimagexyrd,imagexyd) stop end if if(icycle.eq.2) then indx = 3 if(indx.ge.3) then dmax= 820 print*, 'Got to rot_image_2ra_dec' call rot_image_2ra_dec(indx,NXY,inum1,inum2,inum3,inum4,NOBS,NRA,NDEC,centx,centy,dmax,rotrmm,PDIST,doys8,st, & aimagebak,aimage,bakmin,aimagexyr,aimagexyn,aimagexyo,cimradec,ncimradec,ocimradec,XDIST,YDIST,BACKM,PED) end if end if C if(icycle.eq.0.or.icycle.eq.2) then icombo = 1 if(icombo.eq.1) then dmax = 850.0 if(indx.eq.3) dmax= 3000 itype = 15 if(icycle.eq.0) cfileo = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_Combo.grd' if(icycle.eq.1) cfileo = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_Stars.grd' if(icycle.eq.2) cfileo = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_StarT.grd' if(inum1.ge.100.and.inum1.le.999) write(cfileo(28:30),'(I3)') inum1 if(inum1.ge.1000.and.inum1.le.9999) write(cfileo(27:30),'(I4)') inum1 if(inum2.ge.100.and.inum2.le.999) write(cfileo(33:35),'(I3)') inum2 if(inum2.ge.1000.and.inum2.le.9999) write(cfileo(32:35),'(I4)') inum2 if(inum3.ge.100.and.inum3.le.999) write(cfileo(38:40),'(I3)') inum3 if(inum3.ge.1000.and.inum3.le.9999) write(cfileo(37:40),'(I4)') inum3 if(inum4.ge.100.and.inum4.le.999) write(cfileo(43:45),'(I3)') inum4 if(inum4.ge.1000.and.inum4.le.9999) write(cfileo(42:45),'(I4)') inum4 print*, cfileo call read_grd_image(itype,cfilei,cfileo,NXY,dmax,cimghead,aimagexyr,imagexy) end if print*,'To here 3 end of write StarT.grd, Stop at inum4 =',inum4 C if(inum4.eq.820) stop C if(inum4.gt.2000) stop C if(inum4.eq.4520) stop ! normal whole from 2001 - 4500 C if(inum4.eq.1940) stop ! 3 part attempt 10/30/2023 C if(inum4.eq.3240) stop ! 3 part attempt 10/30/2023 if(inum4.eq.4540) stop ! 3 part attempt 10/30/2023 print*,'To here 4, Did we stop?',inum4 end if C icout = 0 if(icout.eq.1) then itype = 15 cfileo = './ASHI_grd_files/ASHI_img_Cout.grd' print*, cfileo cfileo = './ASHI_grd_files/ASHI_img_00XX-00XX_00XX-00XX_Cout.grd' if(inum1.ge.100.and.inum1.le.999) write(cfileo(28:30),'(I3)') inum1 if(inum1.ge.1000.and.inum1.le.9999) write(cfileo(27:30),'(I4)') inum1 if(inum2.ge.100.and.inum2.le.999) write(cfileo(33:35),'(I3)') inum2 if(inum2.ge.1000.and.inum2.le.9999) write(cfileo(32:35),'(I4)') inum2 if(inum3.ge.100.and.inum3.le.999) write(cfileo(38:40),'(I3)') inum3 if(inum3.ge.1000.and.inum3.le.9999) write(cfileo(37:40),'(I4)') inum3 if(inum4.ge.100.and.inum4.le.999) write(cfileo(43:45),'(I3)') inum4 if(inum4.ge.1000.and.inum4.le.9999) write(cfileo(42:45),'(I4)') inum4 print*, cfileo call read_grd_image(itype,cfilei,cfileo,NXY,dmax,cimghead,aimagexyo,imagexy) end if L2ML1 = L2 - L1 L1 = L2 + 1 L2 = L1 + L2ML1 itype = 2 C if(inum4.ge.810.and.icycle.eq.1) then if(inum4.ge.4540.and.icycle.eq.1) then print*, '2 to end of reads set cycle to 2' inum1 = 2001 C inum1 = 401 C inum2 = 520 inum2 = 2790 C inum2 = 2800 C inum3 = 2900 inum3 = 2901 C inum3 = 521 C inum4 = 820 inum4 = 4520 indx = 3 icycle = 2 if(inum4.gt.4540) stop C if(inum4.gt.820) stop go to 1000 end if if(inum4.ge.4540.and.icycle.eq.0) then C if(inum4.ge.250) then if(itype.le.2) then print*,' composite image value distcx distcy' do III=1,NOBS write(*,'(I5,5F12.5)'), III, XDIST(III), YDIST(III), PDIST(III), BACKM(III), PED(III) end do print*, ' ' write(*,'(A,F12.5)') ' The final minimum background value is:', bakmin print*, ' ' print*, 'The program has ended successfuly' end if stop end if icycle = 1 go to 1000 end do stop end