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