diff --git a/edosl0util/eos.py b/edosl0util/eos.py new file mode 100644 index 0000000000000000000000000000000000000000..c420a944387814fb6b4fb7cd28e4f707be225c97 --- /dev/null +++ b/edosl0util/eos.py @@ -0,0 +1,41 @@ +""" NASA EOS mission specific data + +References: + 1. MODIS Command, Telemetry, Science and Engineering Description, + Document Number 151840, May 1997, Appendix C + https://directreadout.sci.gsfc.nasa.gov/documents/satellite_gen/MODIS_UG.pdf +""" + +packet_types = { + 0: "day", + 1: "night", + 2: "eng1", + 4: "eng2", +} + +packet_sources = { + 0: "solar-diff", + 1: "srca-cal", + 2: "bb-cal", + 3: "space-cal", +} + +packets_per_scan = { + "day": 3032, + "night": 326, +} + +def sourceid(p): + if p.data[0] >> 7 == 0: + return "earthdata" + return packet_source[p.data[0] >> 5 & 0x3] + +def mirrorside(p): + return ["side1", "side2"][bytes(p.secondary_header)[8] & 0x1] + +def scancount(p): + return bytes(p.secondary_header)[8] >> 1 & 0x7 + +def pkttype(p): + return packet_types[bytes(p.secondary_header)[8] >> 4 & 0x7] +