usgscsm_cam_test¶
This program is shipped with the USGSCSM library in the bin directory.
It can perform several operations involving CSM camera models, such as:
Load a camera model, whether in the original ISD format, model state representation, binary msgpack model state, or GXP .sup file
Export the camera as a model state file (JSON or binary msgpack)
Compute projections from pixels in the camera to the ground and back, and measure the discrepancy with the original pixels.
Model formats¶
This tool supports the following input formats:
ISD (
.json): Image Support Data generated by ALE, with raw ephemeris in sensor-to-J2000 and J2000-to-body-fixed transforms.Model state (
.json): Evaluated representation produced by USGSCSM, with transforms combined for direct use by the sensor model.Binary model state (
.isd): msgpack encoding of the model state. Smaller and faster to load than JSON. The.isdextension is suggested but not enforced. When loading, the format is determined by inspecting the first bytes of the file.GXP (
.sup): Sensor state file used by the GXP software suite.
Examples¶
Save the model state as JSON:
usgscsm_cam_test --model input.json --output-model-state out_state.json
Save the model state in binary msgpack format:
usgscsm_cam_test --model input.json --output-binary-model-state out_state.isd
Load a binary model state and test pixel accuracy:
usgscsm_cam_test --model out_state.isd --sample-rate 100
Perform per-pixel operations:
usgscsm_cam_test --model camera.json --sample-rate 100 \
--height-above-datum 320.3 --subpixel-offset 0.57
Modify a GXP .sup file with a new model state:
usgscsm_cam_test --model camera.json --modify-sup-file gxp_file.sup
Command line options¶
- --model <string (default: “”)>
Input CSM model (in ISD, model state, binary msgpack model state, or GXP .sup file format).
- --output-model-state <string (default: “”)>
If specified, save the model state to this file in JSON format.
- --output-binary-model-state <string (default: “”)>
If specified, save the model state in binary msgpack format to this file. This format is smaller and much faster to load than JSON.
- --sample-rate <integer (default: 0)>
If positive, select pixels in the camera at the intersection of every one out of this many rows and columns, and perform projections to the ground and back.
- --subpixel-offset <double (default: 0.0)>
Add this value to every pixel row and column to be sampled.
- --height-above-datum <double (default: 0.0)>
Let the ground be obtained from the datum for this camera by adding to its radii this value (the units are meters).
- --desired-precision <double (default: 0.001)>
Use this value for operations (ground-to-image and image-to-ground) which need a precision value. Measured in pixels.
- --modify-sup-file <string (default: “”)>
Input GXP .sup file to be modified by input CSM model. This will override the existing .sup file’s SENSOR_STATE.
- --help <no value>
Print the usage message.