Skip to content

Commit

Permalink
initl unused variable minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sceki committed Oct 11, 2024
1 parent 9b93225 commit 606de4d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions dsgp4/initl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
def initl(
xke, j2,
ecco, epoch, inclo, no,
method,
opsmode,
method='n',
):

x2o3 = torch.tensor(2.0 / 3.0);
Expand All @@ -34,7 +34,6 @@ def initl(
ainv = 1.0 / ao;
posq = po * po;
rp = ao * (1.0 - ecco);
method = 'n';

if opsmode == 'a':
# gst time
Expand Down
4 changes: 2 additions & 2 deletions dsgp4/sgp4init.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def sgp4init(
cosio2,eccsq, omeosq, posq,
rp, rteosq,sinio , satellite._gsto,
) = initl(
satellite._xke, satellite._j2, satellite._ecco, epoch, satellite._inclo, satellite._no_kozai, satellite._method,
satellite._operationmode
satellite._xke, satellite._j2, satellite._ecco, epoch, satellite._inclo, satellite._no_kozai,
satellite._operationmode, satellite._method
)
satellite._a = torch.pow( satellite._no_unkozai*satellite._tumin , (-2.0/3.0) )
satellite._alta = satellite._a*(1.0 + satellite._ecco) - 1.0
Expand Down
9 changes: 4 additions & 5 deletions dsgp4/sgp4init_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
def initl_batch(
xke, j2,
ecco, epoch, inclo, no,
method,
opsmode, batch_size
opsmode, batch_size, method='n',
):

x2o3 = torch.full((batch_size,),2.0 / 3.0);
Expand All @@ -34,7 +33,7 @@ def initl_batch(
ainv = 1.0 / ao;
posq = po * po;
rp = ao * (1.0 - ecco);
method = ['n']*batch_size;
method = [method]*batch_size;

if opsmode == 'a':
# gst time
Expand Down Expand Up @@ -161,8 +160,8 @@ def sgp4init_batch(
cosio2,eccsq, omeosq, posq,
rp, rteosq,sinio , satellite_batch._gsto,
) = initl_batch(
satellite_batch._xke, satellite_batch._j2, satellite_batch._ecco, epoch, satellite_batch._inclo, satellite_batch._no_kozai, satellite_batch._method,
satellite_batch._operationmode,batch_size
satellite_batch._xke, satellite_batch._j2, satellite_batch._ecco, epoch, satellite_batch._inclo, satellite_batch._no_kozai,
satellite_batch._operationmode, batch_size, satellite_batch._method
)
satellite_batch._a = torch.pow( satellite_batch._no_unkozai*satellite_batch._tumin , (-2.0/3.0) )
satellite_batch._alta = satellite_batch._a*(1.0 + satellite_batch._ecco) - 1.0
Expand Down
6 changes: 3 additions & 3 deletions tests/test_initl.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def test_initl(self):
tle_sat_cosio2, tle_sat_eccsq, tle_sat_omeosq, tle_sat_posq,
tle_sat_rp, tle_sat_rteosq, tle_sat_sinio , tle_sat_gsto,
) = dsgp4.initl(
xke, j2, tle_sat._ecco, (tle_sat._jdsatepoch+tle_sat._jdsatepochF)-2433281.5, tle_sat._inclo, tle_sat._no_kozai, 'n',
'i'
xke, j2, tle_sat._ecco, (tle_sat._jdsatepoch+tle_sat._jdsatepochF)-2433281.5, tle_sat._inclo, tle_sat._no_kozai,
'i', 'n'
);
self.assertAlmostEqual(satrec_no_unkozai, float(tle_sat_no_unkozai))
self.assertTrue(satrec_method==tle_sat_method)
Expand All @@ -80,7 +80,7 @@ def test_coverage(self):
tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2=whichconst
satrec_tumin, satrec_mu, satrec_radiusearthkm, satrec_xke, satrec_j2, satrec_j3, satrec_j4, satrec_j3oj2=sgp4.earth_gravity.wgs84
#I run the opsmode=='a'
dsgp4.initl(xke, j2, tle._ecco, (tle._jdsatepoch+tle._jdsatepochF)-2433281.5, tle._inclo, tle._no_kozai, 'n', 'a')
dsgp4.initl(xke, j2, tle._ecco, (tle._jdsatepoch+tle._jdsatepochF)-2433281.5, tle._inclo, tle._no_kozai, 'a', 'n')

file="""
0 COSMOS 2251 DEB
Expand Down

0 comments on commit 606de4d

Please sign in to comment.