c+ c name: mv2smei.for c purpose: This program reads a keyboard-selected spectrum file and uses the c manufacturer's QE data for a CCD, and 2 reflections from aluminum c to calculate an effective scaling factor from visual magnitude to "smei magnitude" c inputs: Various XXXXX.dat files containing spectra normalized to unity at about 5500 A, c and whose name contains the spectral type, e.g. 'a0I.dat' or 'b3iii.dat'. c These files were downloaded from Pickels (Susan Rappoport). c All spectra were run, the numbers laboriously entered into a table 'stars2smei.txt' c Spectral types are here represented by a number ranging from zero (spectral O0) c to 69 (spectral M9). Not all of these spectral types are represented in nature. c Similarly, 5 Separate columns cover the five luminosity classes c c Then the missing entries were filled in by "hipshot" to generate a complete table; c Entries for 67, 68, and 69 are truncated at 10, and are extremely unreliable. c Searching for these M7, M8, and M9 stars in SMEI prototype data gives a mixed c result, with some stars not visible and others very bright. c outputs: A number adjusted to be unity for g5V which scales to 'smei magnitude' c calls: c mods: Written March 2002, Andrew Buffington (UCSD; (858)-534-6630; abuffington@ucsd.edu) c- program mv2smei implicit none c c This program integrates over the specified spectrum, with the c SMEI CCD responsivity and reflectivity, interpolated by wavelength c real*4 QE(17),refl(17),lambda,ratio,arg,sum,interp,factor integer*4 i,iarg character*9 infile character*5 filez,blanks c*** EEV CCD05-30, page 4 of data sheet data QE /0.,.01,0.04,0.14,0.30,0.35,0.44,0.46,0.45,0.42,0.38,0.28,0.21, & 0.13,0.05,0.01,0.0/ c*** Reflectivity for SiOx coated aluminum, Edmund Scientific graph data refl/0.86,0.89,0.91,4*0.92,0.91,0.90,0.88,0.86,0.90,0.91,0.95,0.97,0.98,0.98/ data infile /'XXXXX.dat'/ data blanks /' '/ c 1 sum=0. c write(6,'(a)')' Enter file input name: XXXXX' read (5,'(a)')filez if(filez.eq.blanks)go to 99 write(infile(1:5),'(a5)')filez open (10,file=infile,readonly) do i=1,1895 read (10,10)lambda,ratio 10 format(f7.1,f10.6) c print *,i,lambda,ratio arg=1.+(lambda-3000.)/500. iarg=ifix(arg) if(iarg.ge.1.and.iarg.le.16)then interp=arg-float(iarg) factor=(1.0-interp)*refl(iarg)*refl(iarg)*QE(iarg)+interp*refl(iarg+1)*refl(iarg+1)*QE(iarg+1) 20 format(f7.1,3f10.4) sum=sum+ratio*factor endif enddo sum=sum/238.03793 print 11,infile,sum 11 format(' file = ',a9,', sum = ',f10.5) go to 1 99 stop 'reached end' end