{"id":22798079,"url":"https://github.com/doi-usgs/usgscsm","last_synced_at":"2025-10-29T05:32:38.410Z","repository":{"id":37925753,"uuid":"82974528","full_name":"DOI-USGS/usgscsm","owner":"DOI-USGS","description":"This repository stores USGS Community Sensor Model (CSM) camera models","archived":false,"fork":false,"pushed_at":"2025-02-25T20:00:50.000Z","size":4670,"stargazers_count":27,"open_issues_count":28,"forks_count":35,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-02T06:55:42.666Z","etag":null,"topics":["camera","camera-model","csm","planetary","planetary-data"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DOI-USGS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-23T21:45:48.000Z","updated_at":"2025-02-25T20:00:55.000Z","dependencies_parsed_at":"2023-07-27T19:03:20.459Z","dependency_job_id":"3cf98a9e-d4a0-4925-83b4-cb0f35a1e8e5","html_url":"https://github.com/DOI-USGS/usgscsm","commit_stats":{"total_commits":432,"total_committers":26,"mean_commits":"16.615384615384617","dds":0.8148148148148149,"last_synced_commit":"c89c1ae7e8aa08b88d53ac37cc6ce41d3db8f64f"},"previous_names":["usgs-astrogeology/usgscsm"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DOI-USGS%2Fusgscsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DOI-USGS%2Fusgscsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DOI-USGS%2Fusgscsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DOI-USGS%2Fusgscsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DOI-USGS","download_url":"https://codeload.github.com/DOI-USGS/usgscsm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027411,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","camera-model","csm","planetary","planetary-data"],"created_at":"2024-12-12T06:08:13.576Z","updated_at":"2025-10-29T05:32:38.322Z","avatar_url":"https://github.com/DOI-USGS.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/USGSCSM_Logo.svg\" alt=\"USGSCSM\" width=200\u003e\n\u003c/p\u003e\n\n# USGSCSM\n\nThis library provides *Community Sensor Model (CSM)*-compliant sensor models\ncreated by the USGS Astrogeology Science Center.\n\nUSGSCSM contains three different sensor models. The first is a\ngeneric framing camera model written from scratch. The second is a\ngeneric line scan camera model based on code from BAE Systems\nInformation and Electronic Systems Integration, Inc. The third is a\ngeneric synthetic-aperture radar (SAR) sensor model.\n\n## Using USGSCSM\n\nThis library is a CSM plugin library that is intended to be dynamically loaded\nat run-time alongside the\n[CSM API library](https://github.com/USGS-Astrogeology/csm).\n\nOnce the library is loaded, it can be accessed through the CSM plugin interface.\nFor an example of how to do through the CSM C++ interface see the SensorModelFactory\nclass in [SensorUtils](https://github.com/USGS-Astrogeology/SensorUtils).\nFor an example of how to do this through the CSM Python bindings see this\n[notebook](http://nbviewer.jupyter.org/gist/thareUSGS/4c0eb72799edc33ff4816b2587027148).\n\nFrom the CSM plugin interface, a generic framing camera model\n(USGS_ASTRO_FRAME_SENSOR_MODEL), line scan camera model\n(USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL), or a SAR model\n(USGS_ASTRO_SAR_SENSOR_MODEL) can be instantiated from a suitable *Image\nSupport Data (ISD)* file.\n\n## Camera model format and model state\n\nUnder the CSM standard, each plugin library can define its own ISD\ncamera model format. This library uses an auxiliary JSON formatted file that must\nbe next to the image file passed to the CSM::ISD class.\nISD files and strings can be generated by using [ALE](https://github.com/USGS-Astrogeology/ale)\nwith metakernels and accompanying SPICE kernels, or from ISIS cubes that have attached\nSPICE data.\n\nThe camera model read from an ISD file is converted at load time to an\ninternal representation which makes camera operations more\nefficient. This optimized *model state* can be saved to disk as a\nJSON-formatted file, be used interchangeably with the\noriginal ISD model, and also shared among various photogrammetric\npackages.\n\nThe camera model state can be modified by an application of a rotation\nand translation, which is necessary in order to refine a camera's\nposition and orientation in photogrammetry, while these operations are\nnot easy to express in the original ISD format.\n\nThis library provides functionality for saving the model state file,\nas discussed in the next section.\n\n## Camera model processsing\n\nUSGSCSM ships with a program named ``usgscsm_cam_test``, which is\nable to load a CSM camera model, whether in the original ISD format or its\nmodel state representation, export the model state, and perform basic\ncamera operations, as described in its\n[documentation](docs/source/tools/usgscsm_cam_test.rst).\n\n## Enabling logging\n\nLogging of the internal operations in the sensor models can be enabled by setting\nthe `USGSCSM_LOG_FILE` environment variable to the file the log should be written to.\nTo have the logging information printed to the standard output or standard error, set\nthis to `stdout` or `stderr`.\n\nYou can adjust how much information is logged by setting the `USGSCSM_LOG_LEVEL`\nenvironment variable. The log level is not case sensitive.\nThe log levels are:\n\n| Level | Description |\n| ----- | ----------- |\n| trace | Intermediate calculation values |\n| debug | All function calls and returns |\n| **info** | Only core photogrammetry calls and returns - Default log level |\n| warn | CSM warnings |\n| err | CSM exceptions |\n| critical | Critical errors |\n| off | No log messages |\n\nAll log messages of level `USGSCSM_LOG_LEVEL` and below will be logged. For example,\nsetting the log level to *info* will log all messages of types *info*, *warn*, *err*,\n*critical*, and *off*. Note that these logs can become several GB in size when the\nlog level is set to *debug* or *trace*.\n\n---\n\n## Build requirements\n\n* cmake 3.15 or newer\n* GNU-compatible Make\n* a C++11 compliant compiler\n\nThis repository has all of its external C++ dependencies included in it. The\nexcellent header-only JSON library\n[JSON for Modern C++](https://github.com/nlohmann/json) is included directly in\nthe source code. The other three dependencies, The Abstraction Library for\nEphemerides, the CSM API library, and googletest are included as git submodules.\nWhen you clone this library make sure you add the `--recursive` flag to your\n`git clone` command. Alternatively, you can run\n`git submodule update --init --recursive` after cloning.\n\nYou can also install the build requirements using Conda with the provided\n`environment.yml` file. The following commands will create a new environment\nto build against. Note that googletest cannot be installed via anaconda and must\nbe available within the source code. You can remove the googletest dependency\nby disabling the tests.\n\n```\nconda env create -n usgscsm -f environment.yml\n```\n\n## Building USGSCSM\n\nUSGSCSM uses a standard cmake build system. To compile the library and\ntests use the following commands:\n\n1. `mkdir build \u0026\u0026 cd build`\n2. `cmake -DUSGSCSM_EXTERNAL_DEPS=OFF -DUSGSCSM_BUILD_DOCS=OFF .. \u0026\u0026 cmake --build .`\n\nIf you are using external dependencies via Conda or system level installations\nadd the `-DUSGSCSM_EXTERNAL_DEPS=ON` flag to the cmake command.\n\nYou can also disable the tests and the googletest dependency by adding the\n`-DUSGSCSM_BUILD_TESTS=OFF` flag to the cmake command.\n\n## Testing USGSCSM\n\nAll of the tests for USGSCSM are written in the googletest framework\nand are run via ctest. To run all of the tests simply run `ctest` in the build.\n\nAll of the tests are purposefully written to use generic data that values have\nbeen hand validated. This data can be found under `tests/data`.\n\n## Code style\n\nThis software package uses a modified form of the\n[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).\n\nHere are some exceptions:\n\n1. Non-const pass-by-reference is allowed.\n2. No copyright notice is necessary\n3. Static/global string constants are allowed to be std::strings, rather than C-style strings\n\nTo attempt to automatically format any new code to this style, run:\n`clang-format -style=Google -i file.cpp`\nFor more information see: [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html)\n\nTo check for compliance, run: `cpplint file.cpp` and ignore errors in the list of exclusions above.\nFor more information, see: [cpplint](https://github.com/cpplint/cpplint).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoi-usgs%2Fusgscsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoi-usgs%2Fusgscsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoi-usgs%2Fusgscsm/lists"}