Skip to content
Snippets Groups Projects
Commit 674166dd authored by Jesse Mapel's avatar Jesse Mapel Committed by jlaura
Browse files

Updated README (#154)

* Updated README

* Added BAE license and removed open source license
parent 7079a414
No related branches found
No related tags found
No related merge requests found
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>
# CSM-CameraModel # CSM-CameraModel
ISD Specification: https://github.com/USGS-Astrogeology/pfeffernusse/blob/master/swagger.yaml Community Sensor Model (CSM) compliant sensor models created by USGS Astrogeology
Science Center.
## Setting up dependencies with conda (RECOMMENDED)
Install conda if you do not already have it.
```bash
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b
```
> You can add a `-p <install-prefix>` to choose where to install miniconda. By default, it will install it to `$HOME/miniconda3`.
### Setting up conda for bash
Copy and paste the following into a terminal running the `bash` shell:
```bash
echo -e "\n\n# Adding miniconda3 to PATH" >> $HOME/.bashrc && \
echo -e "export PATH=$HOME/miniconda3/bin:\$PATH" >> $HOME/.bashrc && \
source $HOME/.bashrc && \
which conda
```
> *For more information: [bash installation](https://conda.io/docs/user-guide/install/linux.html "Reference to bash conda install")*
### Setting up conda for tcsh
Copy and paste the following into a terminal running the `tcsh` shell:
```tcsh
echo "\n\n# Setting up miniconda3 for tcsh" >> $HOME/.cshrc && \
echo "source $HOME/miniconda3/etc/profile.d/conda.csh > /dev/null" >> $HOME/.cshrc && \
source $HOME/.cshrc && \
which conda
```
> *For more information: [tcsh installation](https://github.com/ESMValGroup/ESMValTool/issues/301 "Reference to tcsh conda install")*
### Creating an isolated conda environment
Run the following commands to create a self-contained dev environment for CSM-CameraModel (type `y` to confirm creation):
```bash
conda create -n csmdev -c usgs-astrogeology cmake libcsm
```
> *For more information: [conda environments](https://conda.io/docs/user-guide/tasks/manage-environments.html)*
### Activating the environment
After creating the `csmdev` environment and installing cmake and libcsm into it, we need to activate it. Right now, cmake, libcsm, and their dependencies are isolated to a conda environment and we need to tell conda that we want to use it. The activation command depends on your shell.
* **bash**: `source activate csmdev`
* **tcsh**: `conda activate csmdev`
> *You can add these to the end of your $HOME/.bashrc or $HOME/.cshrc if you want the `csmdev` environment to be active in every new terminal.*
## Building CSM-CameraModel CSM-CameraModel contains two different sensor models. The first, is a generic
After you've set up conda, you can build CSM-CameraModel: framing camera model written from scratch. The second is a generic line scan
camera model based on code from BAE Systems Information and Electronic Systems
1. Fork `USGS-Astrogeology/CSM-CameraModel` if you don't already have a fork. Integration Inc.
2. Clone your fork of `CSM-CameraModel` *with `--recursive` option to get the gtest submodule*.
```bash ## Using CSM-CameraModel
git clone --recursive git@github.com:<your-username>/CSM-CameraModel.git
cd CSM-CameraModel This library is a CSM plugin library that is intended to be dynamically loaded
git remote add upstream git@github.com:USGS-Astrogeology/CSM-CameraModel.git at run time along side the
``` [CSM API library](https://github.com/USGS-Astrogeology/csm).
3. Sync your fork with `upstream` and ensure the gtest submodule is init'd if your fork is old.
```bash Once, the library is loaded, it can be accessed through the CSM Plugin interface.
git pull upstream master For an example of how to do through the CSM c++ interface see the SensorModelFactory
git submodule update --init --recursive class in [SensorUtils](https://github.com/USGS-Astrogeology/SensorUtils).
git push -u origin master For an example of how to do this through the CSM Python bindings see this
``` [notebook](http://nbviewer.jupyter.org/gist/thareUSGS/4c0eb72799edc33ff4816b2587027148).
4. `mkdir build && cd build`
5. `cmake .. && make` From the CSM Plugin interface, a generic framing camera model
6. `ctest` (USGS_ASTRO_FRAME_SENSOR_MODEL) or generic line scan camera model
(USGS_ASTRO_LINE_SCANNER_SENSOR_MODEL) can be instantiated from suitable Image
Support Data (ISD). Under the CSM standard, each plugin library can define its
own ISD format. This library uses an auxiliary JSON formatted file that must be
next to the image file passed to the CSM::ISD class. We provide an OpenAPI
server for generating these,
[pfeffernusse](https://github.com/USGS-Astrogeology/pfeffernusse). The swagger
specification is located on
[swaggerhub](https://app.swaggerhub.com/apis/USGS-Astro/pfeffernusse2/0.1.4-oas3).
--- ---
## Building without a package manager ## Build Requirements
To build:
* cmake 3.10 or newer
1. Install [libcsmapi](https://github.com/sminster/csm "CSM API") * GNU-compatible Make
> You can install this with an `INSTDIR` of your choice, or let it default (see [libcsmapi README](https://github.com/sminster/csm/blob/master/README)) * a c++11 compliant compiler
```bash
mkdir $HOME/csmenv This repository has all of its external c++ dependencies included in it. The
cd $HOME excellent header-only JSON library
git clone git@github.com:sminster/csm.git [JSON for Modern C++](https://github.com/nlohmann/json) is included directly in
cd csm the source code. The other two dependencies, the CSM API library, and gtest
make -f Makefile.linux64 all install clean INSTDIR="$csmenv" are included as git submodules. When you clone this library make sure you add
``` the `--recursive` flag to your `git clone` command. Alaterntively, you can run
2. Install cmake >= 3.10 `git submodule update --init --recursive` after cloning. The library can also be
```bash compiled against an installed versions of the CSM API by setting the BUILD_CSM
cd $HOME flag to OFF during cmake configuration.
wget https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz
tar xzf cmake-3.12.0-Linux-x86_64.tar.gz ## Building CSM-CameraModel
rsync -azv cmake-3.12.0-Linux-x86_64/ $HOME/csmenv/
echo -e "\n#Prepending csm env to path\nsetenv PATH "$HOME/csmenv/bin:$PATH" >> $HOME/.cshrc CSM-CameraModel uses a standard cmake build system. To compile the library, and
source $HOME/.cshrc tests use the following commands:
```
3. Fork and clone down this repo and its submodules (gtest) 1. `mkdir build && cd build`
```bash 2. `cmake .. && cmake --build .`
git clone --recursive git@github.com:<username>/CSM-CameraModel.git
cd CSM-CameraModel ## Testing CSM-CameraModel
git remote add upstream git@github.com:USGS-Astrogeology/CSM-CameraModel.git
git pull upstream master All of the tests for CSM-CameraModel are written in the googletests framework
git submodule update --init --recursive and are run via ctest. To run all of the tests simply run `ctest` in the build.
git push -u origin master
``` All of the tests are purposefully written to use generic data that values have
4. `mkdir build` && `cd build` been hand validated for. This data can be found under `tests/data`.
5. `cmake -DCSM_INCLUDE_DIR="${csmenv}/include/csm -DCSM_LIBRARY="${csmenv}/lib/libcsmapi.so .. && make`
Copyright © 2017 BAE Systems Information and Electronic Systems Integration Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment