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.
 
 
 
 
 
 

82 lines
2.7 KiB

  1. 10 ' FIELD ROTATION
  2. 20 '
  3. 30 ' PI=ATN(1)*4:
  4. 31 DR=PI/180: RD=180/PI
  5. 40 INPUT "Observer's latitude (deg) ";LA
  6. 50 LA=LA*DR: CL=COS(LA): SL=SIN(LA)
  7. 60 INPUT "Day of the month (1-31)";J
  8. 70 INPUT "Month (1-12) ";M
  9. 80 INPUT "Right ascension (h,m) ";H5,M5
  10. 90 INPUT "Declination (deg) ";DE
  11. 100 AD=H5+M5/60: DE=DE*DR: ' Hours and radians
  12. 110 SD=SIN(DE): CD=COS(DE): TD=SD/CD
  13. 120 GOSUB 650: PRINT
  14. 130 INPUT "From (h,m): ";H1,M1
  15. 140 T1=H1+M1/60: ' Starting time (hours)
  16. 150 INPUT "To (h,m): ";H2,M2
  17. 160 T2=H2+M2/60: ' Ending time (hours)
  18. 170 IF T2<T1 THEN T2=T2+24: ' If crossing midnight
  19. 180 PRINT
  20. 190 PRINT "Positive rotation rates are clockwise:"
  21. 200 DU=60*(T2-T1)+.01: ' Exposure duration (min.)
  22. 210 FOR T=0 TO DU STEP 1
  23. 220 LT=T1+T/60: ' Local mean time (hours)
  24. 230 GOSUB 520: A=AZ
  25. 240 DD=SIN(AH): DS=(SL/CL)*CD-SD*CH
  26. 250 IF DS<>0 THEN 270
  27. 260 C=SGN(DD)*PI/2: GOTO 280: ' In case DS=0
  28. 270 C=ATN(DD/DS): IF DS<0 THEN C=C+PI
  29. 280 Q=C*RD: ' Parallactic angle in degrees
  30. 290 IF T<>0 THEN 310
  31. 300 Q0=Q: Q1=Q: ' Save initial value of Q
  32. 310 XX=Q-Q1: XT=Q-Q0
  33. 320 IF ABS(XX)<=180 THEN 340
  34. 330 XX=XX-360*SGN(XX): Q=Q-360*SGN(Q)
  35. 340 Q1=Q
  36. 350 IF T<>0 THEN GOSUB 470
  37. 360 IF T=0 THEN GOSUB 700
  38. 370 IF XT>MX THEN MX=XT
  39. 380 IF XT<MN THEN MN=XT
  40. 390 NEXT
  41. 400 PRINT: PRINT "Cumulative field rotation: ";
  42. 410 PRINT USING "####.## deg";MX-MN
  43. 420 PRINT
  44. 430 PRINT USING "Start alt. ### Az. ###";H0;A0
  45. 440 PRINT USING "Ending alt. ### Az. ###";H;A
  46. 450 END
  47. 460 '
  48. 470 IF LT>=24 THEN LT=LT-24
  49. 480 PRINT USING " ##h ##m ";INT(LT);(LT-INT(LT))*60;
  50. 490 PRINT USING " Rotation +###.## deg/min ";XX
  51. 500 RETURN
  52. 510 ' Compute hour angle, altitude, and azimuth
  53. 520 HD=15*(1.002737*LT+ST-AD): ' Hour angle (deg)
  54. 530 IF HD>=360 THEN HD=HD-360
  55. 540 AH=HD*DR: CH=COS(AH): SA=SL*SD+CL*CD*CH
  56. 550 IF ABS(SA)<1 THEN 580
  57. 560 IF ABS(SA)>1 THEN SA=1*SGN(SA)
  58. 570 H=SA*90: GOTO 590: ' If zenith or nadir
  59. 580 H=ATN(SA/SQR(1-SA*SA))*RD: ' Altitude (degrees)
  60. 590 A1=SIN(AH): A2=CH*SL-TD*CL: IF A2<>0 THEN 610
  61. 600 AZ=SGN(A1)*PI/2: GOTO 620: ' Special case A2=0
  62. 610 AZ=ATN(A1/A2): IF A2<0 THEN AZ=AZ+PI
  63. 620 AZ=AZ*RD+180: ' Azimuth in degrees from north
  64. 630 IF AZ>=360 THEN AZ=AZ-360
  65. 640 RETURN
  66. 650 ' Find approx. sidereal time at midnight
  67. 660 N=INT(275*M/9)-2*INT((M+9)/12)+J-30
  68. 670 ST=(6.61+.06571*N)/24
  69. 680 ST=(ST-INT(ST))*24: ' Express in hours
  70. 690 RETURN
  71. 700 ' Initialize values
  72. 710 MX=XX: MN=XX: A0=A: H0=H
  73. 720 RETURN
  74. 800 '
  75. 810 ' ROTATE.BAS -- This program by Alphonse
  76. 820 ' Pouplier computes the rate at which
  77. 830 ' the field will rotate for a telescope
  78. 840 ' whose polar axis is misaligned on the
  79. 850 ' celestial pole. This subject is discussed
  80. 860 ' in detail in Sky & Telescope, September
  81. 870 ' 1992, page 318.