プラネタリウム

 投稿者:しばっち  投稿日:2015年11月19日(木)22時41分29秒
  下記サイトから「catalog.dat.gz」をダウンロード後、解凍してください

ftp://dbc.nao.ac.jp/DBC/NASAADC/catalogs/5/5050/

(参考)
http://ayapin-film.sakura.ne.jp/Gnuplot/Tips/constellation.html

CALL GINIT
!'SET WINDOW 0,24,-90,90
SET WINDOW 7,3.5,-24,30 !'オリオン座
OPEN #1:NAME "catalog.dat" !'パスを指定。
SET #1: ENDOFLINE CHR$(10)
DO
   LINE INPUT #1,IF MISSING THEN EXIT DO:A$
   IF A$(76:77)<>"  " THEN
      LET RA_HOUR=VAL(A$(76:77))
      LET RA_MIN=VAL(A$(78:79))
      LET RA_SEC=VAL(A$(80:83))
      LET DEC_DEG=VAL(A$(84:86))
      LET DEC_ARMIN=VAL(A$(87:88))
      LET DEC_ARSEC=VAL(A$(89:90))
      LET VMAG=VAL(A$(103:106))
      !' LET B_V=VAL(A$(110:113))
      LET X=RA2POS(RA_HOUR,RA_MIN,RA_SEC)
      LET Y=DEC2POS(DEC_DEG,DEC_ARMIN,DEC_ARSEC)
      SELECT CASE VMAG
      CASE IS<1
         CALL CIRCLE(X,Y,5,7)
      CASE 1 TO 2
         CALL CIRCLE(X,Y,4,7)
      CASE 2 TO 3
         CALL CIRCLE(X,Y,3,7)
      CASE 3 TO 4
         CALL CIRCLE(X,Y,2,7)
      CASE IS>4
         CALL PSET(X,Y,7)
      END SELECT
   END IF
LOOP
CLOSE #1
END

EXTERNAL  FUNCTION RA2POS(HOUR, MIN, SEC)
LET RA2POS= HOUR + MIN/60 + SEC/3600
END FUNCTION

EXTERNAL  FUNCTION DEC2POS(DEG, ARCMIN, ARCSEC)
LET S= DEG
IF DEG < 0 THEN
   LET S=S-ARCMIN/60-ARCSEC/3600
ELSE
   LET S=S+ARCMIN/60+ARCSEC/3600
END IF
LET DEC2POS=S
END FUNCTION

EXTERNAL SUB PSET(X,Y,C)
SET POINT COLOR C
PLOT POINTS:X,Y
END SUB

EXTERNAL SUB GINIT
!'SET BITMAP SIZE XSIZE,YSIZE
!'SET WINDOW 0,XSIZE-1,YSIZE-1,0
SET POINT STYLE 1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB

EXTERNAL SUB CIRCLE(X,Y,RR,C)
ASK BITMAP SIZE XSIZE,YSIZE
ASK WINDOW X1,X2,Y1,Y2
SET COLOR C
DRAW DISK WITH SCALE(RR*(X2-X1)/XSIZE,RR*(Y2-Y1)/YSIZE)*SHIFT(X,Y)
END SUB
 

戻る