Package: ptwrapper
Pointing Tool WrapperA JUICE SOCPointing Toolwrapper (PTwrapper) for WINDOWS, LINUX, and MACOSX for use in a local computer.Allows to simulate a Pointing Timeline Request (PTR) and to generate the corresponding SPICE CK, resolved PTR,
available Power, and quaternions dump file.PTwrapperis based on OSVE and mainly provides a shortcut to use the required functionalities and setup limited
to simulate PTRs. You can find more information on OSVEhere.DocumentationDocumentation is available at theJUICE SOC Toolkit Help.Installationpip install ptwrapperDevelopment and testingClone this repositoryRequirements:Python 3.7+Create a virtual environment and install the dependenciespip install -e .Run the tests with in thetestsdirectory with:python3-munittestUsing the libraryAfter installing the library can be used with the Python Shell or with its CLI.Python ShellA basic test of the library for a PTR processing is provided. The sample creates in the working directory a structure
folder to invoke the execution and dumps inside the OUTPUT folder the expected products (SPICE CK, resolved PTR,
available Power, and quaternions CSV)import os

from ptwrapper import execute
from ptwrapper import create_structure

ptr_content = """<prm>
   <body>
      <segment>
         <data>
            <timeline frame="SC">
               <block ref="OBS">
                  <startTime>2030-10-15T03:40:00</startTime>
                  <endTime>2030-10-15T04:15:00</endTime>
                  <attitude ref="track">
                     <boresight ref="SC_Zaxis"/>
                     <target ref="Jupiter"/>
                     <phaseAngle ref="powerOptimised">
                        <yDir>false</yDir>
                     </phaseAngle>
                     </attitude>
                     <metadata>
                        <comment>Track Power Optimised C3.0</comment>
                     </metadata>
               </block>
            </timeline>
         </data>
     </segment>
   </body>
</prm>
"""
mk_path = 'metakernel.tm'
session_file_path = create_structure('.', mk_path, ptr_content)
execute(os.path.dirname(session_file_path), session_file_path)Command line interfaceThe package has a CLI entry point:ptwrapper-h

usage:ptwrapper[-h][-sSESSION_FILE][-mMETA_KERNEL][-pPTR][-wWORKING_DIR][-oOUTPUT_DIR][-tTIME_STEP][-np][-sa][-mga][-q][-f][-v]PointingToolWrapper(PTWrapper)simulatesaPTRandgeneratesthecorrespondingresolvedPTR,SPICECKkernels,andotherattituderelatedfiles.PTWrapperusesOSVEtosimulatethePTR.

optionalarguments:-h,--helpshowthishelpmessageandexit-sSESSION_FILE,--session-fileSESSION_FILEPathtothesessionfiletorunthesimulation.Ifprovidedtheotherargumentsareignored.-mMETA_KERNEL,--meta-kernelMETA_KERNELPathtothemeta-kernelfile.-pPTR,--ptrPTRPathtothePTR/PTXfileinputfile.-wWORKING_DIR,--working-dirWORKING_DIRPathtotheworkingdirectory.Defaultisthecurrentdirectory.-oOUTPUT_DIR,--output-dirOUTPUT_DIRPathtotheoutputdirectory.Overwritesdefaultoutputfilenames.Defaultisthestructureofthebuilt-insessionfile.-tTIME_STEP,--time-stepTIME_STEPOutputCKfiletimestepinseconds.Defaultis5s.-np,--no-powerIndicatesnottocalculateavailablepower.DefaultisthattheAvailablePowerwillbecomputed.-sa,--sa-ckGeneratetheSolarArraysSPICECK.DefaultisthattheSACKisnotgenerated.-mga,--mga-ckGeneratetheMediumGainAntennaSPICECK.DefaultisthattheMGACKisnotgenerated.-q,--quaternionsCalculatethequaternions.Defaultisthatthequaternionswillnotbecomputed.-f,--fixed-definitionsPrinttheAGMFixedDefinitionsinuseforPTRdesign.-v,--versionOSVE,AGM,andEPSlibrariesversion.You can either run the CLI using an OSVE configuration file (SESSION_FILE) or by specifying a
number of inputs and assume the rest of parameters as provided by the default configuration file
included in the package.In addition, if you do not specify an output directory (OUTPUT_DIR), the package will replicate
the canonical output directory and file structure and will also generate aSESSION_FILEthat can
be reused. Contrarily, if you specify anOUTPUT_DIRthe output will be simplified and provided in
that directory; additionally the output files will inherit the name of the inputPTRfile.WARNING:Remember that the inputMETA_KERNELneeds to have an adequate
relative or absolute path for itsPATH_VALUESvariable value.A couple of examples are provided hereunder. First specifying the output directory:ptwrapper-mkernels/juice_mini_local.tm-pptr_simphony.xml-o.ptwrappersessionexecution
AGMversion:9.3.0.p1
OSVEversion:1.6.0[INFO]<AGE>AttitudeGenerationModuleinitializationstarted[INFO]<AGE>AGEmodulesetupstarted[INFO]<AGE>AGEmodulesetupsuccessfullycompleted[INFO]<AGE>AttitudeGenerationModuleinitializationcompleted[INFO]<AGE>LoadingAttitudeTimeline[INFO]<AGE>CheckingAttitudeTimeline[INFO]<AGE>InitializingAttitudeTimeline[INFO]<AGE>TOTALENERGYforPOINTINGblockfrom2030-10-15T03:40:00Zto2030-10-15T04:15:00Z[INFO]<AGE>AttitudefromactualPTR:812.096753Wh(812.096753Wh)[INFO]<AGE>AttitudefromloadedCK:812.096096Wh(812.096096Wh)[INFO]<PIF>XMLPTRfile:"ptr_resolved.ptx"generated[INFO]<PIF>GeneratingCKfilewiththefollowingUSERDEFINEDparameters:[INFO]<PIF>CKframeID:-28001[INFO]<PIF>CKtimestep:5s[INFO]<AGE>WritingAttitudeSpiceCKFile:juice_sc_ptr.bc[INFO]<PIF>CKfile:"juice_sc_ptr.bc"generated[INFO]<AGE>WritingAttitudeTextFile[INFO]<PIF>POWERCSVfile:"power.csv"generated
Renamingquaternions.csvtoptr_simphony_quaternions.csv
Renamingpower.csvtoptr_simphony_power.csv
Renamingptr_resolved.ptxtoptr_simphony_resolved.ptx
Renamingjuice_sc_ptr.bctoptr_simphony.bc
CleaningupOSVEexecutionfilesanddirectoriesThis will generate the following output files..|--ptr_simphony.bc|--ptr_simphony.csv|--ptr_simphony.xml|--ptr_simphony_log.json`--ptr_simphony_resolved.ptxThe same run without specifying theOUTPUT_DIRECTORYyields the following directory structure:.|--config||--age|||--cfg_agm_jui_jupiter.xml|||--cfg_agm_jui_multibody_event_definitions.xml|||--cfg_agm_jui_multibody_fixed_definitions.xml||`--cfg_agm_jui_multibody_predefined_block.xml|`--ise||--BRF_MAL_SGICD_2_1_300101_351005.brf||--RES_C50_SA_CELLS_EFFICIENCY_310101_351003.csv||--eps.cfg||--events.juice.def||--phs_com_res_sa_cells_count.asc|`--units.def|--kernel|`--juice_mini_local.tm|--output||--juice_sc_ptr.bc||--power.csv||--ptr_resolved.ptx||--log.json|`--quaternions.csv|--ptr|`--PTR_PT_V1.ptx`--session_file.json