C+ C NAME: C read_stellar_centroids.f C PURPOSE: C Read the ASHI image number and the x, y centroids of the rotated star from a file are read and given a star number C C CATEGORY: C I/O C CALLING SEQUENCE: C call read_stellar_centroids(cfile101,NSTAR,NOBS,Nstarb,Nstart,ixoffset,jyoffset,imagen,xrot,yrot) C C INPUTS: C cfile101*24 character Name of the ASHI image centroid file C NSTAR integer Total number of star possible in this list (must be larger than Nstartb + Nstart -1) C NOBS integer Number of images in the list (4591) C Nstarb integer Number of the beginning star with a given centroid positions C Nstart integer Total number of stars given a centroid position in the list C ixoffset integer x offset of the image to be added to my values C jyoffset integer y offset of the image to be added to my values C xrot(NSTAR,NOBS) real x position of input stellar centroid list C yrot(NSTAR,NOBS) real y position of input stellar centroid list C C OUTPUTS: C imagen integer # Number of the image in the filled x list C xrot(NSTAR,NOBS) real x position of the rotated stellar centroid for this image C yrot(NSTAR,NOBS) real y position of the rotated stellar centroid for this image C C FUNCTIONS/SUBROUTINES: C julian8, date_doy C C MODIFICATION HISTORY: C April-2022, Bernard Jackson (UCSD) C- subroutine read_stellar_centroids(cfile101,NSTAR,NOBS,Nstarb,Nstart,ixoffset,jyoffset,imagen,xrot,yrot) character cfile101*24 real xrot(NSTAR,NOBS) real yrot(NSTAR,NOBS) print*,' ' print*, ' Into read_stellar_centroids.f' print*, cfile101 open (13, file=cfile101,status='old',recl=120,access='sequential',form='formatted',iostat=iReadashi) if(iReadashi.ne.0) then print *, 'There is no ashi image file in this directory.' close(13) stop end if NOBST = 0 do I=Nstarb,Nstart read (13,'(1X,I4,2X,F4.0,F8.0)',iostat=iReadashi) imagen,xrot(I,imagen),yrot(I,imagen) if(iReadashi.eq.0) then C write(*,'(A,2I6,2F10.1)') 'I, image, raw xrot, yrot =',I,imagen,xrot(I,imagen),yrot(I,imagen) xrot(I,imagen) = xrot(I,imagen) + float(ixoffset) yrot(I,imagen) = yrot(I,imagen) + float(jyoffset) write(*,'(A,2I6,2F10.1)') 'I, image, fixed xrot, yrot =',I,imagen,xrot(I,imagen),yrot(I,imagen) NOBST = NOBST + 1 else close(13) print *, ' ' print *, 'Number of ASHI rotated centroids read x, y values read =',NOBST print *, ' ' return end if end do print *, ' ' print *, 'Number of ASHI rotated centroids read x, y values read =',NOBST print *, ' ' print *, ' Out of read_stellar_centroids.f' print *, ' ' return end