IDB#

class stixcore.idb.idb.IDB(filename)[source]#

Bases: object

Class provides reading functionality to a IDB (definition of TM/TC packet structures).

Attributes Summary

version

Get the Version of the IDB.

Methods Summary

close()

Close the IDB connection.

generate_calibration_name(prefix, id[, suffix])

get_all_spid()

get list of all SPIDs and short description

get_calibration_curve(param)

calibration curve defined in CAP database

get_calibration_polynomial(mcf_ident)

gets calibration polynomial information for a given MCF_IDENT

get_idb_filename()

Get the path to the connected IDB file.

get_idb_version()

get the version string of the IDB

get_packet_pi1_val_position(service_type, ...)

Get offset and width for optional PI1_VAL for the packet defined by service type and subtype.

get_packet_type_info(packet_type, packet_subtype)

Identify packet type using service, service subtype and information in IDB table PID.

get_parameter_description(name)

Get scos long description.

get_params_for_calibration(service_type, ...)

get_requestid_structure(service_type, ...)

Create a dynamic parse tree for the specified TM packet.

get_s2k_parameter_types(ptc, pfc)

gets parameter type

get_scos_description(name)

get scos long description

get_spid_info(spid)

Get SPID description.

get_static_structure(service_type, ...)

Create a static parse struct for the specified TM packet.

get_telecommand_info(service_type, ...[, ...])

get TC description for a header

get_telecommand_structure(name)

Get the structure of a telecommand by its name.

get_telemetry_description(spid)

Get telemetry data information.

get_variable_structure(service_type, ...[, ...])

Create a dynamic parse tree for the specified TM packet.

is_connected()

Is the reader connected to the IDB.

is_variable_length_telecommand(name)

Determines if the TM structure is of variable length

tcparam_interpret(ref, raw)

interpret telecommand parameter by using the table PAS

textual_interpret(pcf_curtx, raw_value)

gets a name for a TXP_NUMBR from TXP for given raw_value

Attributes Documentation

version#

Get the Version of the IDB.

Returns:

str – the Version label like ‘2.3.4’ or None

Methods Documentation

close()[source]#

Close the IDB connection.

classmethod generate_calibration_name(prefix, id, suffix='TM')[source]#
get_all_spid()[source]#

get list of all SPIDs and short description

Returns:

(PID_SPID, PID_DESCR)

get_calibration_curve(param)[source]#

calibration curve defined in CAP database

Parameters:

param (IDBCalibrationParameter)

Returns:

IDBCalibrationCurve – calibration curve

get_calibration_polynomial(mcf_ident)[source]#

gets calibration polynomial information for a given MCF_IDENT

Parameters:

mcf_ident (str) – TXP_NUMBR like ‘CIX00036TM’

Returns:

(MCF_POL1, MCF_POL2, MCF_POL3, MCF_POL4, MCF_POL5)

get_idb_filename()[source]#

Get the path to the connected IDB file.

Returns:

os.path – the path to the IDB file

get_idb_version()[source]#

get the version string of the IDB

Returns:

str – version label like “1.1.3”

get_packet_pi1_val_position(service_type, service_subtype)[source]#

Get offset and width for optional PI1_VAL for the packet defined by service type and subtype.

Parameters:
  • service_type (int)

  • service_subtype (int)

Returns:

IDBPi1ValPosition or None

get_packet_type_info(packet_type, packet_subtype, pi1_val=None)[source]#

Identify packet type using service, service subtype and information in IDB table PID.

Parameters:
  • packet_type (int)

  • packet_subtype (int)

  • pi1_val (int)

Returns:

IDBPacketTypeInfo or None if not found

get_parameter_description(name)[source]#

Get scos long description.

Parameters:

name (str)

Returns:

´str´ – a long description

get_params_for_calibration(service_type, service_subtype, sp1_val=None, pcf_name=None, pcf_curtx=None)[source]#
get_requestid_structure(service_type, service_subtype, sp1_val)[source]#

Create a dynamic parse tree for the specified TM packet.

Parameters:
  • service_type (int) – The TM packet service type.

  • service_subtype (int) – The TM packet service subtype.

  • PI1_VAL (int optional) – The TM packet optional PI1_VAL default None

Returns:

stixcore/idb/idb/IDBPacketTree – The IDBPacketTree implements nested repeaters.

get_s2k_parameter_types(ptc, pfc)[source]#

gets parameter type

Parameters:
  • ptc (int) – the parameter

  • pfc (int) – PFC_LB and PFC_UB

Returns:

str – the type

get_scos_description(name)[source]#

get scos long description

Parameters:

name (´str´) – the scos_name like ‘NIX00354’

Returns:

´str´ – the long description

get_spid_info(spid)[source]#

Get SPID description.

Returns:

(PID_DESCR, PID_TYPE, PID_STYPE)

get_static_structure(service_type, service_subtype, sp1_val)[source]#

Create a static parse struct for the specified TM packet.

Parameters:
  • service_type (int) – The TM packet service type.

  • service_subtype (int) – The TM packet service subtype.

Returns:

stixcore/idb/idb/IDBPacketTree – In this case the generic IDBPacketTree is flat, but can be used fore dynamic parsing anyway.

get_telecommand_info(service_type, service_subtype, subtype=None)[source]#

get TC description for a header

Parameters:
  • service_type (int)

  • service_subtype (int)

  • subtype (int, optional)

Returns:

dict | None

get_telecommand_structure(name)[source]#

Get the structure of a telecommand by its name. The structure will be used to decode the TC packet.

Parameters:

name (str) – a structure name like ‘ZIX06009’

Returns:

tm structure

get_telemetry_description(spid)[source]#

Get telemetry data information.

Parameters:

spid (int)

Returns:

(SW_DESCR, tpcf_name)

get_variable_structure(service_type, service_subtype, sp1_val=None)[source]#

Create a dynamic parse tree for the specified TM packet.

Parameters:
  • service_type (int) – The TM packet service type.

  • service_subtype (int) – The TM packet service subtype.

  • PI1_VAL (int optional) – The TM packet optional PI1_VAL default None

Returns:

stixcore/idb/idb/IDBPacketTree – The IDBPacketTree implements nested repeaters.

is_connected()[source]#

Is the reader connected to the IDB.

Returns:

True | False

is_variable_length_telecommand(name)[source]#

Determines if the TM structure is of variable length

Parameters:

name (str) – a structure name like ‘ZIX06009’

Returns:

True|False

tcparam_interpret(ref, raw)[source]#

interpret telecommand parameter by using the table PAS

Parameters:
  • ref (str) – PAS_NUMBR

  • raw (int) – PAS_ALVAL

Returns:

str – PAS_ALTXT

textual_interpret(pcf_curtx, raw_value)[source]#

gets a name for a TXP_NUMBR from TXP for given raw_value

Parameters:
  • pcf_curtx (str) – TXP_NUMBR like ‘CAAT0005TM’

  • raw_value (int) – value in range of TXP_FROM to TXP_TO

Returns:

list of str – the names