03 ' This is a modified version of Schaefer's 1993 Qbasic program that 04 ' sets parameters for observing the 2009 LCROSS impact. Suggests 05 ' parameters for Salt Lake City, Utah. Other op's prompted to 06 ' enter relevant parameters; reports estimated sky apparent 07 ' brightness in MPSAS on limb. 08 ' Salt Lake City, Utah By fisherka@csolutions.net 09 ' 10 ' Visibility of an Occultation 15 SF = 71.0: 20 PRINT "Moon's sunlit percentage ";SF 24 PRINT "Alt in SLC UT is 74.58 degs (90-74.58=15.4 Zenith Distance)" 25 PRINT "Zenith distance of star (degrees) for SLC Enter 15.4 or enter your o.p.'s Sun altitude." 30 INPUT "Zenith distance of star (degrees) ";Z 34 PRINT "Height of Sun above horizon in SLC Enter -23.1 or enter your o.p.'s Sun altitude." 40 INPUT "Height of Sun above horizon ";HS 45 PRINT "Cusp angle (<0 for bright side) in deg. Enter -87 for an assumed " 46 PRINT "impact slightly on bright terminator side or " 47 PRINT "enter 87 for an assumed impact slighty on dark side of terminator." 50 INPUT "Cusp angle (<0 for bright side) in deg ";C 60 BV=.7: ' Star's color index, B-V (in mags.) 65 K=0.0 ' Pre RASC 2003 handbook at 74.6 degs alt 70 PRINT "Vis. extinction coeff. (mag./airmass) ";K 74 PRINT "Brightness from light pollution (nL) in SLC Enter 7.96E+08 for a 3.8 ZLM. Or enter 0." 75 PRINT "Recommend entering 0 first for a dark sky, then rerun with light polluted sky." 80 INPUT "Brightness from light pollution (nL) ";BC 90 SE=1.5: ' Seeing disk diameter at zenith (arcsec) 95 PRINT "Seeing disk diameter at zenith (arcsec) ";SE 97 FV=17: ' Moon fraction in field of view (%) using a 4mm e.p. 100 PRINT "Moon fraction in field of view (%) ";FV 105 D=10: ' Telescope aperture (inches) 110 PRINT "Telescope aperture (inches) ";D 120 M=300: ' Magnification 125 PRINT "Magnification ";M 130 TR=88: ' Telescope throughput (%) 135 PRINT "Telescope throughput (%) ";TR 140 AG=30: ' Observer's age (years) 150 RS=1: ' Snellen ratio (20/20=1, 20/40=0.5,...) 160 EX=5: ' Experience (1-9; 5=average, 9=expert) 170 MS=0.9: ' Star's visual magnitude 175 PRINT "Equivalent LCROSS cloud integrated magnitude";MS 180 PRINT "Choose program mode --" 190 PRINT " (1) Minimum aperture" 200 PRINT " (2) Limiting magnitude" 210 INPUT Q$: IF Q$<>"1" AND Q$<>"2" THEN 210 220 IF Q$="2" THEN 270 230 D=.5: ' Find minimum telescope aperture 240 D=D+.1: M=25*D: GOSUB 290: IF MS>ML THEN 240 250 PRINT "Aperture should be at least" ;D;" inches" 251 PRINT "Apparent sky brightness (in atmosphere) (nL) at lunar limb ";BA 252 PRINT "Apparent sky brightness (in atmosphere) MPSAS at lunar limb ";BMPSAS 260 GOTO 280 270 GOSUB 290: PRINT "Limiting magnitude is ";ML 271 PRINT "Apparent sky brightness (in atmosphere) (nL) at lunar limb ";BA 272 PRINT "Apparent sky brightness (in atmosphere) MPSAS at lunar limb ";BMPSAS 280 END 290 ' Routine to find lim. mag. for given conditions 300 XX=COS(Z/57.295): ' First, estimate corrections 310 X=1/(XX+.025*EXP(-11*XX)): ' Airmass of Moon 320 ZE=SQR(2.89*X*SE^2+(17.9/D)^2):'2nd moment of image 330 F1=10^(.4*K*X): ' Extinction 340 F2=1.41: ' Binocular vision 350 F3=100/TR: ' Transmission of scope 360 DE=4: ' Guess that pupil is 4mm 370 F4=(25.4*D/(M*DE))^2: ' Light outside pupil 380 IF F4<1 THEN F4=1 390 F5=(DE/(25.4*D))^2: ' Light gathering power 400 XX=1-EXP(-.026*DE^2) 410 YY=1-EXP(-.026*(25.4*D/M)^2) 420 F6=(25.4*D/(DE*M))^2*XX/YY:'Stiles-Crawford effect 430 IF F6>1 THEN F6=1 440 F7=(1+.03*(M*ZE/100)^2)/RS^2: ' Resolving the star 450 FI=F1*F2*F3*F4*F5*F6*F7:' Corr. for intensities 460 FB=M^2*F2*F3*F4*F5*F6:'Corr. for surface brightness 470 ' Calculate brightness of Moon 480 CP=SF/50-1 490 IF CP=0 THEN PH=3.14159/2: GOTO 520 500 PH=ATN(SQR(1-CP*CP)/CP): ' Lunar phase (0 is full) 510 IF CP<0 THEN PH=PH+3.14159 520 DM=1.49*PH+.043*(PH^4)-12.73 : ' Moon's magnitude 530 IM=10^(-.4*(DM+16.57)): ' Intensity of Moon 540 BM=5.67E+12*IM/(F1*SF): ' Moon brightness (nL) 550 SP=3.14159-PH: ' Earth's phase from Moon 560 XX=1.49*SP+.043*(SP^4)-12.73 570 BE=1.1E+07*10^(-.4*(XX+16.57))/F1: ' Earthshine 580 ' Calculate glare brightness 590 XX=(COS(C/57.295))^2+(1-SF/100+SIN(C/57.295))^2 600 YY=(1-.4*EXP(-1*C/30)) 610 IF YY<.6 THEN YY=.6 620 TH=.25*SQR(XX)*YY: ' Effective distance to Moon 630 B1=6.25E+07*IM*(F1-1)/(TH*F1)^2:'Scattering in air 640 B2=4.63E+07*IM*(FV/100)/(TH^2*F1):'Scat. in eye 650 B3=443000*IM/(TH^3*D*F1): ' Diffraction 660 B4=2.6E+08*IM*EXP(-1*(TH/.4)^2)/F1: ' By mirror 670 BG=B1+B2+B3+B4: ' Glare brightness 680 ' Calculate effective background brightness 690 XX=1-.96*(SIN(Z/57.295))^2 700 BN=180*(.4+.6/SQR(XX))/F1: ' Night sky 710 XX=10^(PH/1.571-1.1): IF XX<1 THEN XX=1 720 BT=XX*10^(8.45+.4*HS)*(F1-1)/F1: ' Twilight sky 730 PM=10^5.36*(1.06+(COS(PH))^2): ' Mie scattering 740 PA=10^(1.65+1.43*PH): ' Aerosol scattering 750 XX=-.4*K/(SQR(1-.96*(SIN((90-HS)/57.295))^2)) 760 BD=11700*10^XX*(PM+PA)*(F1-1)/F1: ' Daytime sky 770 BS=BN+BT+BC: ' Sky brightness 780 IF BD1 THEN F6=1 1010 F7=(1+.03*(M*ZE/RE)^2)/RS^2:'Resolving the star 1020 F8=10^(-.4*(1-.5*BV)): 'Color corr (night) 1030 IF BA>1480 THEN F8=1: 'Color corr (day) 1040 FI=F1*F2*F3*F4*F5*F6*F7*F8: 'Corr for intensities 1050 FB=M^2*F2*F3*F4*F5*F6*F8: 'For surface brightness 1060 ' Calculate limiting magnitude 1070 B=BA/FB: ' Perceived brightness 1080 ID=4.46E-09*(1+SQR(1.26E-06*B))^2: 'Day vision 1090 IN=1.59E-10*(1+SQR(.0126*B))^2: 'Night vision 1100 I=ID: IF IN