Loading plio/io/io_controlnetwork.py +14 −14 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ def to_isis(obj, path, mode='wb', version=2, buffer_header_size, points_bytes, creation_date, modified_date) store.write(header) store.write(header.encode('utf-8')) class IsisStore(object): """ Loading Loading @@ -292,8 +292,8 @@ class IsisStore(object): """ Parameters ---------- data : str to be written to the file data : bytes Encoded header to be written to the file offset : int The byte offset into the output binary """ Loading Loading @@ -461,7 +461,7 @@ class IsisStore(object): An ISIS compliant PVL header object """ encoder = pvl.encoder.IsisCubeLabelEncoder encoder = pvl.encoder.ISISEncoder(end_delimiter=False) header_bytes = buffer_header_size points_start_byte = HEADERSTARTBYTE + buffer_header_size Loading Loading @@ -489,4 +489,4 @@ class IsisStore(object): ) ]) return pvl.dumps(header, cls=encoder) return pvl.dumps(header, encoder=encoder) plio/io/io_spectral_profiler.py +2 −2 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ class Spectral_Profiler(object): "^SP_SPECTRUM_REF1", "^SP_SPECTRUM_QA", "^L2D_RESULT_ARRAY", "^SP_SPECTRUM_RAD"]: continue if isinstance(v, pvl._collections.Units): if isinstance(v, pvl.collections.Quantity): k = "{}_{}".format(k, v.units) v = v.value keys.append(k) Loading plio/io/io_tes.py +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ class Tes(object): with open(var_file, "rb") as var: buffer = var.read() def process_rad(index): if index is -1: if index == -1: return None length = np.frombuffer(buffer[index:index+2], dtype='>u2')[0] Loading plio/io/isis_serial_number.py +10 −2 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import plio from plio.data import get_data from plio.io.io_db import Translations, StringToMission, setup_db_session from plio.utils.utils import find_in_dict, find_nested_in_dict from datetime import datetime def get_isis_translation(label): Loading Loading @@ -70,7 +71,7 @@ def generate_serial_number(label): The ISIS compatible serial number """ if not isinstance(label, PVLModule): label = pvl.load(label, cls=SerialNumberDecoder) label = pvl.load(label, decoder=SerialNumberDecoder()) # Get the translation information translation = get_isis_translation(label) Loading @@ -96,9 +97,16 @@ def generate_serial_number(label): serial_entry = search_translation[serial_entry] elif '*' in search_translation.keys() and search_translation['*'] != '*': serial_entry = search_translation['*'] try: serial_entry = serial_entry.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] except: pass serial_number.append(serial_entry) except: pass print(serial_number) return '/'.join(serial_number) Loading @@ -108,7 +116,7 @@ class SerialNumberDecoder(pvl.decoder.PVLDecoder): serial number. Inherits from the PVLDecoder in planetarypy's pvl module. """ def cast_unquoated_string(self, value): def cast_unquoted_string(self, value): """ Overrides the parent class's method so that any un-quoted string type value found in the parsed pvl will just return the original value. This is needed so that keyword values Loading plio/utils/utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ def split_all_ext(path): """ base, ext = os.path.splitext(path) while len(ext) is not 0: while len(ext) != 0: base, ext = os.path.splitext(base) return base Loading
plio/io/io_controlnetwork.py +14 −14 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ def to_isis(obj, path, mode='wb', version=2, buffer_header_size, points_bytes, creation_date, modified_date) store.write(header) store.write(header.encode('utf-8')) class IsisStore(object): """ Loading Loading @@ -292,8 +292,8 @@ class IsisStore(object): """ Parameters ---------- data : str to be written to the file data : bytes Encoded header to be written to the file offset : int The byte offset into the output binary """ Loading Loading @@ -461,7 +461,7 @@ class IsisStore(object): An ISIS compliant PVL header object """ encoder = pvl.encoder.IsisCubeLabelEncoder encoder = pvl.encoder.ISISEncoder(end_delimiter=False) header_bytes = buffer_header_size points_start_byte = HEADERSTARTBYTE + buffer_header_size Loading Loading @@ -489,4 +489,4 @@ class IsisStore(object): ) ]) return pvl.dumps(header, cls=encoder) return pvl.dumps(header, encoder=encoder)
plio/io/io_spectral_profiler.py +2 −2 Original line number Diff line number Diff line Loading @@ -100,7 +100,7 @@ class Spectral_Profiler(object): "^SP_SPECTRUM_REF1", "^SP_SPECTRUM_QA", "^L2D_RESULT_ARRAY", "^SP_SPECTRUM_RAD"]: continue if isinstance(v, pvl._collections.Units): if isinstance(v, pvl.collections.Quantity): k = "{}_{}".format(k, v.units) v = v.value keys.append(k) Loading
plio/io/io_tes.py +1 −1 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ class Tes(object): with open(var_file, "rb") as var: buffer = var.read() def process_rad(index): if index is -1: if index == -1: return None length = np.frombuffer(buffer[index:index+2], dtype='>u2')[0] Loading
plio/io/isis_serial_number.py +10 −2 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import plio from plio.data import get_data from plio.io.io_db import Translations, StringToMission, setup_db_session from plio.utils.utils import find_in_dict, find_nested_in_dict from datetime import datetime def get_isis_translation(label): Loading Loading @@ -70,7 +71,7 @@ def generate_serial_number(label): The ISIS compatible serial number """ if not isinstance(label, PVLModule): label = pvl.load(label, cls=SerialNumberDecoder) label = pvl.load(label, decoder=SerialNumberDecoder()) # Get the translation information translation = get_isis_translation(label) Loading @@ -96,9 +97,16 @@ def generate_serial_number(label): serial_entry = search_translation[serial_entry] elif '*' in search_translation.keys() and search_translation['*'] != '*': serial_entry = search_translation['*'] try: serial_entry = serial_entry.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] except: pass serial_number.append(serial_entry) except: pass print(serial_number) return '/'.join(serial_number) Loading @@ -108,7 +116,7 @@ class SerialNumberDecoder(pvl.decoder.PVLDecoder): serial number. Inherits from the PVLDecoder in planetarypy's pvl module. """ def cast_unquoated_string(self, value): def cast_unquoted_string(self, value): """ Overrides the parent class's method so that any un-quoted string type value found in the parsed pvl will just return the original value. This is needed so that keyword values Loading
plio/utils/utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ def split_all_ext(path): """ base, ext = os.path.splitext(path) while len(ext) is not 0: while len(ext) != 0: base, ext = os.path.splitext(base) return base