home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 179 / 179.d81 / occult (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  153 lines

  1. 5 poke55,.:poke56,56:clr
  2. 10 dv=peek(186):ifdv<8thendv=8
  3. 15 poke53280,0:poke53281,0:print"[147]"
  4. 16 poke53371,0
  5. 25 poke53272,31
  6. 30 ad=49152
  7. 35 sysad:sysad+12
  8. 40 bx$="[158][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180][157][180]"
  9. 43 print"[147][158][219][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][220]":sysad+9,21
  10. 44 printbx$""tab(38)bx$
  11. 45 print"[255][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][168]"
  12. 49 print""tab(1)"[129][214][201][211][201][194][204][197] [204][213][206][193][210] [207][195][195][213][204][212][193][212][201][207][206][211] [195][193][204][195][213][204][193][212][207][210]"
  13. 50 rem visibility of an occulation
  14. 55 printtab(2)"[150][205]oon's [211]unlit [158]%: ";:l9%=3:gosub900:sf=q9
  15. 60 printtab(2)"[150][218]enith [196]istance of [211]tar [158][219]s: ";:l9%=3:gosub900:z=q9
  16. 65 printtab(2)"[150][211]un's [200]eight from horizon [158][219]s: ";:l9%=6:gosub900:hs=q9
  17. 70 printtab(2)"[150][195]usp [193]ngle [158](90 lit/-90 dark)[219]s: ";:l9%=3:gosub900:c=q9
  18. 75 bv=.7:rem star's color index b-v (in mags.)
  19. 80 k=.3:rem vis. extinction coeff. (mag/airmass)
  20. 85 bc=0:rem brightness from light pollution (nl)
  21. 90 se=1:rem seeing disk diameter at zenith (arcsec)
  22. 95 printtab(2)"[150]% of [205]oon visible in lens: ";:l9%=3:gosub900:fv=q9
  23. 100 printtab(2)"[150][193]perture of [212]elescope [158](in): ";:l9%=5:gosub900:d=q9
  24. 105 printtab(2)"[150][205]agnification: ";:l9%=4:gosub900:m=q9
  25. 110 tr=80:rem telescope throughput (%)
  26. 115 printtab(2)"[150][217]our [193]ge please :";:l9%=2:gosub900:ag=q9
  27. 120 printtab(2)"[150][197]yesight? [158](20/20=1-20/40=.5):";:l9%=3:gosub900:rs=q9
  28. 125 printtab(2)"[150][197]xpertise [158](1-9 5=aver, 9=exp): ";:l9%=1:gosub900:ex=q9
  29. 130 printtab(2)"[150][205]agnitude of [211]tar: ";:l9%=4:gosub900:ms=q9
  30. 131 print:printtab(5)"[201]s [212]his [195]orrect? [154][217]/[206]":poke198,.
  31. 132 geta$:ifa$<>"y"anda$<>"n"then132
  32. 133 sysad+9,8
  33. 134 ifa$="n"then43
  34. 135 printtab(5)"[145][158]  [195]hoose a [208]rogram [205]ode- "
  35. 140 printtab(7)"(1)[150] [205]inimum aperture"
  36. 145 printtab(7)"(2)[150] [204]imiting magnitude":poke198,.
  37. 150 getq$:ifq$<>"1"andq$<>"2"then150
  38. 155 sysad+9,8:ifq$="2"then180
  39. 160 d=.5:rem find minimum telescope aperture
  40. 165 d=d+.1:m=25*d:sysad+9,17:gosub190:ifms>mlthen165
  41. 170 printtab(3)"[153][194]est [205]inimum [193]perture";int(d);"[153]inches.":sysad+9,10
  42. 175 goto185
  43. 180 gosub190:printtab(3)"[153][204]imiting magnitude is:";ml:sysad+9,10
  44. 185 gosub3000
  45. 188 goto43
  46. 190 sysad+9,7:rem routine to find lim mag. given conditions
  47. 195 xx=cos(z/57.295):rem first estimate corrections
  48. 200 x=1/(xx+.025*exp(-11*xx)):rem airmass of moon
  49. 205 ze=sqr(2.89*x*se^2+(17.9/d)^2):rem 2nd moment of image
  50. 210 f1=10^(.4*k*x):rem extinction
  51. 215 f2=1.41:rem binocular vision
  52. 220 f3=100/tr:rem transmission of scope
  53. 225 de=4:rem guess that pupil is 4mm
  54. 230 f4=(25.4*d/(m*de))^2:rem light outside pupil
  55. 235 iff4<1thenf4=1
  56. 240 f5=(de/(25.4*d))^2:rem light gathering power
  57. 245 xx=1-exp(-.026*de^2)
  58. 250 yy=1-exp(-.026*(25.4*d/m)^2)
  59. 255 f6=(25.4*d/(de*m))^2*xx/yy:rem stiles-crawford effect
  60. 260 iff6>1thenf6=1
  61. 265 f7=(1+.03*(m*ze/100)^2)/rs^2:rem resolving the star
  62. 270 fi=f1*f2*f3*f4*f5*f6*f7:rem correction for intensities
  63. 275 fb=m^2*f2*f3*f4*f5*f6:rem correction for surface brightness
  64. 280 rem calculate brightness of moon
  65. 285 cp=sf/50-1
  66. 290 ifcp=0thenph=(NULL)/2:goto305
  67. 295 ph=atn(sqr(1-cp*cp)/cp):rem lunar phase (0 to full)
  68. 300 ifcp<0thenph=ph+(NULL)
  69. 305 dm=1.49*ph+.043*(ph^4)-12.73:rem moon's magn.
  70. 310 im=10^(-.4*(dm+16.57)):rem intensity of moon
  71. 315 bm=5.67+12*im/(f1*sf):rem moon brightness (nl)
  72. 320 sp=(NULL)-ph:rem earth's phase from moon
  73. 325 xx=1.49*sp+.043*(sp^4)-12.73
  74. 330 be=1.1e+07*10^(-.4*(xx+16.57))/f1:rem earthshine
  75. 335 rem calculate glare brightness
  76. 340 xx=(cos(c/57.295))^2+(1-sf/100+sin(c/57.295))^2
  77. 345 yy=(1.4*exp(-1*c/30))
  78. 350 ifyy<.6thenyy=.6
  79. 355 th=.25*sqr(xx)*yy:rem effective distance to moon
  80. 360 b1=6.25e+07*im*(f1-1)/(th*f1)^2:rem scattering in air
  81. 365 b2=4.63e+07*im*(fv/100)/(th^2*f1):rem scat in eye
  82. 370 b3=443000*im/(th^3*d*f1):rem diffraction
  83. 375 b4=2.6e+08*im*exp(-1*(th/.4)^2)/f1:rem by mirror
  84. 380 bg=b1+b2+b3+b4:rem glare brightness
  85. 385 rem calculate effective background brightness
  86. 390 xx=1-.96*(sin(z/57.295))^2
  87. 395 bn=180*(.4+.6/sqr(xx))/f1:rem night sky
  88. 400 xx=10^(ph/1.571-1.1):ifxx<1thenxx=1
  89. 405 bt=xx*10^(8.45+.4*hs)*(f1-1)/f1:rem twilight sky
  90. 410 pm=10^5.36*(1.06+(cos(ph))^2):rem mie scattering
  91. 415 pa=10^(1.65+1.43*ph):rem aerosol scattering
  92. 420 xx=-.4*k/(sqr(1-.96*(sin((90-hs)/57.295))^2))
  93. 425 bd=11700*10^xx*(pm+pa)*(f1-1)/f1:rem daytime sky
  94. 430 bs=bn+bt+bc:rem sky brightness
  95. 435 ifbd<btthenbs=bn+bd+bc
  96. 440 xx=.5*(1+c/abs(c)):rem +1 if dark limb
  97. 445 yy=.5*(1-c/abs(c)):rem -1 if bright limb
  98. 450 ba=bs+xx*(be+bg)+yy*bm:rem apparent brightness
  99. 455 rem condition of the observers eye
  100. 460 r1=380*10^(.3*(ba/fb)^-.29):rem night resolution
  101. 465 r2=42*10^(8.28*(ba/fb)^-.29):rem day vision resol
  102. 470 re=900/rs:ifr1<900thenre=r1/rs
  103. 475 ifr2<900andr2<r1thenre=r2/rs
  104. 480 xx=1.85*(im*.000929*fv/f1)/(1.122^(m*th))
  105. 485 yy=exp(-.16*(.000001*ba/fb+xx)^.4)
  106. 490 zz=7*exp(-.5*(25/100)^2):rem standard obser is age 25
  107. 495 ds=zz*yy:ifds<2thends=2:rem stand. pupil size
  108. 500 zz=7*exp(-.5*(ag/100)^2):rem dark pupil for obser.
  109. 505 de=zz*yy:ifde<2thende=2:rem pupil size og obser.
  110. 510 rem recalculate correction factors
  111. 515 f4=(25.4*d/(m*de))^2:rem light outside pupil
  112. 520 iff4<1thenf4=1
  113. 525 f5=(ds/(25.4*d))^2:rem light gathering power
  114. 530 xx=1-exp(-.026*ds^2)
  115. 535 yy=1-exp(-.026*(25.4*d/m)^2)
  116. 540 f6=(25.4*d/(ds*m))^2*xx/yy:rem stiles-crawford effect
  117. 545 iff6>1thenf6=1
  118. 550 f7=(1+.03*(m*ze/re)^2)/rs^2:rem resolving the star
  119. 555 f8=10^(-.4*(1-.5*bv)):rem color corr. night
  120. 560 ifba>1480thenf8=1:rem color corr.day
  121. 565 fi=f1*f2*f3*f4*f5*f6*f7*f8:rem corr. for intensities
  122. 570 fb=m^2*f2*f3*f4*f5*f6*f8:rem for surface brightness
  123. 575 rem calculate limiting magnitude
  124. 580 b=ba/fb:rem perceived brightness
  125. 585 id=4.4e-09*(1+sqr(1.26e-06*b))^2:rem day vision
  126. 590 in=1.59e-10*(1+sqr(.0126*b))^2:rem night vision
  127. 595 i=id:ifin<idtheni=in:rem limiting illum. ft-cd
  128. 600 ml=-16.57-2.5*log(i*fi)/log(10):rem limiting magn.
  129. 605 ml=ml+.16*(ex-6):rem corr. for experience
  130. 610 ml=ml-1.2:rem correct for steady visibility
  131. 615 return
  132. 900 q9$="":poke198,.
  133. 905 geta$
  134. 910 poke646,rnd(1)*15+1:print"*[157]";:ifa$=""then905
  135. 915 ifa$=chr$(13)thenprint" ":q9=val(q9$):return
  136. 920 if(a$=chr$(20)andlen(q9$))thenq9$=left$(q9$,len(q9$)-1):goto950
  137. 925 iflen(q9$)>=l9%thensysad+9,2:goto905
  138. 930 if(a$>="0"anda$<="9")ora$="."ora$="-"then940
  139. 935 goto905
  140. 940 q9$=q9$+a$
  141. 945 print""a$;:sysad+9,8:goto905
  142. 950 print" [157][157] [157]";:goto905
  143. 3000 poke214,19:print:printtab(8)"[159](1[159]) [212]ry another one
  144. 3010 [153][163]8)"open(2open) (NULL)o (NULL)(NULL)right$(NULL)val(NULL)(NULL)val (NULL)enu
  145. 3020 poke198,0
  146. 3030 geta$:ifa$<"1"ora$>"2"then3030
  147. 3040 ifa$="1"thenreturn
  148. 3050 sysad+15
  149. 3060 print"[147][144]load"chr$(34)"b.universe iv"chr$(34)","dv
  150. 3070 print"run28"
  151. 3080 poke631,13:poke632,13:poke198,2:end
  152. 10000 d=peek(186):n$="occult":open15,d,15,"s0:"+n$:close15:saven$,d:end
  153.