ingest_shape¶
Ingest a tessellated shape model and store it in a GIANT KDTree for use in GIANT relative OpNav processes.
In addition to building a KDTree for the ingested shape, this script also makes a “shape_info.txt” file, which contains statistics and information about the shape model. This file is not used explicitly in GIANT, but can be useful in operations environments to ensure that observations are tied to the proper shape model (see the “relnav.py” script from getting started for an example).
If your shape model is in a format not understood by this script (currently basic OBJ, ICQ, and DSK formats) then you can either convert to one of these formats, or you can modify this script to add in the ability to read in your preferred format. Someday we hope to make a configurable option to make this easier, but we’re running out of time for version 1.0 right now…
Warning
This script saves the results to a python pickle files. Pickle files can be used to execute arbitrary code, so you should never open one from an untrusted source. While this scrip does not open a pickle file, we wanted to warn you about the results of using this script.
Warning
This script makes a shell call to dskexp, which may be automatically downloaded by this function if it doesn’t exist on your path. Unfortunately, NAIF provides no way to verify the dskexp executable, therefore, there is a small security risk if the naif website is hacked, however, this risk is the same as if you manually downloaded the dskexp function yourself.
Usage¶
Convert a shape model file to a GIANT KDTree
usage: ingest_shape [-h] [-p POLE] [-o OUTPUT] [-m MAX_DEPTH] [-c CONV] [-t TYPE] [-g GM] [-f] [-e] [-s] shape name
Positional Arguments¶
- shape
The shape file to convert
- name
The name to give the shape
Named Arguments¶
- -p, --pole
The tpc file defining the pole for this shape
Default: “NA”
- -o, --output
The name of the output file to save the tree to
Default: “kdtree.pickle”
- -m, --max_depth
The maximum depth to go to when building the tree
Default: 18
- -c, --conv
scale the vertices by this amount (ie to convert m to km)
Default: 1
- -t, --type
the type of the file to convert, defaults to being specified by the file extension
- -g, --gm
the gm of the body
Default: 4.89e-09
- -f, --fix_offset
Correct the com to cof offset
Default: False
- -e, --memory_efficient
Use memory efficient triangles
Default: False
- -s, --compute_statistics
Compute the statistics for the shape
Default: False
WARNING: This script loads/saves some results from/to python pickle files. Pickle files can be used to execute arbitrary code, so you should never open one from an untrusted source.