Loading autocnet/control/control.py +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ class C(pd.DataFrame): creationdate : str The date that this control network was created. modifieddate : str The date that this control network was last modified. Examples -------- This example illustrates the manual creation of a pandas dataframe with Loading autocnet/fileio/io_controlnetwork.py +9 −7 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ VERSION = 2 HEADERSTARTBYTE = 65536 DEFAULTUSERNAME = 'AutoControlNetGeneration' FREEPOINT = 2 def to_isis(path, C, mode='w', version=VERSION, headerstartbyte=HEADERSTARTBYTE, networkid='None', targetname='None', Loading Loading @@ -83,7 +85,7 @@ def to_isis(path, C, mode='w', version=VERSION, class IsisStore(object): """ Class to manage IO of an ISIS3 control network (version 2). Class to manage IO of an ISIS control network (version 2). """ def __init__(self, path, mode=None, **kwargs): Loading @@ -105,8 +107,8 @@ class IsisStore(object): """ Parameters ---------- C : object A control network object data : str to be written to the file offset : int The byte offset into the output binary Loading @@ -116,7 +118,7 @@ class IsisStore(object): def create_points(self, cnet): """ Step through a C object and return protocol buffer point objects Step through a control network (C) and return protocol buffer point objects Parameters ---------- Loading @@ -143,7 +145,7 @@ class IsisStore(object): point = cnet.loc[point_id] point_spec.id = point_id point_spec.type = 2 # Hard coded to free point_spec.type = FREEPOINT # Hard coded to free # A single extend call is cheaper than many add calls to pack points measure_iterable = [] Loading Loading @@ -204,11 +206,10 @@ class IsisStore(object): raw_header_message.description = description raw_header_message.targetName = targetname raw_header_message.userName = username raw_header_message.pointMessageSizes.extend(point_sizes) header_message_size = raw_header_message.ByteSize() header_message = raw_header_message.SerializeToString() #header_message_size = sys.getsizeof(header_message) return header_message, header_message_size Loading @@ -217,6 +218,7 @@ class IsisStore(object): buffer_header_size, points_bytes): """ Create the PVL header object Parameters ---------- cnet : object Loading autocnet/utils/utils.py +0 −20 Original line number Diff line number Diff line Loading @@ -140,26 +140,6 @@ def find_in_dict(obj, key): if item is not None: return item def create_isis3_serial(in_cube): """ Parameters ---------- in_cube : str Path to the input data cube Returns ------- serial : str The ISIS3 serial number """ header = pvl.load(in_cube) components = [] spacecraft_name = find_in_dict(header, 'SpacecraftName') instrument_id = find_in_dict(header, 'InstrumentId') spacecraft_clock_count = find_in_dict(header, 'StartTime') # note that this decorator ignores **kwargs def memoize(obj): cache = obj.cache = {} Loading Loading
autocnet/control/control.py +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ class C(pd.DataFrame): creationdate : str The date that this control network was created. modifieddate : str The date that this control network was last modified. Examples -------- This example illustrates the manual creation of a pandas dataframe with Loading
autocnet/fileio/io_controlnetwork.py +9 −7 Original line number Diff line number Diff line Loading @@ -11,6 +11,8 @@ VERSION = 2 HEADERSTARTBYTE = 65536 DEFAULTUSERNAME = 'AutoControlNetGeneration' FREEPOINT = 2 def to_isis(path, C, mode='w', version=VERSION, headerstartbyte=HEADERSTARTBYTE, networkid='None', targetname='None', Loading Loading @@ -83,7 +85,7 @@ def to_isis(path, C, mode='w', version=VERSION, class IsisStore(object): """ Class to manage IO of an ISIS3 control network (version 2). Class to manage IO of an ISIS control network (version 2). """ def __init__(self, path, mode=None, **kwargs): Loading @@ -105,8 +107,8 @@ class IsisStore(object): """ Parameters ---------- C : object A control network object data : str to be written to the file offset : int The byte offset into the output binary Loading @@ -116,7 +118,7 @@ class IsisStore(object): def create_points(self, cnet): """ Step through a C object and return protocol buffer point objects Step through a control network (C) and return protocol buffer point objects Parameters ---------- Loading @@ -143,7 +145,7 @@ class IsisStore(object): point = cnet.loc[point_id] point_spec.id = point_id point_spec.type = 2 # Hard coded to free point_spec.type = FREEPOINT # Hard coded to free # A single extend call is cheaper than many add calls to pack points measure_iterable = [] Loading Loading @@ -204,11 +206,10 @@ class IsisStore(object): raw_header_message.description = description raw_header_message.targetName = targetname raw_header_message.userName = username raw_header_message.pointMessageSizes.extend(point_sizes) header_message_size = raw_header_message.ByteSize() header_message = raw_header_message.SerializeToString() #header_message_size = sys.getsizeof(header_message) return header_message, header_message_size Loading @@ -217,6 +218,7 @@ class IsisStore(object): buffer_header_size, points_bytes): """ Create the PVL header object Parameters ---------- cnet : object Loading
autocnet/utils/utils.py +0 −20 Original line number Diff line number Diff line Loading @@ -140,26 +140,6 @@ def find_in_dict(obj, key): if item is not None: return item def create_isis3_serial(in_cube): """ Parameters ---------- in_cube : str Path to the input data cube Returns ------- serial : str The ISIS3 serial number """ header = pvl.load(in_cube) components = [] spacecraft_name = find_in_dict(header, 'SpacecraftName') instrument_id = find_in_dict(header, 'InstrumentId') spacecraft_clock_count = find_in_dict(header, 'StartTime') # note that this decorator ignores **kwargs def memoize(obj): cache = obj.cache = {} Loading