Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtribick committed Sep 25, 2020
1 parent d628bc9 commit b985fc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions make_stardb.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ def write_starsdat(data, outfile):
with open(outfile, 'wb') as f:
f.write(struct.pack('<8sHL', b'CELSTARS', 0x0100, len(data)))
print(f' Writing {len(data)} records')
s = struct.Struct('<L3fhH')
fmt = struct.Struct('<L3fhH')
for hip, x, y, z, vmag_abs, celspec in zip(data['HIP'], data['x'], data['y'], data['z'],
data['Vmag_abs'], data['CelSpec']):
f.write(s.pack(hip, x, y, z, int(round(vmag_abs*256)), celspec))
f.write(fmt.pack(hip, x, y, z, int(round(vmag_abs*256)), celspec))

def write_xindex(data, field, outfile):
"""Write a cross-index file."""
Expand All @@ -284,9 +284,9 @@ def write_xindex(data, field, outfile):
print(f' Writing {len(data)} records')
with open(outfile, 'wb') as f:
f.write(struct.pack('<8sH', b'CELINDEX', 0x0100))
s = struct.Struct('<2L')
fmt = struct.Struct('<2L')
for hip, cat in zip(data['HIP'], data[field]):
f.write(s.pack(cat, hip))
f.write(fmt.pack(cat, hip))

def make_stardb():
"""Make the Celestia star database files."""
Expand Down

0 comments on commit b985fc6

Please sign in to comment.