Skip to content
Snippets Groups Projects
Commit bf708e62 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

fix bad kw

parent 341356fa
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@ References:
Document Number 151840, May 1997, Appendix C
https://directreadout.sci.gsfc.nasa.gov/documents/satellite_gen/MODIS_UG.pdf
"""
import struct
packet_types = {
0: "day",
......@@ -46,10 +45,11 @@ def pkttype(p):
def frame_count(p):
x = int.from_bytes(b'\x00\x00' + p.data[:2], 'big')
x = int.from_bytes(b"\x00\x00" + p.data[:2], "big")
if sourceid(p) == "earthdata":
return x >> 4 & 0x7ff
return x >> 4 & 0x3f
return x >> 4 & 0x7FF
return x >> 4 & 0x3F
# Combination of source ids and packet types to their position within a scan.
_sort_indexes = {
......@@ -62,8 +62,9 @@ _sort_indexes = {
"eng2": 7,
}
def _modis_sort_key(p):
""" Return a tuple that will maintain order for this packet in a stream of
"""Return a tuple that will maintain order for this packet in a stream of
MODIS data. Intended to be used as a key func for sorting.
Packets are sorted in the order defined in _sort_indexes.
......@@ -73,4 +74,4 @@ def _modis_sort_key(p):
def sort_modis(packets):
return sorted(packets, key=_sort_key)
\ No newline at end of file
return sorted(packets, key=_modis_sort_key)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment