irfpy.vexop.itlparser
¶
Parse itl formatted string.
- irfpy.vexop.itlparser.get_orb(line)[source]¶
Return the orbit number of the command line.
Only VPER command can be recognized.
- irfpy.vexop.itlparser.get_vpertime(line)[source]¶
Return the time in seconds corresponding to the pericenter time.
- irfpy.vexop.itlparser.str_vpertime(vpertime)[source]¶
>>> print(str_vpertime(13800)) +03:50:00
>>> print(str_vpertime(-1000)) -00:16:40
- irfpy.vexop.itlparser.itl_split_line(file)[source]¶
ITL file convert to “1-line 1-command format”.
- Parameters
file – A file-like object to be parsed.
- irfpy.vexop.itlparser.get_command(line)[source]¶
Return the command in text, e.g. ‘AASF009A’ or ‘AASF056A’.
>>> cmdline = 'VPER (COUNT = 1492) 03:23:05 ASPERA HK AASF093A ( VAS52200 = 40 [RAW] POWER_PROFILE = 00:00:00 23.4 [Watts] DATA_RATE_PROFILE = 00:00:00 6000 [bits/sec])' >>> print(get_command(cmdline)) AASF093A
# A wrong example.
>>> cmdline = 'VPER (COUNT = 1492) 03:23:05 ASPERA HK AASF03A ( VAS52200 = 40 [RAW] )' >>> try: ... print(get_command(cmdline)) ... print('!!!! Should not reach here') ... except ValueError: ... print('Exception correctly caught') Exception correctly caught
- irfpy.vexop.itlparser.get_param(line, param)[source]¶
Return the parameter as string. Parameter here is for example like “VASD6503” or “VAS01060”.
>>> cmdline = 'VPER (COUNT = 1492) 03:23:05 ASPERA HK AASF093A ( VAS52200 = 40 [RAW] VASXX060 = OFF [DUMMY] POWER_PROFILE = 00:00:00 23.4 [Watts] DATA_RATE_PROFILE = 00:00:00 6000 [bits/sec])' >>> vas52200 = get_param(cmdline, 'VAS52200') >>> print(int(vas52200)) 40
>>> vasxx060 = get_param(cmdline, 'VASXX060') >>> print(vasxx060.strip()) OFF