C+ C NAME: C program ashi_mag C PURPOSE: C To read the stellar magnitudes and distances from the image axis and determine the stellar brightness in degrees relative to the center C CALLING SEQUENCE: C ./ashi_mag 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_ashi_dist C C MODIFICATION HISTORY: C November 2022, Bernard Jackson (UCSD) C- program ashi_mag parameter(NTOT =35) ! Maximum number of stars with x, y values parameter(INUM = 1) ! Maximum number of observation of each star real distx (NTOT,INUM), ! X distance in pixels of the star & disty (NTOT,INUM), ! Y distance in pixels of the star & dcent (NTOT,INUM), ! distance of the star to the center of the image & adustp(NTOT,INUM), ! Stellar ADU peak brightness at it's location & adustt(NTOT,INUM) ! Stellar ADU total brightness at it's location real RA (NTOT), ! Star RA (degrees) & DEC (NTOT), ! Star Dec (degrees) & amagsv(NTOT) ! Stellar V mag value C character cfile*21 /'3rd_mag_centroids.txt'/ character cfile*21 /'Star_Bright_500_3.txt'/ character chead*80 sunmv = -26.73 ! -26.73 Usually used for S10 Sparrow and Wineberg (1964) oneS10 = 10.0 ! brightness of a tenth magnitude star in a square degree of sky C bsunS10 = 1.0*2.512**(oneS10 - sunmv) ! brightness of the Sun in S10 units skyS10 = 205 ! Cox page 649 night sky brightness scalesta = 10.42 ! Matthew's scale for degree standard C scalesta = 10.5466 ! scale per degree standard from 0 to 56 degrees Bernie's bsunS10 = 1.0*(10**(0.4*(10.0+26.73))) ! brightness of the Sun in S10 units C bSirius = bsunS10*2.512**(sunmv + 1.46) ! brightness of Sirius in S10 bSirius = bsunS10*(10**(0.4*(sunmv + 1.46))) ! brightness of Sirius in S10 C bfirst = bsunS10*2.512**(sunmv - 1.00) ! brightness of a first magnitude star in S10 bfirst = bsunS10*(10**(0.4*(sunmv - 1.0))) ! brightness of a first magnitude star in S10 print*, sunmv, bsunS10, bfirst, bSirius C stop open (13,file=cfile,status='old',recl=120,access='sequential',form='formatted',iostat=iReadashi) if(iReadashi.ne.0) then C print *, 'There is no ASHI 3rd_mag_centroids.txt file in this directory' print *, 'There is no ASHI Star_Bright_500_3.txt file in this directory' close(13) end if NSTAR = 0 NOBS = 1 I = NOBS do J=1,NTOT if(J.eq.1) then read (13,'(A)') chead C print*,chead print*,' ' print*,'Image Xcent Ycent D-cent Pk ADU ToT ADU RA Dec Mag V' end if read (13,'(I5,F13.3,4F11.3,F10.2,F9.2,F9.3)',iostat=iReadashi), & image,distx(J,I),disty(J,I),dcent(J,I),adustp(J,I),adustt(J,I),RA(J),DEC(J),amagsv(J) if(iReadashi.eq.0) then NSTAR = NSTAR + 1 write(*,'(I5,3F9.3,F10.3,F11.3,2F7.2,F7.3)'), & image,distx(J,I),disty(J,I),dcent(J,I),adustp(J,I),adustt(J,I),RA(J),DEC(J),amagsv(J) else close(13) end if end do print *, ' ' print *, 'Number of ASHI stars read in =',NSTAR do J=1,NSTAR if(J.eq.1) then print*,' ' write(*,'(A)')'Image Xcent Ycent D-cent Pk ADU ToT ADU RA Dec Mag V S10' end if C starS10 = bsunS10*2.512**(sunmv - amagsv(J)) ! brightness of our star in S10 starS10 = bsunS10*(10**(0.4*(sunmv - amagsv(J)))) ! brightness of our star in S10 write(*,'(I4,2F8.2,F9.3,F10.3,F11.3,2F7.2,F6.2,F8.1)'), & image,distx(J,I),disty(J,I),dcent(J,I),adustp(J,I),adustt(J,I),RA(J),DEC(J),amagsv(J),starS10 end do do J=1,NSTAR if(J.eq.1) then print*,' ' write(*,'(A)')'Image Pk ADU ToT ADU RA Dec Mag V S10 S10/ADU ADU/S10' end if starS10 = bsunS10*2.5**(sunmv - amagsv(J)) write(*,'(I4,F10.3,F11.3,2F7.2,F6.2,F8.1,F10.6,F9.3)'), & image,adustp(J,I),adustt(J,I),RA(J),DEC(J),amagsv(J),starS10,starS10/adustt(J,I),adustt(J,I)/starS10 end do stop end