mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-24 08:45:55 -04:00
CodeQL tweaks and fixes.
Updated CodeQL config to ignore source templates, because they are not syntactically valid source code. Ignore other stuff that is irrelevant to published code quality. Made various fixes based on helpful CodeQL analysis.
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
# Utility functions shared by Python demo programs.
|
||||
#
|
||||
import sys
|
||||
import re
|
||||
import astronomy
|
||||
|
||||
def ParseArgs(args):
|
||||
|
||||
@@ -60,8 +60,6 @@ EUROPA_RADIUS_KM = 1560.8 #<const> The mean radius of Jupiter's moon Europ
|
||||
GANYMEDE_RADIUS_KM = 2631.2 #<const> The mean radius of Jupiter's moon Ganymede, expressed in kilometers.
|
||||
CALLISTO_RADIUS_KM = 2410.3 #<const> The mean radius of Jupiter's moon Callisto, expressed in kilometers.
|
||||
|
||||
_CalcMoonCount = 0
|
||||
|
||||
_RAD2HOUR = 3.819718634205488 # 12/pi = factor to convert radians to sidereal hours
|
||||
_HOUR2RAD = 0.2617993877991494365 # pi/12 = factor to convert sidereal hours to radians
|
||||
_DAYS_PER_TROPICAL_YEAR = 365.24217
|
||||
@@ -1872,9 +1870,6 @@ class _moonpos:
|
||||
self.distance_au = dist
|
||||
|
||||
def _CalcMoon(time):
|
||||
global _CalcMoonCount
|
||||
_CalcMoonCount += 1
|
||||
|
||||
T = time.tt / 36525
|
||||
ex = _Array2(-6, 6, 1, 4)
|
||||
|
||||
@@ -3489,10 +3484,6 @@ def _VsopDeriv(formula, t):
|
||||
return deriv
|
||||
|
||||
_DAYS_PER_MILLENNIUM = 365250.0
|
||||
_LON_INDEX = 0
|
||||
_LAT_INDEX = 1
|
||||
_RAD_INDEX = 2
|
||||
|
||||
|
||||
def _VsopRotate(eclip):
|
||||
# Convert ecliptic cartesian coordinates to equatorial cartesian coordinates.
|
||||
@@ -5860,6 +5851,8 @@ def SearchMaxElongation(body, startTime):
|
||||
startTime = t2.AddDays(1.0)
|
||||
iter_count += 1
|
||||
|
||||
raise InternalError() # should never take more than 2 iterations
|
||||
|
||||
|
||||
def _sun_offset(targetLon, time):
|
||||
ecl = SunPosition(time)
|
||||
|
||||
@@ -57,6 +57,7 @@ def FindConstellationChanges(body, startTime, stopTime, dayIncrement):
|
||||
# No constellation change in this time step. Try again on the next time step.
|
||||
c1 = c2
|
||||
t1 = t2
|
||||
return 0
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#
|
||||
|
||||
import sys
|
||||
import math
|
||||
from astronomy import *
|
||||
|
||||
UsageText = r'''
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# program uses the computer's current date and time.
|
||||
#
|
||||
import sys
|
||||
from astronomy import Body, Time, Refraction, Equator, Horizon
|
||||
from astronomy import Body, Refraction, Equator, Horizon
|
||||
from astro_demo_common import ParseArgs
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
import sys
|
||||
import csv
|
||||
from astronomy import Body, GeoMoon, ObserverVector, Spherical, VectorFromSphere, AngleBetween
|
||||
from astronomy import GeoMoon, ObserverVector, Spherical, VectorFromSphere, AngleBetween
|
||||
from astro_demo_common import ParseArgs
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user