USGSCSM
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

io.io_controlnetwork — ISIS Compatible Control Network Creation

The io.io_controlnetwork module supports the creation of control networks in ISIS format.

New in version 0.1.0.

class plio.io.io_controlnetwork.IsisControlNetwork(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]
class plio.io.io_controlnetwork.IsisStore(path, mode=None, **kwargs)[source]

Class to manage IO of an ISIS control network (version 2).

pointid

The current index to be assigned to newly added points

Type:

int

create_buffer_header(networkid, targetname, description, username, point_sizes, creation_date, modified_date)[source]

Create the Google Protocol Buffer header using the protobuf spec.

Parameters:
  • networkid (str) – The user defined identifier of this control network

  • targetname (str) – The name of the target, e.g. Moon

  • description (str) – A description for the network.

  • username (str) – The name of the user / application that created the control network

  • point_sizes (list) – of the point sizes for each point message

Returns:

  • header_message (str) – The serialized message to write

  • header_message_size (int) – The size of the serialized header, in bytes

create_points(df, pointid_prefix, pointid_suffix)[source]

Step through a control network (C) and return protocol buffer point objects with the appropriate attributes: point_id, point_type, serial, measure_type, x, y required. The entries in the list must support grouping by the point_id attribute. This operation adds (0.5, 0.5) to each pixel, since ISIS pixels are centered on (0.5, 0.5) and NDArrays are (0, 0) based.

Parameters:

df (DataFrame) –

Returns:

  • point_messages (list) – of serialized points buffers

  • point_sizes (list) – of integer point sizes

create_pvl_header(version, headerstartbyte, networkid, targetname, description, username, buffer_header_size, points_bytes, creation_date, modified_date)[source]

Create the PVL header object

Parameters:
  • version (int) – The current ISIS version to write, defaults to 2

  • headerstartbyte (int) – The seek offset that the protocol buffer header starts at

  • networkid (str) – The name of the network

  • targetname (str) – The name of the target, e.g. Moon

  • description (str) – A description for the network.

  • username (str) – The name of the user / application that created the control network

  • buffer_header_size (int) – Total size of the header in bytes

  • points_bytes (int) – The total number of bytes all points require

Returns:

An ISIS compliant PVL header object

Return type:

object

read()[source]

Given an ISIS store, read the underlying ISIS3 compatible control network and return an IsisControlNetwork dataframe. This operation converts ISIS (0.5, 0.5) origin pixels to (0, 0) origin pixels by subtracting (0.5, 0.5) from each pixel.

write(data, offset=0)[source]
Parameters:
  • data (bytes) – Encoded header to be written to the file

  • offset (int) – The byte offset into the output binary

class plio.io.io_controlnetwork.MeasureMessageType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

An enum to mirror the ISIS3 MeasureLogData enum.

plio.io.io_controlnetwork.write_filelist(lst, path='fromlist.lis')[source]

Writes a filelist to a file so it can be used in ISIS3.

Parameters:
  • lst (list) – A list containing full paths to the images used, as strings.

  • path (str) – The name of the file to write out. Default: fromlist.lis