ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

125 lines
4.0 KiB

  1. 100 REM ASTROMETRIC REDUCTION
  2. 105 REM
  3. 110 DIM XZ(10),YZ(10),X1(10),Y1(10)
  4. 115 DIM AA(10),DXZ(10),RR(10,9),RAA(10),RDXZ(10)
  5. 120 DEFDBL A-H,K-Z
  6. 125 ' PI=3.141592653589793:
  7. 126 DR=PI/180
  8. 130 INPUT "Camera focal length";L
  9. 135 PRINT "R.A. of plate center (h,m,s)";
  10. 140 GOSUB 630: A0=V*15*DR
  11. 145 PRINT "Dec. of plate center (d,m,s)";
  12. 150 GOSUB 630: D0=V*DR: SD=SIN(D0): CD=COS(D0)
  13. 160 INPUT "Equinox, epoch";EQ,EP
  14. 165 T=EP-EQ
  15. 170 INPUT "How many stars (4-10)";N
  16. 175 FOR J=1 TO N
  17. 180 PRINT
  18. 185 PRINT "R.A. of star ";J;"(h,m,s)";
  19. 190 GOSUB 630
  20. 195 INPUT "Proper motion (sec/yr)";M1
  21. 200 AA(J)=(V+T*M1/3600)*15*DR
  22. 205 PRINT "Dec. (d,m,s)";
  23. 210 GOSUB 630
  24. 215 INPUT "Proper motion (arcsec/yr)";M2
  25. 220 DXZ(J)=(V+T*M2/3600)*DR: SJ=SIN(DXZ(J)): CJ=COS(DXZ(J))
  26. 225 H=SJ*SD+CJ*CD*COS(AA(J)-A0)
  27. 230 X1(J)=CJ*SIN(AA(J)-A0)/H
  28. 235 Y1(J)=(SJ*CD-CJ*SD*COS(AA(J)-A0))/H
  29. 240 INPUT "Measured X,Y";XZ(J),YZ(J)
  30. 245 NEXT J
  31. 250 PRINT
  32. 255 INPUT "Measured X,Y of target";X,Y
  33. 260 R1=0: R2=0: R3=0: R7=0: R8=0: R9=0: XS=0: YS=0
  34. 265 FOR J=1 TO N
  35. 270 XS=XS+XZ(J): YS=YS+YZ(J): RR(J,1)=XZ(J)*XZ(J)
  36. 275 R1=R1+RR(J,1): RR(J,2)=YZ(J)*YZ(J): R2=R2+RR(J,2)
  37. 280 RR(J,3)=XZ(J)*YZ(J): R3=R3+RR(J,3)
  38. 285 RR(J,7)=Y1(J)-YZ(J)/L: R7=R7+RR(J,7)
  39. 290 RR(J,8)=RR(J,7)*XZ(J): R8=R8+RR(J,8)
  40. 295 RR(J,9)=RR(J,7)*YZ(J): R9=R9+RR(J,9)
  41. 300 NEXT J
  42. 305 REM Now solve for D, E, F, by Cramer's Rule
  43. 310 DD=R1*(R2*N-YS*YS)-R3*(R3*N-XS*YS)+XS*(R3*YS-XS*R2)
  44. 315 D=R8*(R2*N-YS*YS)-R3*(R9*N-R7*YS)+XS*(R9*YS-R7*R2)
  45. 320 E=R1*(R9*N-R7*YS)-R8*(R3*N-XS*YS)+XS*(R3*R7-XS*R9)
  46. 325 F=R1*(R2*R7-YS*R9)-R3*(R3*R7-XS*R9)+R8*(R3*YS-XS*R2)
  47. 330 D=D/DD: E=E/DD: F=F/DD
  48. 335 REM
  49. 340 R4=0: R5=0: R6=0
  50. 345 FOR J=1 TO N
  51. 350 RR(J,4)=X1(J)-XZ(J)/L: R4=R4+RR(J,4)
  52. 355 RR(J,5)=RR(J,4)*XZ(J): R5=R5+RR(J,5)
  53. 360 RR(J,6)=RR(J,4)*YZ(J): R6=R6+RR(J,6)
  54. 365 NEXT J
  55. 370 REM Now solve for A ,B, C, by Cramer's Rule
  56. 375 A=R5*(R2*N-YS*YS)-R3*(R6*N-R4*YS)+XS*(R6*YS-R4*R2)
  57. 380 B=R1*(R6*N-R4*YS)-R5*(R3*N-XS*YS)+XS*(R3*R4-XS*R6)
  58. 385 C=R1*(R2*R4-YS*R6)-R3*(R3*R4-XS*R6)+R5*(R3*YS-XS*R2)
  59. 390 A=A/DD: B=B/DD: C=C/DD
  60. 395 PRINT
  61. 400 PRINT " Plate Constants "
  62. 405 PRINT " R.A. Dec.
  63. 410 PRINT USING "A = ##.##### D = ##.#####";A;D
  64. 415 PRINT USING "B = ##.##### E = ##.#####";B;E
  65. 420 PRINT USING "C = ##.##### F = ##.#####";C;F
  66. 425 REM
  67. 430 REM NOW FIND RESIDUALS
  68. 435 AS=0: DS=0
  69. 440 FOR J=1 TO N
  70. 445 RAA(J)=XZ(J)-L*(X1(J)-(A*XZ(J)+B*YZ(J)+C))
  71. 450 RDXZ(J)=YZ(J)-L*(Y1(J)-(D*XZ(J)+E*YZ(J)+F))
  72. 455 AS=AS+((RAA(J)/L)*3600/(DR*15*COS(D0)))^2
  73. 460 DS=DS+((RDXZ(J)/L)*3600/DR)^2
  74. 465 NEXT J
  75. 470 S1=SQR(AS/(N-3)): S2=SQR(DS/(N-3))
  76. 475 PRINT
  77. 480 PRINT "Residuals R.A. Dec."
  78. 482 A$=" Star ## #.##### #.#####"
  79. 485 FOR J=1 TO N
  80. 490 PRINT USING A$;J;RAA(J);RDXZ(J)
  81. 495 NEXT J
  82. 500 PRINT
  83. 505 REM Find standard coordinates of target
  84. 510 XX=A*X+B*Y+C+X/L: YY=D*X+E*Y+F+Y/L
  85. 515 B=CD-YY*SD: G=SQR(XX*XX+B*B)
  86. 520 REM
  87. 525 REM Find right ascension of target
  88. 530 A5=ATN(XX/B): IF B<0 THEN A5=A5+PI
  89. 535 A6=A5+A0: IF A6>2*PI THEN A6=A6-2*PI
  90. 540 IF A6<0 THEN A6=A6+2*PI
  91. 545 V=A6/(DR*15): GOSUB 660: A1=V1: A2=V2: A3=V3
  92. 550 REM
  93. 555 REM Find declination of target
  94. 560 D6=ATN((SD+YY*CD)/G): V=D6/DR: GOSUB 660
  95. 570 D1=V1: D2=V2: D3=V3
  96. 575 REM
  97. 580 PRINT "For target:"
  98. 585 PRINT
  99. 590 PRINT "Right ascension ";
  100. 592 PRINT USING "## ## ##.###";A1;A2;A3
  101. 595 PRINT USING " Std. dev. ##.###";S1
  102. 600 PRINT
  103. 605 PRINT "Declination ";S$;
  104. 610 PRINT USING "## ## ##.##";D1;D2;D3
  105. 615 PRINT USING " Std. dev. ##.##";S2
  106. 620 END
  107. 625 REM
  108. 630 REM Input of sexagesimal values
  109. 635 INPUT V$,V2,V3
  110. 640 S=1: IF LEFT$(V$,1)="-" THEN S=-1
  111. 645 V1=ABS(VAL(V$)): V=S*(V1+V2/60+V3/3600)
  112. 655 RETURN
  113. 660 REM Output of sexagesimal values
  114. 665 S$="+": IF V<0 THEN S$="-"
  115. 670 V=ABS(V): V1=INT(V): VM=60*(V-V1)
  116. 675 V2=INT(VM): V3=60*(VM-V2)
  117. 680 RETURN
  118. 690 REM
  119. 700 REM This program is used to analyze measurements
  120. 710 REM of minor planet or comet positions on a
  121. 720 REM photographic plate and deduce precise
  122. 730 REM coordinates. Written by Jordan D. Marche
  123. 740 REM and explained by him in Sky & Telescope
  124. 750 REM for July, 1990, page 71.