diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000000000000000000000000000000000..63686ef867bc6fc049bcc768fd248864d35a17e6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,45 @@ + + +## Description + + +## Related Issue + + + + + +## Motivation and Context + + +## How Has This Been Tested? + + + + +## Screenshots (if appropriate): + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Documentation change (update to the documentation; no code change) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + + + +- [ ] I have read and agree to abide by the [Code of Conduct](https://usgs-astrogeology.github.io/code/) +- [ ] I have read the [**CONTRIBUTING**](https://github.com/USGS-Astrogeology/ISIS3/blob/dev/CONTRIBUTING.md) document. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. + +## Licensing +This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words: + +> This work is free and unencumbered software released into the public domain. 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. + +- [ ] I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. diff --git a/.gitignore b/.gitignore index d5ae5ef4afb7aa8732b13aa4afa633cd2675a50a..be8aea3649cab27e18d899729d772bed32b5a376 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,39 @@ print.prt */tsts/*/input/* */tsts/*/truth/* */tsts/*/output/* -data/ +*/build/ +build/ +*/install/ + +# Created by https://www.gitignore.io/api/macos +# Edit at https://www.gitignore.io/?templates=macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.gitignore.io/api/macos diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..110ccc43cea3b21dbdecde66f3a3b3e5bef2426d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gtest"] + path = gtest + url = git@github.com:google/googletest.git diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..67aec8e33c6f4add38976a65efce4dde6d8c7f42 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,145 @@ +properties([pipelineTriggers([githubPush()])]) + +def nodes = [:] + +nodes["isis-fedora-25"] = { + node("isis-fedora-25") { + withEnv(["ISISROOT=" + "${workspace}" + "/build/", "ISIS3TESTDATA=/usgs/cpkgs/isis3/testData/", "ISIS3DATA=/usgs/cpkgs/isis3/data/"]) { + stage ("Fedora 25") { + git branch: 'dev', url: 'https://github.com/USGS-Astrogeology/ISIS3.git' +// sh """ +// git clone https://github.com/abseil/googletest.git gtest +// conda config --set channel_alias http://astro-bin.wr.usgs.gov/conda +// conda config --prepend channels anaconda +// conda config --append channels conda-forge +// conda config --append channels usgs-astrogeology +// conda config --prepend default_channels anaconda +// conda env create -n isis3 -f environment.yml +// source activate isis3 +// mkdir -p ./install ./build && cd build +// cmake -GNinja -DJP2KFLAG=OFF -Dpybindings=OFF -DCMAKE_INSTALL_PREFIX=../install -Disis3Data=/usgs/cpkgs/isis3/data -Disis3TestData=/usgs/cpkgs/isis3/testData ../isis +// set +e +// ninja -j8 && ninja install +// source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh . +// ctest -V -R _unit_ --timeout 500 +// ctest -V -R _app_ --timeout 500 +// ctest -V -R _module_ --timeout 500 +// """ + } + } + } +} + +nodes["isis-centos-7"] = { + node("isis-centos-7") { + withEnv(["ISISROOT=" + "${workspace}" + "/build/", "ISIS3TESTDATA=/usgs/cpkgs/isis3/testData/", "ISIS3DATA=/usgs/cpkgs/isis3/data/"]) { + stage ("CentOS 7") { + git branch: 'dev', url: 'https://github.com/USGS-Astrogeology/ISIS3.git' +// sh """ +// git clone https://github.com/abseil/googletest.git gtest +// conda config --set channel_alias http://astro-bin.wr.usgs.gov/conda +// conda config --prepend channels anaconda +// conda config --append channels conda-forge +// conda config --append channels usgs-astrogeology +// conda config --prepend default_channels anaconda +// conda env create -n isis3 -f environment.yml +// source activate isis3 +// mkdir -p ./install ./build && cd build +// cmake -GNinja -DJP2KFLAG=OFF -Dpybindings=OFF -DCMAKE_INSTALL_PREFIX=../install -Disis3Data=/usgs/cpkgs/isis3/data -Disis3TestData=/usgs/cpkgs/isis3/testData ../isis +// set +e +// ninja -j8 && ninja install +// source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh . +// ctest -V -R _unit_ --timeout 500 +// ctest -V -R _app_ --timeout 500 +// ctest -V -R _module_ --timeout 500 +// """ + } + } + } +} + +nodes["isis-debian-9"] = { + node("isis-debian-9") { + withEnv(["ISISROOT=" + "${workspace}" + "/build/", "ISIS3TESTDATA=/usgs/cpkgs/isis3/testData/", "ISIS3DATA=/usgs/cpkgs/isis3/data/"]) { + stage ("Debian 9") { + git branch: 'dev', url: 'https://github.com/USGS-Astrogeology/ISIS3.git' +// sh """ +// git clone https://github.com/abseil/googletest.git gtest +// conda config --set channel_alias http://astro-bin.wr.usgs.gov/conda +// conda config --prepend channels anaconda +// conda config --append channels conda-forge +// conda config --append channels usgs-astrogeology +// conda config --prepend default_channels anaconda +// conda env create -n isis3 -f environment.yml +// source activate isis3 +// mkdir -p ./install ./build && cd build +// cmake -GNinja -DJP2KFLAG=OFF -Dpybindings=OFF -DCMAKE_INSTALL_PREFIX=../install -Disis3Data=/usgs/cpkgs/isis3/data -Disis3TestData=/usgs/cpkgs/isis3/testData ../isis +// set +e +// ninja -j8 && ninja install +// source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh . +// ctest -V -R _unit_ --timeout 500 +// ctest -V -R _app_ --timeout 500 +// ctest -V -R _module_ --timeout 500 +// """ + } + } + } +} + +nodes["isis-ubuntu-1804"] = { + node("isis-ubuntu-1804") { + withEnv(["ISISROOT=" + "${workspace}" + "/build/", "ISIS3TESTDATA=/usgs/cpkgs/isis3/testData/", "ISIS3DATA=/usgs/cpkgs/isis3/data/"]) { + stage ("Ubuntu 18.04") { + git branch: 'dev', url: 'https://github.com/USGS-Astrogeology/ISIS3.git' +// sh """ +// git clone https://github.com/abseil/googletest.git gtest +// conda config --set channel_alias http://astro-bin.wr.usgs.gov/conda +// conda config --prepend channels anaconda +// conda config --append channels conda-forge +// conda config --append channels usgs-astrogeology +// conda config --prepend default_channels anaconda +// conda env create -n isis3 -f environment.yml +// source activate isis3 +// mkdir -p ./install ./build && cd build +// cmake -GNinja -DJP2KFLAG=OFF -Dpybindings=OFF -DCMAKE_INSTALL_PREFIX=../install -Disis3Data=/usgs/cpkgs/isis3/data -Disis3TestData=/usgs/cpkgs/isis3/testData ../isis +// set +e +// ninja -j8 && ninja install +// source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh . +// ctest -V -R _unit_ --timeout 500 +// ctest -V -R _app_ --timeout 500 +// ctest -V -R _module_ --timeout 500 +// """ + } + } + } +} + +nodes["mac1013"] = { + node("mac1013") { + withEnv(["ISISROOT=" + "${workspace}" + "/build/", "ISIS3TESTDATA=/usgs/cpkgs/isis3/testData/", "ISIS3DATA=/usgs/cpkgs/isis3/data/"]) { + stage ("MacOS 10.13 (High Sierra)") { + git branch: 'dev', url: 'https://github.com/USGS-Astrogeology/ISIS3.git' +// sh """ +// git clone https://github.com/abseil/googletest.git gtest +// conda config --set channel_alias http://astro-bin.wr.usgs.gov/conda +// conda config --prepend channels anaconda +// conda config --append channels conda-forge +// conda config --append channels usgs-astrogeology +// conda config --prepend default_channels anaconda +// conda env create -n isis3 -f environment.yml +// source activate isis3 +// mkdir -p ./install ./build && cd build +// cmake -GNinja -DJP2KFLAG=OFF -Dpybindings=OFF -DCMAKE_INSTALL_PREFIX=../install -Disis3Data=/usgs/cpkgs/isis3/data -Disis3TestData=/usgs/cpkgs/isis3/testData ../isis +// set +e +// ninja -j8 && ninja install +// source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh . +// ctest -V -R _unit_ --timeout 500 +// ctest -V -R _app_ --timeout 500 +// ctest -V -R _module_ --timeout 500 +// """ + } + } + } +} + +parallel nodes diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..68a49daad8ff7e35068f2b7a97d643aab440eaec --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,24 @@ +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 diff --git a/README.md b/README.md index 6c1a4a93bf15232bd6d91e36949d91fd94ad1276..b40b5a3ad1231601259a1ba61fa036fa6a6c13e9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,353 @@ # ISIS3 -Integrated Software for Imagers and Spectrometers ISIS3 public release site + +[![Join the chat at https://gitter.im/USGS-Astrogeology/isis3_cmake](https://badges.gitter.im/USGS-Astrogeology/isis3_cmake.svg)](https://gitter.im/USGS-Astrogeology/isis3_cmake?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +## Table of Contents + +* [Installation](README.md##Installation) + +## Installation + +This installation guide is for ISIS3 users interested in installing ISIS3 (3.6.0)+ through conda. + +### ISIS3 Installation With Conda + +1. Download either the Anaconda or Miniconda installation script for your OS platform. Anaconda is a much larger distribtion of packages supporting scientific python, while Miniconda is a minimal installation and not as large: [Anaconda installer](https://www.anaconda.com/download), [Miniconda installer](https://conda.io/miniconda.html) +2. If you are running on some variant of Linux, open a terminal window in the directory where you downloaded the script, and run the following commands. In this example, we chose to do a full install of Anaconda, and our OS is Linux-based. Your file name may be different depending on your environment. + + chmod +x Anaconda3-5.2.0-Linux-x86_64.sh + ./Anaconda3-5.2.0-Linux-x86_64.sh + + + This will start the Anaconda installer which will guide you through the installation process. + +3. If you are running Mac OS X, a pkg file (which looks similar to Anaconda3-5.3.0-MacOSX-x86\_64.pkg) will be downloaded. Double-click on the file to start the installation process. +4. After the installation has finished, open up a bash prompt in your terminal window. +5. Next setup your Anaconda environment for ISIS3. In the bash prompt, run the following commands: + + #Create a new conda environment to install ISIS3 in + conda create -n isis3 python=3.6 + + #Activate the environment + #Depending on your OS, you may need to use conda activate isis3 instead + source activate isis3 + + #Add the following channels to the environment + conda config --env --add channels conda-forge + conda config --env --add channels usgs-astrogeology + + #Verify you have the correct channels: + conda config --show channels + + #You should see: + + channels: + - usgs-astrogeology + - conda-forge + - defaults + + #The order is important. If conda-forge is before usgs-astrogeology, you will need to run: + + conda config --env --add channels usgs-astrogeology + + +6. The environment is now ready to download ISIS3 and its dependencies: + + conda install -c usgs-astrogeology isis3 + + +7. Finally, setup the environment variables: + + #Execute the ISIS3 variable initialization script with default arguments. + #This script prepares default values for: $ISISROOT/$ISIS3DATA/$ISIS3TESTDATA + + python $CONDA_PREFIX/scripts/isis3VarInit.py + + + Executing this script with no arguments will result in $ISIS3DATA=$CONDA\_PREFIX/data, and $ISIS3TESTDATA=$CONDA\_PREFIX/testdata. The user can specify different directories for both of these optional values: + + python $CONDA_PREFIX/scripts/isis3VarInit.py --data-dir=[path to data directory] --test-dir=[path to test data directory] + + + Directions for running rsync to download ISIS3 data can be found [here.](#ISIS3DataDownload) Now everytime the isis3 environment is activated, $ISISROOT, $ISIS3DATA, and $ISIS3TESTDATA will be set to the values passed to isis3VarInit.py. This does not happen retroactively, re-activate the isis3 envionment with the following command: + + #Depending on your OS, you may need to use conda activate isis3 instead + source activate isis3 + + +### Operating System Requirements + +ISIS3 runs on many UNIX variants. ISIS does not run natively on MS Windows, although it has been successfully run on Windows 10 using the Windows Subsystem for Linux (WSL). Instructions for doing this can be found [here.](#RunningOnWindows) The UNIX variants ISIS3 has been successfully built on are: + +- Ubuntu 18.04 LTS +- Mac OS X 10.13.6 High Sierra +- Fedora 28 +- CentOS 7.2 + +ISIS3 may be run on other Linux or macOS operating systems then those listed above, but it has not been tested and is not supported. + +### Hardware Requirements + +Here are the minimum hardware requirements + +- 64-bit (x86) processors +- 2 GB RAM +- 2.5 GB of disk space for ISIS3 binaries +- 10 GB to 510 GB disk space for ISIS3 data +- 10 GB to many TB disk space for processing images +- A quality graphics card + +To build and compile ISIS3 requires following the instructions listed below, which are given on the GitHub wiki page for the ISIS3 project: + +- [Getting Started With GitHub](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#getting-started-with-github) +- [Building ISIS3 With cmake](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#building-isis3) +- [New ISIS3 environmental variables and their meanings](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#new-environmental-variable-meanings) +- [Custom data and test directories](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#custom-data-and-test-data-directories) +- [Cleaning builds](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#cleaning-builds) +- [Building individual applications/objects](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#building-individual-isis3-applicationsobjects) +- [Building ISIS3 documentation](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#building-isis3-documentation) +- [What to do if you encounter any problems](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developing-ISIS3-with-cmake#problems) + +### Mission Requirements + +ISIS3 supports many planetary missions; in fact, over 40 different instruments including some flown as early as the 1960s. Ancillary data are required to process images from these instruments. For example, translation definition files to help convert from PDS format to ISIS cubes, dark current and flat file images for radiometric calibration, and large quantities of SPICE files (spacecraft pointing and position) for map projecting images. If you plan to work with data from all missions, then the download will require about 180 GB for all the ancillary data. However, most of this volume is taken up by SPICE files. We have a SPICE Web service that can be used in lieu of downloading all of the SPICE files which can reduce the download size to 10 GB. When downloading ISIS, you will have the option of choosing which mission data to acquire as well as if you only want the translation and calibration files and not SPICE files. + +### DTM Requirements + +The strength of ISIS3 lies in its capabilities for planetary cartography. The image orthorectification process is improved if a digital terrain model (DTM) is used. The DTMs can be quite large and take some time to download. They exist for many planetary bodies (e.g., the Moon, Mars, etc.). Therefore, there are options for selecting which DTMs to download if you are only working with a particular target body. + + + +### Full ISIS3 Data Download + +Mission data is hosted on rsync servers and not through conda channels like the ISIS3 distribution. This requires using the rsync command from within a terminal window within your Unix distribution, or from within WSL if running Windows 10. Downloading all mission data requires over 130 GB of disk space. If you want to acquire only certain mission data [click here](#MissionSpecific). To download all ISIS3 data files, continue reading. + +To download all ISIS3 data (approximately 180 GB), enter the following commands at the command prompt: + + cd $ISIS3DATA + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data . + + +> Note: The above command downloads all ISIS data including the required base data area and all of the optional mission data areas. + + +### Partial Download of ISIS3 Base Data (Required) + +The base data area is separate from the source code. This data area is crucial to ISIS3 and must be downloaded. + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/base data/ + +### Partial Download of Mission Specific Data + +There are many missions supported by ISIS. If you are only working with a few missions then you should download only those specific data areas. One way you can save time and space is to not download the SPICE data for the mission you need. If you chose download the SPICE data, read the next section about the SPICE Web Service that provides instructions for excluding the SPICE kernels. Otherwise [jump](README.md#ApolloMission) to the mission specific sections. + +### ISIS SPICE Web Service + +ISIS can now use a service to retrieve the SPICE data for all instruments ISIS supports via the internet. To use this service instead of your local SPICE data, click the WEB check box in the spiceinit program GUI or type spiceinit web=yes at the command line. Using the ISIS SPICE Web Service will significantly reduce the size of the downloads from our data area. If you want to use this new service, without having to download all the SPICE data, add the following argument to the mission-specific rsync command: + + --exclude='kernels' + +For example: `rsync -azv **--exclude='kernels'** --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/cassini data/` + + WARNING: Some instruments require mission data to be present for calibration, which may not be supported by the SPICE Web Server exclusively, and some programs that are designed to run an image from ingestion through the mapping phase do not have an option to use the SPICE Web Service. For information specific to an instrument, see the documentation for radiometric callobration programs. + +#### Apollo Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/apollo15 data/ + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/apollo16 data/ + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/apollo17 data/ + + + + +Cassini Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/cassini data/ + + + + +Chandrayaan Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/chandrayaan1 data/ + + + + +Clementine Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/clementine1 data/ + + + + +Dawn Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/dawn data/ + + +ExoMars Trace Gas Orbiter Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/tgo data/ + + +Galileo Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/galileo data/ + + +Hayabusa Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/hayabusa data/ + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/hayabusa2 data/ + + +Juno Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/juno data/ + + + + +Kaguya Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/kaguya data/ + + + + +Lunar Orbiter Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/lo data/ + + + + +Lunar Reconnaissance Orbiter Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/lro data/ + + + + +Mars Exploration Rover Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/mer data/ + + + + +Mariner10 Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/mariner10 data/ + + + + +Messenger Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/messenger data/ + + + + +Mars Express Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/mex data/ + + + + +Mars Global Surveyor Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/mgs data/ + + + + +Mars Reconnaissance Orbiter Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/mro data/ + + + + +Mars Odyssey Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/odyssey data/ + + + + +Near Mission (kernels can be excluded): + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/near data/ + + +New Horizons Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/newhorizons data/ + + +Odyssey Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/odyssey data/ + + +Rolo Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/rolo data/ + + +Rosetta Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/rosetta data/ + + +Smart1 Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/smart1 data/ + + +Viking Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/viking1 data/ + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/viking2 data/ + + +Voyager Mission (kernels can be excluded): + + + + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/voyager1 data/ + rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isis3data/data/voyager2 data/ + + +Installing older versions of ISIS +--------------------------------- + +### How do I install ISIS2? + +If you are looking for ISIS2, please [refer to the ISIS 2 Installation Guide](http://isis.astrogeology.usgs.gov/Isis2/isis-bin/installation.cgi) for instructions on downloading and installing ISIS 2. + +### How do I install ISIS3.5.2 or earlier? + +If you are looking for a version of ISIS3 prior to 3.6.0, please [refer to the Legacy ISIS3 Installation Guide](../../documents/LegacyInstallGuide/index.html) for instructions on downloading and installing ISIS3, versions prior to 3.6.0. diff --git a/configure.py b/configure.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3c84d735029595149855b4528648a990ba8748 --- /dev/null +++ b/configure.py @@ -0,0 +1,88 @@ +import os +import sys +import sipconfig +import sipdistutils +import PyQt5 +import subprocess +import argparse + +from os.path import splitext +from os.path import dirname +from glob import glob +from distutils.spawn import find_executable + +from PyQt5.QtCore import PYQT_CONFIGURATION +from plio.utils.utils import find_in_dict +from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict +from sipconfig import ModuleMakefile + +def main (module): + # The name of the SIP build file generated by SIP and used by the build + # system. + sipy_sip_dir = "sipfiles/" + module = sipy_sip_dir+module + '.sip' + build_file = "bundle"+".sbf" + target = module+".so" + + # Get the extra SIP flags needed by the imported qt module. Note that + # this normally only includes those flags (-x and -t) that relate to SIP's + # versioning system. + qt_sip_flags = qtconfigdict["sip_flags"] + + # sip_bin = current_env_path + "/bin/sip" + sip_bin = find_executable('sip') + pyqt_sip_dir = dirname(dirname(sip_bin)) + "/share/sip/PyQt5" + + # Get the PyQt configuration information. + config = sipconfig.Configuration() + + # Run SIP to generate the code. Note that we tell SIP where to find the qt + # module's specification files using the -I flag. + + errcode = os.system(" ".join([sip_bin, "-e","-c", ".", "-b", build_file, "-I", + pyqt_sip_dir, qt_sip_flags, module])) + + if errcode != 0: + print('sip exited with non zero error code: {}'.format(errcode)) + + # We are going to install the SIP specification file for this module and + # its configuration module. + installs = [] + installs.append([module, os.path.join(pyqt_sip_dir, "isis3")]) + + isis_root = os.getenv("ISISROOT") + if not isis_root: + raise("Please set ISIS") + + extra_libs = ["$(ALLLIBS)", "-Wl,-rpath,"+isis_root+"/lib", "-Wl,-rpath,"+isis_root+"/3rdParty/lib"] + + makefile = ModuleMakefile(configuration=config, build_file=build_file, installs=installs) + makefile.extra_cxxflags = ["$(ALLINCDIRS)", "-Wstrict-aliasing=0", "-Wno-unused-variable"] + makefile.extra_lflags = ["$(ALLLIBDIRS)"] + makefile.extra_include_dirs = [x[0] for x in os.walk('incs/')] + makefile.extra_lib_dirs = [isis_root + '/3rdParty/lib', isis_root + 'lib'] + makefile.generate() + + # add import line for isismake.os + isis_makefile = "include " + isis_root + "/make/isismake.os" + + with open("Makefile", 'r+') as f: + content = f.read() + content = content.replace("LIBS =", "LIBS = " + ' '.join(extra_libs)) + f.seek(0, 0) + f.write(isis_makefile + '\n\n' + content) + +if __name__ == "__main__": + clean = ['cpp', 'c', 'h', 'hpp', 'o', 'sbf'] + + # If clean is passed in, clear up all the files genreated by the scripts + if len(sys.argv) > 1 and sys.argv[1] == 'clean': + files = [] + for filetype in clean: + files.extend(glob('*.{}'.format(filetype))) + + for f in files: + os.remove(f) + exit() + + main('master') diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000000000000000000000000000000000000..6aec932d691cf3dea20c9c5caa2ce6ffffb6aa28 --- /dev/null +++ b/environment.yml @@ -0,0 +1,70 @@ +channels: + - usgs-astrogeology + - conda-forge + - probcomp + - defaults + +dependencies: + - armadillo==8.200.0 + - blas==1.1=openblas + - bullet==2.86.1=0 + - bz2file==0.98 + - bzip2==1.0.6=1 + - cmake>=3.10 + - cspice==66=h470a237_3 + - curl==7.60.0=0 + - doxygen==1.8.14=0 + - eigen==3.3.3=0 + - embree==2.14.0=0 + - geos==3.5.1 + - geotiff==1.4.2=1 + - gmm==5.0 + - gmp==6.1.2=0 + - gsl==2.2.1=blas_openblas_3 + - hdf5==1.8.18=2 + - icu==58.2=0 + - jama==125 + - jpeg==9b=2 + - kakadu==1 + - krb5==1.14.2=0 + - libpng>=1.6.34 + - libprotobuf==3.5.2 + - libtiff==4.0.9=0 + - libxml2==2.9.7=0 + - make + - mesalib==17.2.0=0 + - mysql==5.7.20 + - mysql-connector-c==6.1.6=0 + - nanoflann==1.2.2 + - ninja==1.7.2=0 + - conda-forge/label/gcc7::nn + # - numpy==1.13.3=py36_blas_openblas_200 + - openblas==0.2.19=2 + - opencv + - openssl==1.0.2n=0 + - patchelf==0.9 + - pcl==1.8.1 + - pip==9.0.1 + - protobuf==3.5.2 + # - pyqt==5.6.0 + - python==3.6 + - qhull==7.2.0=0 + - qt=5.9.6 + - qwt=6.1.3 + - setuptools=38.5.1 + - sip==4.18 + - sqlite==3.13.0=1 + - suitesparse==4.5.4=blas_openblas_200 + - superlu==5.2.1=blas_openblas_201 + - tnt==126=0 + - wheel==0.30.0 + - x264==20131218 + - xalan-c==1.11 + - xerces-c==3.1.4=0 + - xorg-kbproto==1.0.7=1 + - xorg-libice + - xorg-libsm + - xorg-libx11==1.6.4=6 + - xorg-libxi + - zlib==1.2.11=0 + diff --git a/environment_gcc4.yml b/environment_gcc4.yml new file mode 100644 index 0000000000000000000000000000000000000000..6a671b8318cf0c2c285aacc89fac056b842e5ff4 --- /dev/null +++ b/environment_gcc4.yml @@ -0,0 +1,71 @@ +channels: + - jessemapel + - usgs-astrogeology + - conda-forge + - probcomp + - defaults + +dependencies: + - armadillo==8.200.0 + - blas==1.1=openblas + - bullet==2.86.1=0 + - bz2file==0.98 + - bzip2==1.0.6=1 + - cmake>=3.10 + - cspice==66=h470a237_3 + - curl==7.60.0=0 + - doxygen==1.8.14=0 + - eigen==3.3.3=0 + - embree==2.14.0=0 + - geos==3.5.1 + - geotiff==1.4.2=1 + - gmm==5.0 + - gmp==6.1.2=0 + - gsl==2.2.1=blas_openblas_3 + - hdf5==1.8.18=2 + - icu==58.2=0 + - jama==125 + - jpeg==9b=2 + - kakadu==1 + - krb5==1.14.2=0 + - libpng>=1.6.34 + - libprotobuf==3.5.2 + - libtiff==4.0.9=0 + - libxml2==2.9.7=0 + - make + - mesalib==17.2.0=0 + - mysql==5.7.20 + - mysql-connector-c==6.1.6=0 + - nanoflann==1.2.2 + - ninja==1.7.2=0 + - nn==1.86.0 + # - numpy==1.13.3=py36_blas_openblas_200 + - openblas==0.2.19=2 + - opencv + - openssl==1.0.2n=0 + - patchelf==0.9 + - pcl==1.8.1 + - pip==9.0.1 + - protobuf==3.5.2 + # - pyqt==5.6.0 + - python==3.6 + - qhull==7.2.0=0 + - qt=5.9.6 + - qwt=6.1.3 + - setuptools=38.5.1 + - sip==4.18 + - sqlite==3.13.0=1 + - suitesparse==4.5.4=blas_openblas_200 + - superlu==5.2.1=blas_openblas_201 + - tnt==126=0 + - wheel==0.30.0 + - x264==20131218 + - xalan-c==1.11 + - xerces-c==3.1.4=0 + - xorg-kbproto==1.0.7=1 + - xorg-libice + - xorg-libsm + - xorg-libx11==1.6.4=6 + - xorg-libxi + - zlib==1.2.11=0 + diff --git a/gtest b/gtest new file mode 160000 index 0000000000000000000000000000000000000000..529c2c6f4af29dadb8ee5cddf6a7919caa5ca5f6 --- /dev/null +++ b/gtest @@ -0,0 +1 @@ +Subproject commit 529c2c6f4af29dadb8ee5cddf6a7919caa5ca5f6 diff --git a/isis/CMakeLists.txt b/isis/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..5239c8fdbda8065db35a66a98c28fa31c5f5c2e1 --- /dev/null +++ b/isis/CMakeLists.txt @@ -0,0 +1,479 @@ +#=============================================================================== +# The main build file for building ISIS using CMake. +#=============================================================================== +# CMake initialization + +# Specify the required version of CMake. If your machine does not +# have this, it should be easy to build from https://cmake.org/download/ +cmake_minimum_required(VERSION 3.10) + +# Point cmake to our other CMake files. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") + +# set(CMAKE_FIND_FRAMEWORK LAST) +set(CMAKE_FRAMEWORK_PATH /System/Library/Frameworks/) + +set(CMAKE_FIND_FRAMEWORK LAST) + +include(AddIsisModule) +include(Utilities) +include(TestSetup) +include(InstallThirdParty) +include(cmake/gtest.cmake) +include(GoogleTest) + +#=============================================================================== +#=============================================================================== +# Project information + +project (USGS_ISIS) + +# Short and long name of this package +set(PACKAGE "ISIS") +set(PACKAGE_NAME "USGS ISIS") + +# Version number +set(VERSION "3.6.0.1") +set(PACKAGE_VERSION ${VERSION}) + +# Full name and version number +set(PACKAGE_STRING "${PACKAGE_NAME} ${VERSION}") + +# Other release information +set(VERSION_DATE "2018-10-26") +set(RELEASE_STAGE "beta") # (alpha, beta, stable) + +# Define to the address where bug reports for this package should be sent. +set(PACKAGE_BUGREPORT "https://isis.astrogeology.usgs.gov/fixit") + +# Main website associated with the software package +set(PACKAGE_URL "https://isis.astrogeology.usgs.gov/") + +# Retrieve a string describing the OS this is built on. +get_os_version(osVersionString) +message("Detected Operating System: ${osVersionString}") + +#=============================================================================== +#=============================================================================== +# Configuration options + +# All libraries are build as shared. The main library is also built +# as a static library using some specialized code in Utilities.cmake. +set(BUILD_SHARED_LIBS ON) + +# make sure to leave rpaths untouched on install +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# Specify user options that can be passed in with the initial CMake command. +option(isis3Data "Directory containing Isis3Data" OFF ) +option(isis3TestData "Directory containing Isis3TestData" OFF ) +option(testOutputDir "Directory to store app test output folders" OFF ) +option(buildCore "Build the core ISIS modules" ON ) +option(buildMissions "Build the mission specific modules" ON ) +option(buildStaticCore "Build libisis3 static as well as dynamic" OFF ) +option(buildTests "Set up unit, application, and module tests." ON ) +option(JP2KFLAG "Whether or not to build using JPEG2000 support" OFF ) +option(pybindings "Turn on to build Python bindings" OFF ) + +# if cmake install prefix is not set, and conda env is activated, use the +# conda env as the install directory +if(DEFINED ENV{CONDA_PREFIX} AND CMAKE_INSTALL_PREFIX STREQUAL "/usr/local") + set(CMAKE_INSTALL_PREFIX $ENV{CONDA_PREFIX}) +endif() + +# Prioritize passed in variables over env vars, probably a better way to do this +if(DEFINED ENV{ISIS3DATA} AND NOT isis3Data) + set(isis3Data $ENV{ISIS3DATA}) +endif() +if(DEFINED ENV{ISIS3TESTDATA} AND NOT isis3TestData) + set(isis3TestData $ENV{ISIS3TESTDATA}) +endif() + +if(EXISTS ${isis3Data}) + set(ENV{ISIS3DATA} "${isis3Data}") +else() + message(WARNING "Isis3Data directory ${isis3Data} not found, unit tests will fail.") + set(isis3Data OFF) +endif() + +if(EXISTS ${isis3TestData}) + set(ENV{ISIS3TESTDATA} "${isis3TestData}") +else() + message(WARNING "Isis3TestData directory ${isis3TestData} not found, application and module tests will fail.") + set(isis3TestData OFF) +endif() + +if(${testOutputDir} STREQUAL "OFF") + message("Writing test data folders to = ${CMAKE_BINARY_DIR}/testOutputDir") + set(testOutputDir "${CMAKE_BINARY_DIR}/testOutputDir") + execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/testOutputDir) +else() + # User specified a test output folder, make sure it exists. + message("Writing test data folders to = ${testOutputDir}") + execute_process(COMMAND mkdir -p ${testOutputDir}) +endif() + +# inject ISISROOT +add_definitions( -DISISROOT="${CMAKE_SOURCE_DIR}" ) +add_definitions( -DISISBUILDDIR="${CMAKE_BINARY_DIR}" ) + +message("CONFIGURATION") +message("\tBUILD STATIC CORE: ${buildStaticCore}") +message("\tBUILD TESTS: ${buildTests}") +message("\tBUILD CORE: ${buildCore}") +message("\tBUILD MISSIONS: ${buildMissions}") +message("\tJP2K SUPPORT: ${JP2KFLAG}") +message("\tPYTHON BINDINGS: ${pybindings}") +message("\tISIS3DATA: ${isis3Data}") +message("\tISISTESTDATA: ${isis3TestData}") +message("\tTEST OUTPUT DIR: ${testOutputDir}") +message("\tINSTALL PREFIX: ${CMAKE_INSTALL_PREFIX}") + +#=============================================================================== +#=============================================================================== + +# Set up the ctest tool which is used to run all of the tests. +enable_testing() +include(CTest) + +# Set up Anaconda prefix in the case with a non-default conda env is activated +if(EXISTS $ENV{CONDA_PREFIX}) + message("CONDA PREFIX: $ENV{CONDA_PREFIX}") + list(APPEND CMAKE_FIND_ROOT_PATH $ENV{CONDA_PREFIX} + $ENV{CONDA_PREFIX}/lib/cmake/Qt5) +endif() + +# options only allow on/off but this flag is piped into ISIS as ENABLEJP2K +# needs to be either 1 or 0 for C style true false +if(JP2KFLAG) + set(JP2KFLAG 1) +endif() + +# Set up the ctest tool which is used to run all of the tests. +enable_testing() +include(CTest) + +# Specify flags used +# on linux, add the conda prefix to handle possible issues with rpaths at link time +# sometimes third parties do not set their rpaths correctly +set(thirdPartyCppFlags -Wall + -fPIC + -std=c++11 + -DISIS_LITTLE_ENDIAN=1 + -Wno-unused-parameter + -Wno-overloaded-virtual + -Wno-strict-aliasing + -Wno-strict-overflow + -DGMM_USES_SUPERLU + -DENABLEJP2K=${JP2KFLAG} + ) + + # Append CPP flags set in the third party lib file to the string set in this file. + string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" ) + + +# Flag to fix numeric literals problem with boost on linux +# Add gold linker (and therefore, phtread) to speed up linux (spec. Ubuntu18.04) builds +if(NOT APPLE) + set(thirdPartyCppFlags ${thirdPartyCppFlags} -fuse-ld=gold + -pthread + -fext-numeric-literals + -Wl,-rpath,$ENV{CONDA_PREFIX}/lib) +endif() + + # Append CPP flags set in the third party lib file to the string set in this file. + string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" ) + + +# Paths to required executables +find_program(XALAN Xalan REQUIRED) +find_program(LATEX latex) +find_program(DOXYGEN NAME doxygen PATH_SUFFIXES doxygen REQUIRED) +find_program(UIC uic REQUIRED) +find_program(MOC moc REQUIRED) +find_program(RCC rcc REQUIRED) +find_program(PROTOC protoc REQUIRED) + +find_package(Qt5 COMPONENTS + Core + Concurrent + Gui + Multimedia + MultimediaWidgets + Network + OpenGL # Needed to install mesa-common-dev for this! + PrintSupport + Qml + Quick + Script + ScriptTools + Sql + Svg + Test + WebChannel + Widgets + Xml + XmlPatterns + # Search this path explicitly for MacOS OpenGL Framework + PATHS /System/Library/Frameworks/ REQUIRED) + +# Some of these will have non-traditional installs with version numbers in the paths in v007 +# For these, we pass in a version number, and use it in the path suffix +# This only applies to v007, and outside of the building, we should only expect standard installs +# The v007-specific installs are listed beside their find_package calls below: +find_package(Boost 1.59.0 REQUIRED) +find_package(Bullet 2.86 REQUIRED) +find_package(Cholmod 4.4.5 REQUIRED) +find_package(CSPICE 65 REQUIRED) +find_package(Eigen REQUIRED) +find_package(Embree 2.15.0 REQUIRED) +find_package(GeoTIFF 2 REQUIRED) +find_package(GMM 5.0 REQUIRED) +find_package(GSL 19 REQUIRED) +find_package(HDF5 1.8.15 REQUIRED) +find_package(Jama 125 REQUIRED) +find_package(NN REQUIRED) +find_package(OpenCV 3.1.0 REQUIRED) +find_package(PCL 1.8 REQUIRED) +find_package(Protobuf 2.6.1 REQUIRED) +find_package(Qwt 6 REQUIRED) +find_package(SuperLU 4.3 REQUIRED) +find_package(TIFF 4.0.5 REQUIRED) +find_package(TNT 126 REQUIRED) +find_package(XercesC 3.1.2 REQUIRED) +find_package(X11 6 REQUIRED) +find_package(nanoflann REQUIRED) +find_package(PNG REQUIRED) +find_package(Kakadu) +find_package(Geos 3.5.0 REQUIRED) +find_package(Armadillo REQUIRED) +find_package(Threads) + + +# In this case, we specify the version numbers being searched for in the non-traditional installs. +if(APPLE) +find_package(OpenGL REQUIRED) +endif(APPLE) + +if(pybindings) + find_package(Python REQUIRED) + find_package(Sip REQUIRED) +endif() + +# Iterate through all variables and extract the libraries and include directories +get_cmake_property(_variableNames VARIABLES) # Get All VARIABLES + +set(ALLLIBDIRS "") +set(ALLLIBS "") +set(ALLINCDIRS "") + +# Get all include dir variables +foreach (_variableName ${_variableNames}) +#message("VAR=${_variableName}") + if (_variableName MATCHES ".+_INCLUDE_DIR$") + list(APPEND ALLINCDIRS "${${_variableName}}") + elseif (_variableName MATCHES ".+_INCLUDE_PATH$") + list(APPEND ALLINCDIRS "${${_variableName}}") + endif(_variableName MATCHES ".+_INCLUDE_DIR$") +endforeach() + +# get all Library variables +foreach (_variableName ${_variableNames}) + get_filename_component(LIBDIR "${${_variableName}}" DIRECTORY) + if (_variableName MATCHES "^CMAKE+") + elseif (_variableName MATCHES ".+_LIB$") + list(APPEND ALLLIBDIRS "${LIBDIR}") + list(APPEND ALLLIBS "${${_variableName}}") + elseif (_variableName MATCHES ".+_LIBRARY$") + list(APPEND ALLLIBDIRS "${LIBDIR}") + list(APPEND ALLLIBS "${${_variableName}}") + elseif (_variableName MATCHES ".+_LIBRARIES$") + list(APPEND ALLLIBDIRS "${LIBDIR}") + list(APPEND ALLLIBS "${${_variableName}}") + endif() +endforeach() + +# Sometimes we add the same lib more than once (especially with LIBDIRS) +list(REMOVE_DUPLICATES ALLLIBDIRS) +list(REMOVE_DUPLICATES ALLLIBS) +list(REMOVE_DUPLICATES ALLINCDIRS) + +#=============================================================================== +#=============================================================================== + +# Set python bindings configuration and set target for generating C++ files +if(pybindings) + message("Configuring Python Bindings") + + if (NOT DEFINED PYINSTALL_DIR) + set(PYINSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR}) + endif() + message(STATUS "PYTHON BINDINGS INSTALL DIR: ${PYINSTALL_DIR}") + + # We need to get the locations for sip files, modules, etc. + set(ISIS_SIP_DIR "${CMAKE_SOURCE_DIR}/sipfiles") + set(ISIS_SIP_MODULE "${CMAKE_SOURCE_DIR}/sipfiles/master.sip") + set(SIP_BUILD_FILE "isispy.sbf") + set(ISIS_SIP_CODE_DIR ${CMAKE_BINARY_DIR}/sipsrc) + + # Create the output directory for the new .CPP files + execute_process(COMMAND mkdir -p "${ISIS_SIP_CODE_DIR}") + + # get list of output files exepected from sip + + # get the PYQT configuration based flags from Python + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c + "from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict;print(qtconfigdict['sip_flags'])" + OUTPUT_VARIABLE PYQT_SIP_FLAGS) + + # CMAKE doesn't handle spaces from python well when piping that into the + # command because of white space and a trailing new line, + # so we turn it into a list + message(STATUS "Getting SIP config...") + message(STATUS "Attempting 'python -c \"from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict; print(qtconfigdict['sip_flags'])\"'") + + if (${PYQT_SIP_FLAGS} STREQUAL "") + message(FATAL_ERROR "print(qtconfigdict['sip_flags']) returned empty string, is sip installed? Python binding can be disabled with pybindings=OFF") + endif() + string(STRIP ${PYQT_SIP_FLAGS} PYQT_SIP_FLAGS) + string(REPLACE " " ";" PYQT_SIP_FLAGS ${PYQT_SIP_FLAGS}) + + message(STATUS "FLAGS: ${PYQT_SIP_FLAGS}") + message(STATUS "Generating C++ code from sip files") + message(STATUS "SIP BUILD FILE: ${SIP_BUILD_FILE}") + message(STATUS "SIP MODULE: ${ISIS_SIP_MODULE}") + message(STATUS "SIP GENERATED CODE DIR: ${ISIS_SIP_CODE_DIR}") + + execute_process(COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE}) + + # add target so users can run the command after initial configuration + add_custom_target(sipfiles + COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE} + COMMENT "Generating C++ code from sip files") + + file(GLOB SIP_GENERATED_SOURCE_FILES ${ISIS_SIP_CODE_DIR}/*.cpp) + add_library(isispy MODULE ${SIP_GENERATED_SOURCE_FILES}) + target_link_libraries(isispy ${ALLLIBS}) + target_link_libraries(isispy isis3) + set_target_properties(isispy PROPERTIES LINK_DEPENDS isis3 INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}) + add_dependencies(isispy sipfiles) + + install(TARGETS isispy DESTINATION ${PYINSTALL_DIR}) +endif() + + +#=============================================================================== +#=============================================================================== + +# Start setting up the build +# Add extension to find fortran until .so symlink can be added to /usr/lib64 +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.3 .so.6 .so.5) + +# Allow everything to include the 3rd party libraries +include_directories(SYSTEM ${ALLINCDIRS}) +link_directories(${ALLLIBDIRS}) + +include_directories(${CMAKE_BINARY_DIR}/inc) +set(CORE_LIB_NAME isis3) + +# Specify relative library include paths which will be set up on +# the installed files. +if(APPLE) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};@loader_path/../lib;@loader_path/../3rdParty/lib") +else() + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};$ORIGIN/../lib;$ORIGIN/../3rdParty/lib") +endif() + +# We will set up some links with these files at the end of the install process so +# make sure they are cleared at the start of the install process. +install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6.0${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.${SO})") +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/) +install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/src/base/objs/Preference/TestPreferences ${CMAKE_INSTALL_PREFIX}/)") +install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_INSTALL_PREFIX}/)") + +# Delete any existing plugin files in the build folder so they +# don't get filled with duplicate entries. +file(GLOB existingPlugins "${CMAKE_BINARY_DIR}/plugins/*.plugin") +if(existingPlugins) + file(REMOVE ${existingPlugins}) +endif() + +# Add a config file to the install bin directory so that QT can find the plugin libraries. +file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../3rdParty/plugins/\n") +install(FILES "${CMAKE_BINARY_DIR}/qt.conf" DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/xml) + +#Create the inc directory +execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc) + +# Create an xml folder in the source directory that we will need later +set(sourceXmlFolder ${CMAKE_BINARY_DIR}/bin/xml) +execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/xml) + +# Set up install of the templates folder. +install(DIRECTORY ${CMAKE_SOURCE_DIR}/templates DESTINATION .) + +# Set up install of the make folder. +install(DIRECTORY ${CMAKE_SOURCE_DIR}/make DESTINATION ${CMAKE_INSTALL_PREFIX}) + +# Have CMake process all of the source code and tests. +add_subdirectory(src objects) + +if(APPLE) + set(SO ".dylib") +else() + set(SO ".so") +endif() + +# Set up documentation build target. +# - This script is called by running "ninja docs". +# - This long call passes all desired variables to the script. +add_custom_target(docs COMMAND ${CMAKE_COMMAND} + -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} + -DDOXYGEN=${DOXYGEN} -DXALAN=${XALAN} + -DLATEX=${LATEX} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -P ${CMAKE_MODULE_PATH}/BuildDocs.cmake) + +# Add custom build target to copy modified header files to the build/incs directory. +# ALL is specified so that the target is added to the default build target, i.e. the copy command +# will be executed when running "ninja install" +# On a clean build, all files will be copied over. +add_custom_target(incs ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/src/*/objs/*/*.h ${CMAKE_SOURCE_DIR}/src/*/objs/*/*.hpp + ${CMAKE_SOURCE_DIR}/src/*/apps/*/*.h ${CMAKE_BINARY_DIR}/inc) +add_dependencies(isis3 incs) + +# Add a custom build target to clean out everything that gets added to the source +# directory during the build process. +# - Only a few things are added in order to make the tests work properly so +# this is very straightforward. +add_custom_target(clean_source COMMAND rm -rf "${CMAKE_BINARY_DIR}/*" "${CMAKE_INSTALL_PREFIX}/*") + +# Set up a few top level files for installation. +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -rf ${CMAKE_SOURCE_DIR}/scripts ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/../LICENSE.txt ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/version ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -rf ${CMAKE_SOURCE_DIR}/make ${CMAKE_BINARY_DIR}) + +# Copy the files on make install as well +install(FILES ${CMAKE_SOURCE_DIR}/IsisPreferences DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_SOURCE_DIR}/../LICENSE.txt DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_SOURCE_DIR}/version DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/scripts DESTINATION ${CMAKE_INSTALL_PREFIX}) + +# Trigger all post-install behavior. +# - The only way to run commands post-install in CMake is to add a subdirectory at +# the end of this file containing a CMakeLists.txt file which includes all of +# the desired post-install commands inside. +add_subdirectory(cmake) +option (BUILD_TESTS "Build tests" ON) +if(BUILD_TESTS) + include(CTest) + enable_testing() + add_subdirectory(tests) +endif() diff --git a/isis/TestPreferences b/isis/TestPreferences new file mode 100644 index 0000000000000000000000000000000000000000..8c0ef67098a0923f7bf7065b0394377225cb5fb1 --- /dev/null +++ b/isis/TestPreferences @@ -0,0 +1,216 @@ +####################################################### +# This file allows the user to customize their Isis +# configuration. See the Isis Preference Dictionary +# on our website isis.astrogeology.usgs.gov for a +# full description of each group. +######################################################## + +######################################################## +# Customize elements of the user interface +# +# ProgressBarPercent = 1 | 2 | 5 | 10 +# ProgressBar = On | Off +# GuiStyle = windows | motif | cde | motifplus | +# platinum | sgi | kde | aqua +# GuiHelpBrowser = { your preferred browser, may need path } +# GuiFontName = helvetica | times | charter | any legal font +# GuiFontSize = 10 | 12 | 14 | any font point size +# HistoryPath = { your preferred loaction for the application +# .par files } +# HistoryRecording = On | Off +# HistoryLength = (your preferred count of history entries +# to remember) +######################################################## + +Group=UserInterface + ProgressBarPercent = 10 + ProgressBar = Off + GuiHelpBrowser = firefox + GuiFontName = helvetica + GuiFontSize = 10 + GuiWidth = 460 + GuiHeight = 600 + HistoryPath = $HOME/.Isis/history + HistoryRecording = Off + HistoryLength = 10 +EndGroup + +######################################################## +# Customize how errors are reported +# +# FileLine = On | Off +# Format = Standard | Pvl +# StackTrace = On | Off +######################################################## + +Group = ErrorFacility + FileLine = Off + Format = Standard + StackTrace = Off +EndGroup + +######################################################## +# Specify which ray-tracing engine to use for shape +# models. +# +# Leave the ShapeModel Group commented-out to continue +# using the ISIS3 default. +# +# RayTraceEngine = Bullet | Embree +# OnError = Continue | Fail +# Tolerance = { numerical value that will be set as the +# tolerance for the Bullet or Embree shape +# model } +# +######################################################## + +#Group = ShapeModel +# RayTraceEngine = Embree +# OnError = Continue +# CubeSupported = False +# Tolerance = DBL_MAX +#EndGroup + +######################################################## +# Customize how session logging is handled +# +# TerminalOutput = On | Off +# On - in command-line mode - user input parameters, +# results, and accounting are +# reported to the terminal. +# Errors are reported in Pvl +# also to the terminal. +# - in interactive mode - same as command-line +# mode, but output is directed +# to the gui. In the case of +# an error, nothing is reported +# to the gui except a pop-up +# window displaying the error. +# Off - in command-line mode - only the results are +# reported to the terminal, or +# in the case of an error, +# the error is reported in Pvl +# to the terminal. +# - in interactive mode - same as command-line mode, +# but the error is reported in +# a pop-up window in the gui. +# FileOutput = On | Off +# FileName = print.prt | /mydirectory/myfile.prt +# FileAccess = Append | Overwrite +######################################################## + +Group = SessionLog + TerminalOutput = Off + FileOutput = On + FileName = print.prt + FileAccess = Append +EndGroup + +######################################################## +# Customize how cubes are created +# +# Overwrite = Error | Allow +# Format = Attached | Detached +# History = On | Off +# MaximumSize = max # of gigabytes +######################################################## + +Group = CubeCustomization + Overwrite = Allow + Format = Attached + History = On + MaximumSize = 12 +EndGroup + +######################################################## +# Customize how other files are created +# +# Overwrite = Error | Allow +# +# If Error, then overwrites of any non-cube +# file will be disallowed and an error will be thrown +######################################################## + +Group = FileCustomization + Overwrite = Allow +EndGroup + +######################################################## +# Customize how Isis uses your computer's resources. +# +# CubeWriteThread = Always | Optimized | Never +# Always - Override Isis program defaults and always +# use a separate thread for writing out cubes. This +# will probably improve performance for some +# programs, will probably negatively impact programs +# that read/write the same file. This option should +# be used with caution. +# Optimized - Let the Isis program decide based on +# it's own internal knowledge. +# Never - Revert to the original method of writing +# cubes always. +# +# GlobalThreads = Optimized | N +# Optimized - The number of global (active processing) +# threads used will match the current system's number +# of CPU cores. +# N - +# Global (processing threads) encapsulate most of Isis' +# CPU-intensive operations. This should be a +# positive whole number greater than 0. This number +# does not cull the number of other thread-types in +# Isis, for example the cube write thread, but it +# should fairly accurately reflect overall potential +# CPU usage in Isis. +######################################################## +Group = Performance + CubeWriteThread = Optimized + GlobalThreads = 2 +EndGroup + +######################################################## +# Customize the location of mission specific data +# files (calibration and spice kernels). Usually this +# should be left to the Isis administrator +######################################################## + +Group = DataDirectory + Apollo15 = $ISIS3DATA/apollo15 + Apollo16 = $ISIS3DATA/apollo16 + Apollo17 = $ISIS3DATA/apollo17 + Base = $ISIS3DATA/base + Cassini = $ISIS3DATA/cassini + Chan1 = $ISIS3DATA/chan1 + Chandrayaan1 = $ISIS3DATA/chandrayaan1 + Clementine1 = $ISIS3DATA/clementine1 + Control = $ISIS3DATA/control + Dawn = $ISIS3DATA/dawn + Galileo = $ISIS3DATA/galileo + Hayabusa = $ISIS3DATA/hayabusa + Hayabusa2 = $ISIS3DATA/hayabusa2 + Juno = $ISIS3DATA/juno + Kaguya = $ISIS3DATA/kaguya + Lo = $ISIS3DATA/lo + Lro = $ISIS3DATA/lro + Mariner10 = $ISIS3DATA/mariner10 + Mer = $ISIS3DATA/mer + Mex = $ISIS3DATA/mex + Messenger = $ISIS3DATA/messenger + Mgs = $ISIS3DATA/mgs + Mro = $ISIS3DATA/mro + Near = $ISIS3DATA/near + NewHorizons = $ISIS3DATA/newhorizons + Odyssey = $ISIS3DATA/odyssey + OsirisRex = $ISIS3DATA/../datalocal/osirisrex + Rolo = $ISIS3DATA/rolo + Rosetta = $ISIS3DATA/rosetta + Smart1 = $ISIS3DATA/smart1 + Tgo = $ISIS3DATA/tgo + Viking1 = $ISIS3DATA/viking1 + Viking2 = $ISIS3DATA/viking2 + Voyager1 = $ISIS3DATA/voyager1 + Voyager2 = $ISIS3DATA/voyager2 + Temporary = . +EndGroup + +End diff --git a/isis/cmake/AddIsisModule.cmake b/isis/cmake/AddIsisModule.cmake new file mode 100644 index 0000000000000000000000000000000000000000..712aec0fd79e4551e3b98de8f3be1dfec5b35d11 --- /dev/null +++ b/isis/cmake/AddIsisModule.cmake @@ -0,0 +1,296 @@ +#=============================================================================== +# Functions to add ISIS modules to the CMake build +#=============================================================================== + +include(CodeGeneration) + +# Incorporate an application folder +function(add_isis_app folder libDependencies) + + # The internal build name will be different than the output name + # - This deals with problems compiling same-named targets on case-insensitive machines. + get_filename_component(appName ${folder} NAME) + set(internalAppName ${appName}_app) + + # Get the main and xml files + file(GLOB sources "${folder}/main.cpp") + file(GLOB xmlFiles "${folder}/*.xml") + + # All the XML files need to be copied to the install directory + # - They also need be put in the source folder for the app tests + install(FILES ${xmlFiles} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/xml") + if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/xml) + execute_process(COMMAND mkdir ${CMAKE_BINARY_DIR}/bin/xml) + endif() + + foreach(xml ${xmlFiles}) + get_filename_component(folder ${xml} DIRECTORY) + get_filename_component(name ${folder} NAME) + if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/xml/${name}.xml) + execute_process(COMMAND ln -s "${xml}" "${name}.xml" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin/xml) + endif() + endforeach() + + # Generate required QT files + generate_moc_files(mocFiles ${folder}) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + # Set up the executable + add_executable(${internalAppName} ${headers} ${sources} ${mocFiles}) + set_target_properties(${internalAppName} PROPERTIES LINKER_LANGUAGE CXX) + + # Have the app install with the real name, not the internal name. + target_link_libraries(${internalAppName} ${libDependencies}) + + set_target_properties(${internalAppName} PROPERTIES OUTPUT_NAME ${appName}) + install(TARGETS ${internalAppName} DESTINATION bin) + + if(${buildTests}) + # Set up the app tests + # - There may be multiple test folders in the /tsts directory, each + # with its own Makefile describing the test. + set(testFolder ${folder}/tsts) + file(GLOB tests "${testFolder}/*") + foreach(f ${tests}) + add_makefile_test_folder(${f} ${appName}_app) + endforeach() + endif() +endfunction(add_isis_app) + + +# Set up the lone unit test in an obj folder +function(make_obj_unit_test moduleName testFile truthFile reqLibs pluginLibs) + if(${testFile} STREQUAL "NOTFOUND") + # Skip if no unitest + return() + endif() + # Get the object name (last folder part) + get_filename_component(folder ${testFile} DIRECTORY) + get_filename_component(filename ${folder} NAME) + + # See if there are any plugin libraries that match the name + # - If there are, we need to link to them! + set(matchedLibs) + foreach (f ${pluginLibs}) + if(${f} STREQUAL ${filename}) + set(matchedLibs ${f}) + endif() + endforeach() + + # Generate a name for the executable + set(executableName "${moduleName}_unit_test_${filename}") + + # Create the executable and link it to the module library + add_executable( ${executableName} ${testFile}) + set(depLibs "${reqLibs};${matchedLibs}") + target_link_libraries(${executableName} ${moduleName} ${depLibs}) + + # Call function to add the test + add_unit_test_target(${executableName} ${truthFile} ${moduleName}) + +endfunction(make_obj_unit_test) + + +# Incorporate a single obj folder +function(add_isis_obj folder reqLibs) + + get_filename_component(folderName ${folder} NAME) + + # Look inside this folder for include files + + # Find the source and header files + file(GLOB headers "${folder}/*.h" "${folder}/*.hpp") + # ignore app.cpp + file(GLOB sources "${folder}/*.c" "${folder}/*.cpp") + file(GLOB truths "${folder}/*.truth") + file(GLOB plugins "${folder}/*.plugin") + + list(REMOVE_ITEM sources "${folder}/main.cpp") + + # Generate protobuf, ui, and moc files if needed. + generate_protobuf_files(protoFiles ${folder}) + generate_ui_files(uiFiles ${folder}) + generate_moc_files(mocFiles ${folder}) + + # Don't include the unit test in the main source list + set(unitTest ${folder}/unitTest.cpp) + list(REMOVE_ITEM sources "${unitTest}") + + # Add the unit test file for this folder if it exists. + if(EXISTS "${unitTest}") + set(thisTestFiles ${unitTest}) + else() + set(thisTestFiles) + endif() + + set(thisSourceFiles ${headers} ${sources} ${protoFiles} ${uiFiles} ${mocFiles}) + set(thisTruthFiles ${truths} ) + + # If there are multiple truth files, select based on the OS. + list(LENGTH thisTestFiles numTest) + list(LENGTH thisTruthFiles numTruth) + if(NOT (${numTest} EQUAL ${numTruth}) ) + + # Look for a truth file that contains the OS string + set(matchedTruth "NONE") + foreach(truthFile ${thisTruthFiles}) + + # If the truth file contains the OS string, use it. + string(FIND ${truthFile} ${osVersionString} position) + if(NOT ${position} EQUAL -1) + set(matchedTruth ${truthFile}) + break() + endif() + + endforeach() + + # If no OS matched, use the default truth file. + if(${matchedTruth} STREQUAL "NONE") + set(matchedTruth "${folder}/${folderName}.truth") + endif() + set(thisTruthFiles ${matchedTruth}) + endif() + + # Always pass the test and truth files to the caller + set(newTestFiles ${thisTestFiles} PARENT_SCOPE) + set(newTruthFiles ${thisTruthFiles} PARENT_SCOPE) + + list(LENGTH plugins numPlugins) + if(${numPlugins} EQUAL 0) + # No plugins, pass the source files back to the caller to add to the larger library. + set(newSourceFiles ${thisSourceFiles} PARENT_SCOPE) + else() + # Folder with a plugin means that this is a separate library! + # Add it here and then we are done with the source files. + + set(newSourceFiles ${thisSourceFiles} PARENT_SCOPE) + if(NOT (${numPlugins} EQUAL 1)) + message( FATAL_ERROR "Error: Multiple plugins found in folder!" ) + endif() + + get_filename_component(libName ${folder} NAME) + get_filename_component(pluginName ${plugins} NAME) + message("Adding plugin library: ${libName}") + + add_library_wrapper(${libName} "${thisSourceFiles}" "${reqLibs}") + + # Append the plugin file to a single file in the build directory + # where the .so files will be created. During installation copy these + # plugin files to the installation library folder. + set(pluginPath ${CMAKE_BINARY_DIR}/lib/${pluginName}) + cat(${plugins} ${pluginPath}) + install(PROGRAMS ${pluginPath} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/) + # Record this library name for the caller + set(newPluginLib ${libName} PARENT_SCOPE) + endif() + + +endfunction(add_isis_obj) + + + + +# Adds an entire module folder. +# - This includes the "base" folder and all the mission specific folders. +# - Each call of this function generates one library. +function(add_isis_module name) + + # First argument is the module name. + # Arguments after the first are the folders to look in. + set(topFolders ${ARGN}) + + message("Adding ISIS module with folders: ${topFolders}") + + set(objFolders) + set(appFolders) + set(tstFolders) + foreach(f ${topFolders}) + + # Folders: apps, lib, tests + set(appsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/apps") + set(objsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/objs") + set(tstsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/tsts") + + # Start with the objs folder + get_subdirectory_list(${objsDir} thisObjFolders) + get_subdirectory_list(${appsDir} thisAppFolders) + get_subdirectory_list(${tstsDir} thisTstFolders) + + set(objFolders ${objFolders} ${thisObjFolders} ${thisAppFolders}) + set(appFolders ${appFolders} ${thisAppFolders}) + set(tstFolders ${tstFolders} ${thisTstFolders}) + + endforeach() + # Now that we have the library info, call function to add it to the build! + # - Base module depends on 3rd party libs, other libs also depend on base. + # - Only the base module gets both a static and shared library. + if(${name} STREQUAL ${CORE_LIB_NAME}) + set(reqLibs "${ALLLIBS};gtest;gmock;${CMAKE_THREAD_LIBS_INIT}") + set(alsoStatic ON) + else() + set(reqLibs "${CORE_LIB_NAME};${ALLLIBS};gtest;gmock;${CMAKE_THREAD_LIBS_INIT}") + set(alsoStatic OFF) + endif() + + set(sourceFiles) + set(unitTestFiles) + set(truthFiles) + set(pluginLibs) + foreach(f ${objFolders}) + set(newSourceFiles) + set(newTestFiles) + set(newTruthFiles) + set(newPluginLib) + add_isis_obj(${f} "${reqLibs}") # Library add function + set(sourceFiles ${sourceFiles} ${newSourceFiles}) + set(unitTestFiles ${unitTestFiles} ${newTestFiles}) + set(truthFiles ${truthFiles} ${newTruthFiles}) + set(pluginLibs ${pluginLibs} ${newPluginLib}) + + endforeach(f) + + # Some modules don't generate a library + list(LENGTH sourceFiles temp) + if (NOT ${temp} EQUAL 0) + message("Adding library: ${name}") + add_library_wrapper(${name} "${sourceFiles}" "${reqLibs}" ${alsoStatic}) + + # Have the plugin libraries depend on the module library + foreach(plug ${pluginLibs}) + target_link_libraries(${plug} ${name}) + endforeach() + + # For everything beyond the module library, require the module library. + set(reqLibs "${reqLibs};${name}") + + if(${buildTests}) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/unitTest) + + # Now that the library is added, add all the unit tests for it. + list(LENGTH unitTestFiles temp) + math(EXPR numTests "${temp} - 1") + foreach(val RANGE ${numTests}) + list(GET unitTestFiles ${val} testFile ) + list(GET truthFiles ${val} truthFile) + + make_obj_unit_test(${name} ${testFile} ${truthFile} "${reqLibs}" "${pluginLibs}") + endforeach() + endif() + + endif() + + # Process the apps (core library always required) + foreach(f ${appFolders}) + add_isis_app(${f} "${reqLibs}") + endforeach() + + if(${buildTests}) + # Process the tests + # - The test suite in qisis/SquishTests are not properly located or handled by this code! + foreach(f ${tstFolders}) + add_makefile_test_folder(${f} ${name}_module) + endforeach() + endif() + +endfunction(add_isis_module) diff --git a/isis/cmake/BuildDocs.cmake b/isis/cmake/BuildDocs.cmake new file mode 100644 index 0000000000000000000000000000000000000000..64f5dc58f139110c583c22960be26a7ce1ccfd2b --- /dev/null +++ b/isis/cmake/BuildDocs.cmake @@ -0,0 +1,519 @@ +#============================================================================== +# File for building the ISIS documentation. +# - This is one of the most complicated parts of the build system! +# It makes heavy use of the Xalan XML tool and also requires Latex and Doxygen. +# - This file is called as a stand-alone script when "make docs" is executed. +#============================================================================== + + +cmake_minimum_required(VERSION 3.3) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/cmake") +include(Utilities) + +# Set up Xalan's command-line option names. +set(XALAN_VALIDATE_OPTION "-v") +set(XALAN_OUTFILE_OPTION "-o") +set(XALAN_PARAM_OPTION "-p") +set(XALAN_INFILE_OPTION "" ) +set(XALAN_XSL_OPTION "" ) + +# TODO: How should this be set? +set(MODE "") + + +#------------------------------------------------------------------------ + + +# Populate application doc files into "isis/doc/Application/presentation" +function(copy_app_docs_info) + + # Go through all application folders, copy .xml and assets + get_subdirectory_list("${PROJECT_SOURCE_DIR}/src" moduleFolders) + foreach(f ${moduleFolders}) + get_filename_component(moduleName ${f} NAME_WE) + + # Only need to process app folders, not obj folders. + if ((${moduleName} STREQUAL "docsys") OR (NOT EXISTS "${f}/apps")) + continue() # Skip this folder + endif() + + file(MAKE_DIRECTORY ${appDataFolder}/${moduleName}) + + get_subdirectory_list(${f}/apps appFolders) + foreach(appF ${appFolders}) + # Each app gets its own folder in the build directory + get_filename_component(appName ${appF} NAME_WE) + set(thisDataFolder ${appDataFolder}/${moduleName}/${appName}) + file(MAKE_DIRECTORY ${thisDataFolder}) + + # Copy the .xml file and the asset folder if it exists. + copy_file(${appF}/${appName}.xml ${thisDataFolder}/${appName}.xml) + if(EXISTS ${appF}/assets) + copy_folder(${appF}/assets ${thisDataFolder}) + endif() + endforeach() # End loop through apps + + endforeach() # End loop through modules + +endfunction(copy_app_docs_info) + + + + + +# Build the top level of the documents directory +function(build_upper_level) + + # Copy existing folders to the install directory + copy_folder(${docBuildFolder}/assets ${docInstallFolder}) + copy_folder(${docBuildFolder}/w3c ${docInstallFolder}) + + # Make new (empty) output folders + set(newFolders UserDocs AboutIsis General Guides Installation TechnicalInfo) + foreach(f ${newFolders}) + file(MAKE_DIRECTORY "${docInstallFolder}/${f}") + endforeach() + + # These folders are populated inside "build_documents_folder" + + # Create index.html file + execute_process(COMMAND ${XALAN} ${XALAN_VALIDATE_OPTION} ${XALAN_PARAM_OPTION} menuPath \"\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/index.html ${XALAN_INFILE_OPTION} ${docBuildFolder}/build/homepage.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/main.xsl) + + # This folder just gets copied as-is + execute_process(COMMAND cp -r ${PROJECT_SOURCE_DIR}/src/docsys/Schemas ${docInstallFolder}/Schemas) + +endfunction(build_upper_level) + + + + + +# Build src/docsys/documents folder. +function(build_documents_folder) + + message("Building documents folder...") + message(" Building table of contents XML...") + + # Create RealeaseNotes.xml, ApiChanges.xml and ParameterChanges.xml if need-be + if(EXISTS "${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml") + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"ReleaseNotes\" ${XALAN_INFILE_OPTION} ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/ReleaseNotes.xsl OUTPUT_FILE ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotes.xml) + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"ParameterChanges\" ${XALAN_INFILE_OPTION} ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/ParameterChanges.xsl OUTPUT_FILE ${docBuildFolder}/documents/ParameterChanges/ParameterChanges.xml) + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"ApiChanges\" ${XALAN_INFILE_OPTION} ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/ApiChanges.xsl OUTPUT_FILE ${docBuildFolder}/documents/ApiChanges/ApiChanges.xml) + else() + # Confirm that empty directories are not going to be traversed in loops coming up + message(" ReleaseNotesList.xml does not exist. Removing ReleaseNotes/ ParameterChanges/ and ApiChanges/ directories...") + execute_process(COMMAND rm -rf ${docBuildFolder}/documents/ReleaseNotes ${docBuildFolder}/documents/ParameterChanges ${docBuildFolder}/documents/ApiChanges) + endif() + + # Get list of folders of interest + get_subdirectory_list(${docBuildFolder}/documents docFolders) + + # Build doctoc.xml, the documents table of contents file. + set(doctocPath ${docBuildFolder}/build/doctoc.xml) + file(REMOVE ${doctocPath}) + cat(${docBuildFolder}/build/doctoc_header.xml ${doctocPath}) + foreach(f ${docFolders}) + + # Each folder in documents gets a section added to doctoc + get_filename_component(docName ${f} NAME_WE) + + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"${docName}\" ${XALAN_INFILE_OPTION} ${f}/${docName}.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/IsisDocumentTOCbuild.xsl OUTPUT_VARIABLE result) + file(APPEND ${doctocPath} ${result}) + + endforeach() + cat(${docBuildFolder}/build/doctoc_footer.xml ${doctocPath}) + + # Write out a modified .xsl file with the correct location of the Xalan executable. + set(modDocBuildXslFile ${docBuildFolder}/build/IsisInlineDocumentBuild_mod.xsl) + file(READ ${PROJECT_SOURCE_DIR}/scripts/IsisInlineDocumentBuild_mod.xsl xslContents) + string(REPLACE XALAN_BIN_LOCATION ${XALAN} xslContents "${xslContents}") + file(WRITE ${modDocBuildXslFile} "${xslContents}") + + # Build individual documents folders + message(" Building individual documents...") + file(MAKE_DIRECTORY ${docInstallFolder}/documents) + foreach(f ${docFolders}) + + message("Building documents folder: ${f}") + + # Handle paths for this folder + get_filename_component(docName ${f} NAME_WE) + set(thisOutputFolder ${docInstallFolder}/documents/${docName}) + file(MAKE_DIRECTORY ${thisOutputFolder}) + + # Use Xalan to generate an intermediate makefile, then execute that makefile + # to generate the output documentation files. + + set(xalanCommand ${XALAN} ${XALAN_PARAM_OPTION} menuPath "../../" ${XALAN_PARAM_OPTION} dirParam "'${docName}'" ${XALAN_OUTFILE_OPTION} ${f}/Makefile_temp ${XALAN_INFILE_OPTION} ${docName}.xml ${XALAN_XSL_OPTION} ${modDocBuildXslFile}) + execute_process(COMMAND ${xalanCommand} WORKING_DIRECTORY ${f}) + + execute_process(COMMAND make -f Makefile_temp docs WORKING_DIRECTORY ${f}) + execute_process(COMMAND rm -f ${f}/Makefile_temp) # Clean up + + # Copy all generated html files and any assets to the install folder + file(GLOB htmlFiles ${f}/*.html) + file(COPY ${htmlFiles} DESTINATION ${thisOutputFolder}) + if(EXISTS "${f}/assets") + copy_folder(${f}/assets ${thisOutputFolder}/assets) + endif() + if(EXISTS "${f}/images") + copy_folder(${f}/images ${thisOutputFolder}/images) + endif() + + endforeach() + + message(" Building table of contents files...") + # These go in top level folders in /doc/ + + # ABOUT ISIS TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/AboutIsis/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/AboutIsis.xsl) + + # GENERAL TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/General/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/General.xsl) + + # GUIDES TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/Guides/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/Guides.xsl) + + # INSTALLATION TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/Installation/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/Installation.xsl) + + # TECHNICAL INFO TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/TechnicalInfo/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/TechnicalInfo.xsl) + + # USER DOCS TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/UserDocs/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/UserDocs.xsl) + +endfunction(build_documents_folder) + + + + + +# Supporting files should already be in /src/docsys/Application +function(build_application_docs) + + # Is there any reason not to just generate all these files from their original + # locations instead of copying them to a temporary build directory? + + set(appFolder "${docBuildFolder}/Application") + set(printerStyleFolder "${appFolder}/presentation/PrinterFriendly/styles") + set(tabbedStyleFolder "${appFolder}/presentation/Tabbed/styles") + + set(installAppFolder "${docInstallFolder}/Application") + set(installPrinterFolder "${installAppFolder}/presentation/PrinterFriendly") + set(installTabbedFolder "${installAppFolder}/presentation/Tabbed") + + # Make output directories and copy the styles + file(MAKE_DIRECTORY "${installPrinterFolder}") + file(MAKE_DIRECTORY "${installTabbedFolder}") + file(MAKE_DIRECTORY "${installPrinterFolder}/styles") + file(MAKE_DIRECTORY "${installTabbedFolder}/styles") + copy_wildcard("${printerStyleFolder}/*.css" ${installPrinterFolder}/styles/) + copy_wildcard("${tabbedStyleFolder}/*.css" ${installTabbedFolder}/styles/ ) + + # Loop through module folders + get_subdirectory_list(${appDataFolder} moduleFolders) + foreach(mod ${moduleFolders}) + get_filename_component(moduleName ${mod} NAME) + + # Loop through application folders + get_subdirectory_list(${mod} appDataFolders) + foreach(f ${appDataFolders}) + get_filename_component(appName ${f} NAME) + + # Get printer-friendly and tabbed output folders + set(pfAppFolder ${installPrinterFolder}/${appName}) + set(tbAppFolder ${installTabbedFolder}/${appName}) + file(MAKE_DIRECTORY "${pfAppFolder}") + file(MAKE_DIRECTORY "${tbAppFolder}") + + if(EXISTS ${f}/assets) + copy_folder(${f}/assets ${pfAppFolder}) + copy_folder(${f}/assets ${tbAppFolder}) + endif() + + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../../../../\" ${XALAN_OUTFILE_OPTION} ${pfAppFolder}/${appName}.html ${XALAN_INFILE_OPTION} ${f}/${appName}.xml ${XALAN_XSL_OPTION} ${printerStyleFolder}/IsisApplicationDocStyle.xsl) + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../../../../\" ${XALAN_OUTFILE_OPTION} ${tbAppFolder}/${appName}.html ${XALAN_INFILE_OPTION} ${f}/${appName}.xml ${XALAN_XSL_OPTION} ${tabbedStyleFolder}/IsisApplicationDocStyle.xsl) + + endforeach() # End loop through app folders + + endforeach() # End loop through module folders + + # Make the table of contents that goes in the /bin/xml folder + + # Set up the file + set(appTocPath "${CMAKE_INSTALL_PREFIX}/bin/xml/applicationTOC.xml") + file(REMOVE ${appTocPath}) + cat(${docBuildFolder}/Application/build/toc_header.xml ${appTocPath}) + get_subdirectory_list(${appDataFolder} moduleFolders) + + # Loop through module folders + foreach(mod ${moduleFolders}) + get_filename_component(moduleName ${mod} NAME_WE) + + # Loop through application folders + get_subdirectory_list(${mod} appDataFolders) + foreach(f ${appDataFolders}) + + get_filename_component(docName ${f} NAME_WE) + + # Use Xalan to generate a piece of the TOC and append it to the file + execute_process(COMMAND ${XALAN} ${XALAN_INFILE_OPTION} ${f}/${docName}.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/Application/build/IsisApplicationTOCbuild.xsl OUTPUT_VARIABLE result) + file(APPEND ${appTocPath} ${result}) + endforeach() + endforeach() + + # Append the footer to complete the TOC file! + cat(${docBuildFolder}/Application/build/toc_footer.xml ${appTocPath}) + +endfunction(build_application_docs) + + + + + +# Use the application TOC file to build some other TOCs +function(add_extra_tocs) + + set(TOCDIR "${docInstallFolder}/Application") + set(buildFolder "${docBuildFolder}/Application/build") + set(tocXml "${CMAKE_INSTALL_PREFIX}/bin/xml/applicationTOC.xml") + + # Build alpha.html + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${TOCDIR}/alpha.html ${XALAN_INFILE_OPTION} ${tocXml} ${XALAN_XSL_OPTION} ${buildFolder}/TOCindex_alpha.xsl) + + # Build index.html + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${TOCDIR}/index.html ${XALAN_INFILE_OPTION} ${tocXml} ${XALAN_XSL_OPTION} ${buildFolder}/TOCindex_category.xsl) + + # Build oldvnew.html + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${TOCDIR}/oldvnew.html ${XALAN_INFILE_OPTION} ${tocXml} ${XALAN_XSL_OPTION} ${buildFolder}/TOCindex_oldvnew.xsl) + + # Build applicationCategories.xml + execute_process(COMMAND ${XALAN} ${XALAN_OUTFILE_OPTION} ${CMAKE_INSTALL_PREFIX}/bin/xml/applicationCategories.xml ${XALAN_INFILE_OPTION} ${docBuildFolder}/Schemas/Application/application.xsd ${XALAN_XSL_OPTION} ${buildFolder}/IsisApplicationCategoriesbuild.xsl) + +endfunction(add_extra_tocs) + + + + + +# Set up three Doxygen configuration files +function(build_object_conf) + + message("Building apps configuration...") + + # Make a list of each object folder with an assets folder + get_subdirectory_list(moduleFolders ${PROJECT_SOURCE_DIR}) + set(OBJECTASSETS) + foreach(mod ${moduleFolders}) + get_subdirectory_list(objFolders ${mod}/objs) + foreach(obj ${objFolders}) + if(EXISTS ${obj}/assets) + set(OBJECTASSETS ${OBJECTASSETS} ${obj}/assets) + endif() + endforeach() # End obj loop + endforeach() # End module loop + + set(objConfDir ${docBuildFolder}/src/docsys/Object/build) + file(MAKE_DIRECTORY ${objConfDir}/apps) + + # The three conf files start from an input base file and append more options + set(appsConf ${objConfDir}/apps_tag_temp.conf ) + set(programmerConf ${objConfDir}/Programmer_temp.conf) + set(developerConf ${objConfDir}/Developer_temp.conf ) + set(docInstallDir ${docInstallFolder}/Object ) + + # Copy settings files from the source folder to the build folder + copy_wildcard("${PROJECT_SOURCE_DIR}/src/docsys/Object/build/*" ${objConfDir}) + + # Append to the app conf file + # apps_tag.conf doesnt exist? + cat(${objConfDir}/apps_tag.conf ${appsConf}) + file(APPEND ${appsConf} "LATEX_CMD_NAME = ${LATEX}\n") + file(APPEND ${appsConf} "OUTPUT_DIRECTORY = ${docInstallDir}\n") + file(APPEND ${appsConf} "STRIP_FROM_PATH = ${PROJECT_SOURCE_DIR}/\n") + file(APPEND ${appsConf} "INPUT = ${PROJECT_SOURCE_DIR}/src/ ${objConfDir}/isisDoxyDefs.doxydef\n") + file(APPEND ${appsConf} "HTML_HEADER = ${objConfDir}/IsisObjectHeader.html\n") + file(APPEND ${appsConf} "HTML_FOOTER = ${objConfDir}/IsisObjectFooter.html\n") + file(APPEND ${appsConf} "PROJECT_LOGO = ${docBuildFolder}/assets/icons/USGS_logo55h.png\n") + file(APPEND ${appsConf} "HTML_OUTPUT = apps\n") + + if(NOT ${DOT_PATH} STREQUAL "") + file(APPEND ${appsConf} "DOT_PATH = /opt/local/bin\n") + endif() + + # Append to the programmer conf file + cat(${objConfDir}/Programmer.conf ${programmerConf}) + file(APPEND ${programmerConf} "OUTPUT_DIRECTORY = ${docInstallDir}\n") + file(APPEND ${programmerConf} "FILE_PATTERNS = *objs*.h") + file(APPEND ${programmerConf} " *objs*.cpp") + file(APPEND ${programmerConf} " *build/isisDoxyDefs.doxydef\n") + file(APPEND ${programmerConf} "STRIP_FROM_PATH = ${PROJECT_SOURCE_DIR}/\n") + file(APPEND ${programmerConf} "INPUT = ${PROJECT_SOURCE_DIR}/src/ ${objConfDir}/isisDoxyDefs.doxydef\n") + file(APPEND ${programmerConf} "HTML_HEADER = ${objConfDir}/IsisObjectHeader.html\n") + file(APPEND ${programmerConf} "HTML_FOOTER = ${objConfDir}/IsisObjectFooter.html\n") + file(APPEND ${programmerConf} "PROJECT_LOGO = ${docBuildFolder}/assets/icons/USGS_logo55h.png\n") + file(APPEND ${programmerConf} "HTML_OUTPUT = Programmer\n") + file(APPEND ${programmerConf} "IMAGE_PATH = \n") + + string(FIND "${MODE}" "LOUD" pos) + if (NOT ${pos} STREQUAL "-1") + file(APPEND ${programmerConf} "QUIET = NO\n") + file(APPEND ${programmerConf} "WARNINGS = YES\n") + file(APPEND ${programmerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${programmerConf} "WARN_IF_DOC_ERROR = YES\n") + file(APPEND ${programmerConf} "WARN_NO_PARAMDOC = YES\n") + else() + file(APPEND ${programmerConf} "QUIET = YES\n") + file(APPEND ${programmerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${programmerConf} "WARN_IF_DOC_ERROR = YES\n") + file(APPEND ${programmerConf} "WARN_NO_PARAMDOC = YES\n") + endif() + + if (NOT ${DOT_PATH} STREQUAL "") + file(APPEND ${programmerConf} "DOT_PATH = /opt/local/bin\n") + endif() + + foreach(dirname ${OBJECTASSETS}) + file(APPEND ${programmerConf} "${dirname} \\\n") + endforeach() + + # Append to the developer conf file + cat(${objConfDir}/Developer.conf ${developerConf}) + file(APPEND ${developerConf} "LATEX_CMD_NAME = ${LATEX}\n") + file(APPEND ${developerConf} "OUTPUT_DIRECTORY = ${docInstallDir}\n") + file(APPEND ${developerConf} "STRIP_FROM_PATH = ${CMAKE_INSTALL_PREFIX}/\n") + file(APPEND ${developerConf} "INPUT = ${PROJECT_SOURCE_DIR}/src/ ${objConfDir}/isisDoxyDefs.doxydef\n") + file(APPEND ${developerConf} "HTML_HEADER = ${objConfDir}/IsisObjectHeader.html\n") + file(APPEND ${developerConf} "HTML_FOOTER = ${objConfDir}/IsisObjectFooter.html\n") + file(APPEND ${developerConf} "PROJECT_LOGO = ${docBuildFolder}/assets/icons/USGS_logo55h.png\n") + file(APPEND ${developerConf} "HTML_OUTPUT = Developer\n") + file(APPEND ${developerConf} "IMAGE_PATH = \n") + string(FIND "${MODE}" "LOUD" pos) + if (NOT ${pos} STREQUAL "-1") + file(APPEND ${developerConf} "QUIET = NO\n") + file(APPEND ${developerConf} "WARNINGS = YES\n") + file(APPEND ${developerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${developerConf} "WARN_IF_DOC_ERROR = YES\n") + file(APPEND ${developerConf} "WARN_NO_PARAMDOC = YES\n") + else() + file(APPEND ${developerConf} "QUIET = YES\n") + file(APPEND ${developerConf} "WARNINGS = NO\n") + file(APPEND ${developerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${developerConf} "WARN_IF_DOC_ERROR = NO\n") + file(APPEND ${developerConf} "WARN_NO_PARAMDOC = NO\n") + endif() + + foreach(dirname ${OBJECTASSETS}) + file(APPEND ${developerConf} "${dirname} \\\n") + endforeach() + +endfunction(build_object_conf) + + + + +# Build doxygen output for ISIS code +function(build_object_docs) + + # Create app, developer, and programmer Doxygen configuration files. + build_object_conf() + + # TODO: Do prog_tester conf here as well? + + set(objConfDir ${docBuildFolder}/src/docsys/Object/build) + + message("Copying object assets...") + file(MAKE_DIRECTORY "${docInstallFolder}/Object") + execute_process(COMMAND cp -r ${docBuildFolder}/Object/assets ${docInstallFolder}/Object/) + + + message("Creating Object Documentation") + file(MAKE_DIRECTORY ${docInstallFolder}/Object/apps) + file(MAKE_DIRECTORY ${docInstallFolder}/Object/Developer) + file(MAKE_DIRECTORY ${docInstallFolder}/Object/Programmer) + file(MAKE_DIRECTORY ${docInstallFolder}/documents/DocStyle/assets) + copy_wildcard("${docBuildFolder}/Object/*.html" ${docInstallFolder}/Object/) + #copy_file(${objBuildDir}/isisDoxyDefs.doxydef ${docInstallFolder}/documents/DocStyle/assets/isisDoxyDefs.doxydef) + + + message("Building Apps documentation..") + execute_process(COMMAND ${DOXYGEN} "${objConfDir}/apps_tag_temp.conf" + WORKING_DIRECTORY ${docBuildFolder}/src/docsys/Object/) + message("Finished building Apps documentation.") + + message("Building Programmer documentation...") + execute_process(COMMAND ${DOXYGEN} "${objConfDir}/Programmer_temp.conf" + WORKING_DIRECTORY ${docBuildFolder}/src/docsys/Object/) + message("Finished building Programmer documentation.") + + message("Building Developer documentation...") + execute_process(COMMAND ${DOXYGEN} "${objConfDir}/Developer_temp.conf" + WORKING_DIRECTORY ${docBuildFolder}/src/docsys/Object/) + message("Finished building Developer documentation.") + +endfunction(build_object_docs) + + + + + +# Build all the documentation +function(build_docs) + + message("Building Isis Documentation...") + + # Set up output directory and a temporary directory for building + set(docBuildFolder ${CMAKE_BINARY_DIR}/docBuild) + set(appDataFolder ${docBuildFolder}/Application/data) + set(docInstallFolder ${CMAKE_BINARY_DIR}/docs) # Final output documentation + + # Clean up existing files + execute_process(COMMAND rm -rf ${docBuildFolder}) + execute_process(COMMAND rm -rf ${docInstallFolder}) + + message("XALAN = ${XALAN}") + message("DOXYGEN = ${DOXYGEN}") + message("LATEX = ${LATEX}") + + # Copy everything from src/docsys to docBuildFolder + execute_process(COMMAND cp -r ${PROJECT_SOURCE_DIR}/src/docsys ${docBuildFolder}) + + file(MAKE_DIRECTORY "${docBuildFolder}/Application") + file(MAKE_DIRECTORY "${docBuildFolder}/Application/data") + file(MAKE_DIRECTORY "${docInstallFolder}") + + message("Copying application information...") + copy_app_docs_info() + + message("Building upper level directories...") + build_upper_level() + + build_documents_folder() + + message("Building application docs...") + build_application_docs() + + message("Building additional TOCs...") + add_extra_tocs() + + # This step requires Latex and Doxygen + message("Building object documentation") + build_object_docs() + + # copy the built docs in the build directory over to the install directory on install + execute_process(COMMAND cp -rf ${docInstallFolder} ${CMAKE_INSTALL_PREFIX}) + + message("Finished building object documentation!") + + +endfunction(build_docs) + + + + +# This file gets called as a script, so call this function to run +# all the code in the file. +build_docs() diff --git a/isis/cmake/CMakeFiles/CMakeDirectoryInformation.cmake b/isis/cmake/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000000000000000000000000000000000000..67565806264baf0177c6b7b6561fa722e33cf643 --- /dev/null +++ b/isis/cmake/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.9 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/scratch/isiscmake/isis") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/scratch/isiscmake/isis") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/isis/cmake/CMakeFiles/progress.marks b/isis/cmake/CMakeFiles/progress.marks new file mode 100644 index 0000000000000000000000000000000000000000..573541ac9702dd3969c9bc859d2b91ec1f7e6e56 --- /dev/null +++ b/isis/cmake/CMakeFiles/progress.marks @@ -0,0 +1 @@ +0 diff --git a/isis/cmake/CMakeLists.txt b/isis/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..3bbf4bbd970fdfab027000ee3b5061f9ca9f74a9 --- /dev/null +++ b/isis/cmake/CMakeLists.txt @@ -0,0 +1,21 @@ +# This file contains everything that should be exectuted AFTER the installation +# step has completed. + +message("Setting up post-install behavior...") + +# Set up format version numbers for the main shared library on install +install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_BINARY_DIR}/lib/libisis3${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6.0${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.6.0${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.6${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${SO})") + +# On OSX, need to correct all the paths encoded in each of the distributed library files so +# that they properly find the distruted files using relative paths. +if (APPLE) + # Also need to get the plugin folders + get_subdirectory_list(${CMAKE_SOURCE_DIR}/3rdParty/plugins pluginFolders) + foreach(f ${pluginFolders}) + get_filename_component(name ${f} NAME) + install(CODE "EXECUTE_PROCESS(COMMAND python ${CMAKE_SOURCE_DIR}/scripts/finalizeInstalledOsxRpaths.py ${CMAKE_INSTALL_PREFIX}/3rdParty/plugins/${name} resetRpath)") + endforeach() +endif() diff --git a/isis/cmake/CTestTestfile.cmake b/isis/cmake/CTestTestfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d19043d1b2c790da1feda3153854760881a4e0f1 --- /dev/null +++ b/isis/cmake/CTestTestfile.cmake @@ -0,0 +1,6 @@ +# CMake generated Testfile for +# Source directory: /scratch/isiscmake/isis/cmake +# Build directory: /scratch/isiscmake/isis/cmake +# +# This file includes the relevant testing commands required for +# testing this directory and lists subdirectories to be tested as well. diff --git a/isis/cmake/CodeGeneration.cmake b/isis/cmake/CodeGeneration.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9f48041afcb693e5217fa516c90f1553f6e5e157 --- /dev/null +++ b/isis/cmake/CodeGeneration.cmake @@ -0,0 +1,138 @@ +#================================================================== +# Contains functions for generating code files +#================================================================== + +# TODO: Can we consolidate the following three functions? + + +# Generate ui_*.h files from *.ui files using QT tool uic. +# - ${UIC} must point to the uic tool +function( generate_ui_files uiGenOut folder) + + # Finds all .ui files in the current dir + file(GLOB uiInput "${folder}/*.ui") + + # If no .ui files in this folder we are finished. + list(LENGTH uiInput numFiles) + if (${numFiles} EQUAL 0) + set(${uiGenOut} "" PARENT_SCOPE) + return() + endif() + + # Set where generated files go to and add that directory to the include path + get_code_gen_dir(${folder} uiGenDir) + + # For each input ui file + foreach(uiFile ${uiInput}) + # Get the name of the file without extension + get_filename_component(uiName ${uiFile} NAME_WE) + + # Add the generated file to UI_GEN variable + set(outUiFile "${uiGenDir}/ui_${uiName}.h") + set(uiGen ${uiGen} ${outUiFile}) + + # Add the custom command that will generate this file + # - The generated files will be put in the CMake build directory, + # not the source tree + add_custom_command(OUTPUT ${outUiFile} + COMMAND ${UIC} ${uiFile} -o ${outUiFile} && cp ${outUiFile} ${CMAKE_BINARY_DIR}/inc + DEPENDS ${uiFile} + WORKING_DIRECTORY ${folder} + COMMENT "Generating UI headers...") + endforeach() + + + set(${uiGenOut} ${uiGen} PARENT_SCOPE) # Set up output variable + +endfunction() + + + + +# Generate moc_*.cpp files from *.h files using Q_OBJECT using the moc tool. +# - ${MOC} must point to the moc tool +function( generate_moc_files mocGenOut folder) + + # Finds all .h files in the current dir including the text Q_OBJECT + file(GLOB candidateFiles "${folder}/*.h") + set(mocInput) + foreach(f ${candidateFiles}) + execute_process(COMMAND grep Q_OBJECT ${f} + OUTPUT_VARIABLE result + RESULT_VARIABLE code) + if("${code}" STREQUAL "0") + set(mocInput ${mocInput} ${f}) + endif() + endforeach() + + # If no Q_OBJECT files in this folder we are finished. + list(LENGTH mocInput numFiles) + if (${numFiles} EQUAL 0) + set(${mocGenOut} "" PARENT_SCOPE) + return() + endif() + + # Set where generated files go to and add that directory to the include path + get_code_gen_dir(${folder} mocGenDir) + + # For each input moc file + foreach(mocFile ${mocInput}) + # Get the name of the file without extension + get_filename_component(mocName ${mocFile} NAME_WE) + + # Add the generated file to mocGen variable + set(outMocFile "${mocGenDir}/moc_${mocName}.cpp") + set(mocGen ${mocGen} ${outMocFile}) + + # Add the custom command that will generate this file + # - The generated files will be put in the CMake build directory, + # not the source tree + add_custom_command(OUTPUT ${outMocFile} + COMMAND ${MOC} ${mocFile} -o ${outMocFile} + DEPENDS ${mocFile} + WORKING_DIRECTORY ${folder} + COMMENT "Generating MOC files...") + endforeach() + set(${mocGenOut} ${mocGen} PARENT_SCOPE) # Set up output variable +endfunction() + +# Generate ProtoBuf output files for an obj folder. +# - ${PROTOC} must point to the protobuf tool +function(generate_protobuf_files protoGenOut folder) + + # Finds all .proto files in the current dir + file(GLOB protoInput "${folder}/*.proto") + + # If no .proto files in this folder we are finished. + list(LENGTH protoInput numFiles) + if (${numFiles} EQUAL 0) + set(${protoGenOut} "" PARENT_SCOPE) + return() + endif() + + # Set where generated files go to and add that directory to the include path + get_code_gen_dir(${folder} protoGenDir) + + # For each input protobuf file + foreach(protoFile ${protoInput}) + # Get the name of the file without extension + get_filename_component(protoName ${protoFile} NAME_WE) + + # Add the two generated files to PROTO_GEN variable + set(protoGen ${protoGen} + ${protoGenDir}/${protoName}.pb.h + ${protoGenDir}/${protoName}.pb.cc) + + set(PROTO_HEADERS ${PROTO_HEADERS} ${protoGenDir}/${protoName}.pb.h) + endforeach() + + # Add the custom command that will generate all the files + # - The generated files will be put in the CMake build directory, not the source tree. + add_custom_command(OUTPUT ${protoGen} + COMMAND ${PROTOC} --proto_path ${folder} --cpp_out ${protoGenDir} ${protoInput} && cp ${PROTO_HEADERS} ${CMAKE_BINARY_DIR}/inc + DEPENDS ${protoInput} + WORKING_DIRECTORY ${folder} + COMMENT "Generating Protocol Buffers...") + + set(${protoGenOut} ${protoGen} PARENT_SCOPE) # Set up output variable +endfunction() diff --git a/isis/cmake/FindBoost.cmake b/isis/cmake/FindBoost.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b8c4db1228bf72c749414c8df9cd81be91f09c96 --- /dev/null +++ b/isis/cmake/FindBoost.cmake @@ -0,0 +1,138 @@ +# CMake module for find_package(Boost) +# Finds include directory and all applicable libraries +# +# Sets the following: +# BOOST_INCLUDE_DIR + +find_path(BOOST_INCLUDE_DIR + NAME flyweight.hpp + PATH_SUFFIXES "boost/boost${Boost_FIND_VERSION}/boost/" "boost" +) + +get_filename_component(BOOST_ROOT_INCLUDE_DIR "${BOOST_INCLUDE_DIR}" DIRECTORY) + +find_library(BOOST_ATOMIC_MT_LIBRARY + NAMES boost_atomic-mt boost_atomic +) + +find_library(BOOST_LOG_MT_LIBRARY + NAMES boost_log-mt boost_log +) + +find_library(BOOST_REGEX_MT_LIBRARY + NAMES boost_regex-mt boost_regex +) + +find_library(BOOST_LOG_SETUP_MT_LIBRARY + NAMES boost_log_setup-mt boost_log_setup +) + +find_library(BOOST_SERIALIZATION_MT_LIBRARY + NAMES boost_serialization-mt boost_serialization +) + +find_library(BOOST_CHRONO_MT_LIBRARY + NAMES boost_chrono-mt boost_chrono +) + +find_library(BOOST_MATH_C99_MT_LIBRARY + NAMES boost_math_c99-mt boost_math_c99 +) + +find_library(BOOST_SIGNALS_MT_LIBRARY + NAMES boost_signals-mt boost_signals +) + +find_library(BOOST_CONTAINER_MT_LIBRARY + NAMES boost_container-mt boost_container +) + +find_library(BOOST_MATH_C99F_MT_LIBRARY + NAMES boost_math_c99f-mt boost_math_c99f +) + +find_library(BOOST_CONTEXT_MT_LIBRARY + NAMES boost_context-mt boost_context +) + +find_library(BOOST_MATH_C99L_MT_LIBRARY + NAMES boost_math_c99l-mt boost_math_c99l +) + +find_library(BOOST_SYSTEM_MT_LIBRARY + NAMES boost_system-mt boost_system +) + +find_library(BOOST_COROUTINE_MT_LIBRARY + NAMES boost_coroutine-mt boost_coroutine +) + +find_library(BOOST_MATH_TR1_MT_LIBRARY + NAMES boost_math_tr1-mt boost_math_tr1 +) + +find_library(BOOST_MATH_TR1F_MT_LIBRARY + NAMES boost_math_tr1f-mt boost_math_tr1f +) + +find_library(BOOST_MATH_TR1L_MT_LIBRARY + NAMES boost_math_tr1l-mt boost_math_tr1l +) + +find_library(BOOST_TEST_EXEC_MONITOR_MT_LIBRARY + NAMES boost_test_exec_monitor-mt boost_test_exec_monitor +) + +find_library(BOOST_DATE_TIME_MT_LIBRARY + NAMES boost_date_time-mt boost_date_time +) + +find_library(BOOST_THREAD_MT_LIBRARY + NAMES boost_thread-mt boost_thread +) + +find_library(BOOST_EXCEPTION_MT_LIBRARY + NAMES boost_exception-mt boost_exception +) + +find_library(BOOST_TIMER_MT_LIBRARY + NAMES boost_timer-mt boost_timer +) + +find_library(BOOST_FILESYSTEM_MT_LIBRARY + NAMES boost_filesystem-mt boost_filesystem +) + +find_library(BOOST_PRG_EXEC_MONITOR_MT_LIBRARY + NAMES boost_prg_exec_monitor-mt boost_prg_exec_monitor +) + +find_library(BOOST_PROGRAM_OPTIONS_MT_LIBRARY + NAMES boost_program_options-mt boost_program_options +) + +find_library(BOOST_UNIT_TEST_FRAMEWORK_MT_LIBRARY + NAMES boost_unit_test_framework-mt boost_unit_test_framework +) + +find_library(BOOST_IOSTREAMS_MT_LIBRARY + NAMES boost_iostreams-mt boost_iostreams +) + +#message("BOOST_IOSTREAMS_MT_LIBRARY = ${BOOST_IOSTREAMS_MT_LIBRARY}") +#tjw: Not sure if needed...commenting out because library is missing +#find_library(BOOST_PYTHON_MT_LIBRARY +# NAMES boost_python-mt boost_python +#) + +find_library(BOOST_WAVE_MT_LIBRARY + NAMES boost_wave-mt boost_wave +) + +find_library(BOOST_RANDOM_MT_LIBRARY + NAMES boost_random-mt boost_random +) + +find_library(BOOST_WSERIALIZATION_MT_LIBRARY + NAMES boost_wserialization-mt boost_wserialization +) diff --git a/isis/cmake/FindBullet.cmake b/isis/cmake/FindBullet.cmake new file mode 100644 index 0000000000000000000000000000000000000000..efec236cd67a92bbdf65c0d92c5bfd674f8d6df5 --- /dev/null +++ b/isis/cmake/FindBullet.cmake @@ -0,0 +1,35 @@ +# CMake module for find_package(Bullet) +# Finds include directory and all applicable libraries +# +# Sets the following: +# BULLET_INCLUDE_DIR +# BULLET_LIBRARY + +find_path(BULLET_INCLUDE_DIR + NAME btBulletCollisionCommon.h + PATH_SUFFIXES bullet +) + +find_library(BULLET_OPENCL_LIBRARY NAMES Bullet3OpenCL_clew) +find_library(BULLET_SOFTBODY_LIBRARY NAMES BulletSoftBody) +find_library(BULLET_INVERSEDYNAMICS_LIBRARY NAMES BulletInverseDynamics) +find_library(BULLET_COMMON_LIBRARY NAMES Bullet3Common) +find_library(BULLET_DYNAMICS_LIBRARY NAMES BulletDynamics) +find_library(BULLET3_COLLISION_LIBRARY NAMES BulletCollision) +find_library(BULLET3_3GEOMETRY_LIBRARY NAMES Bullet3Geometry) +find_library(BULLET3_3DYNAMICS_LIBRARY NAMES Bullet3Dynamics) +find_library(BULLET3_3COLLISION_LIBRARY NAMES Bullet3Collision) +find_library(BULLET3_LINEARMATH_LIBRARY NAMES LinearMath) + +get_filename_component(BULLET_ROOT_INCLUDE_DIR "${BULLET_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "BULLET INCLUDE: " ${BULLET_INCLUDE_DIR} ) +message(STATUS "BULLET OPENCL: " ${BULLET_OPENCL_LIBRARY} ) +message(STATUS "BULLET SOFTBODY: " ${BULLET_SOFTBODY_LIBRARY}) +message(STATUS "BULLET INVERSE DYNAMICS: " ${BULLET_INVERSEDYNAMICS_LIBRARY} ) +message(STATUS "BULLET DYNAMICS: " ${BULLET3_DYNAMICS_LIBRARY} ) +message(STATUS "BULLET COLLISION: " ${BULLET3_COLLISION_LIBRARY} ) +message(STATUS "BULLET GEOMETRY: " ${BULLET3_GEOMETRY_LIBRARY} ) +message(STATUS "BULLET3 3DYNAMICS: " ${BULLET3_3DYNAMICS_LIBRARY} ) +message(STATUS "BULLET3 3COLLISION: " ${BULLET3_3COLLISION_LIBRARY} ) +message(STATUS "BULLET3 LINEARMATH: " ${BULLET3_LINEARMATH_LIBRARY} ) diff --git a/isis/cmake/FindCSPICE.cmake b/isis/cmake/FindCSPICE.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3df2e1ff87011639449528ca1c3dd69db6e550a2 --- /dev/null +++ b/isis/cmake/FindCSPICE.cmake @@ -0,0 +1,18 @@ +# CMake module for find_package(CSPICE) +# Finds include directory and all applicable libraries +# +# Sets the following: +# CSPICE_INCLUDE_DIR +# CSPICE_LIBRARY + +find_path(CSPICE_INCLUDE_DIR + NAME SpiceUsr.h + PATH_SUFFIXES naif cspice +) + +find_library(CSPICE_LIBRARY + NAMES cspice +) + +message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} ) +message(STATUS "CSPICE LIB: " ${CSPICE_LIBRARY} ) diff --git a/isis/cmake/FindCholmod.cmake b/isis/cmake/FindCholmod.cmake new file mode 100644 index 0000000000000000000000000000000000000000..61bf96609c9a05745d2069b8e83801e55384be19 --- /dev/null +++ b/isis/cmake/FindCholmod.cmake @@ -0,0 +1,39 @@ +# CMake module for find_package(Cholmod) +# Finds include directory and all applicable libraries +# +# Sets the following: +# CHOLMOD_INCLUDE_DIR +# CHOLMOD_LIBLIST + +find_path(CHOLMOD_INCLUDE_DIR + NAME cholmod.h + PATH_SUFFIXES "SuiteSparse/SuiteSparse${Cholmod_FIND_VERSION}/SuiteSparse/" "SuiteSparse" +) + +find_library(CHOLMOD_LIBRARY NAMES cholmod) +find_library(CCOLAMD_LIBRARY NAMES ccolamd) +find_library(COLAMD_LIBRARY NAMES colamd) +find_library(CAMD_LIBRARY NAMES camd) +find_library(AMD_LIBRARY NAMES amd) +find_library(SUITESPARSE_LIBRARY NAMES suitesparseconfig) +find_library(BLAS_LIBRARY NAMES blas) + +# OSX does not link against lapack +if(NOT APPLE) + find_library(LAPACK_LIBRARY NAMES lapack) +endif() + +# Dependencies for lapack +get_filename_component(CHOLMOD_ROOT_INCLUDE_DIR "${CHOLMOD_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "CHOLMOD INCLUDE: " ${CHOLMOD_INCLUDE_DIR} ) +message(STATUS "CHOLMOD LIB: " ${CHOLMOD_LIBRARY} ) +message(STATUS "CCOLMOD LIB: " ${CCOLAMD_LIBRARY} ) +message(STATUS "CAMD LIB: " ${CAMD_LIBRARY} ) +message(STATUS "AMD LIB: " ${AMD_LIBRARY} ) +message(STATUS "SUITESPARSE LIB: " ${SUITESPARSE_LIBRARY} ) +message(STATUS "BLAS LIB: " ${BLAS_LIBRARY} ) + +if(NOT APPLE) + message(STATUS "LAPACK LIB: " ${LAPACK_LIBRARY}) +endif() diff --git a/isis/cmake/FindEigen.cmake b/isis/cmake/FindEigen.cmake new file mode 100644 index 0000000000000000000000000000000000000000..154a23cd591e21f1299cc89abddeed052019539b --- /dev/null +++ b/isis/cmake/FindEigen.cmake @@ -0,0 +1,17 @@ +# CMake module for find_package(PCL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# PCL_INCLUDE_DIR + +#find_path(EIGEN_INCLUDE_DIR +# NAME Core +# PATH_SUFFIXES eigen/Eigen eigen3/Eigen +#) + +find_path(EIGEN_ROOT_INCLUDE_DIR + NAME Eigen + PATH_SUFFIXES eigen eigen3 +) + +message(STATUS "EIGEN INCLUDE DIR: " ${EIGEN_ROOT_INCLUDE_DIR} ) diff --git a/isis/cmake/FindEmbree.cmake b/isis/cmake/FindEmbree.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d7af1d78d6ebb668679ad8ea3c7a71157cb3f123 --- /dev/null +++ b/isis/cmake/FindEmbree.cmake @@ -0,0 +1,20 @@ +# CMake module for find_package(Embree) +# Finds include directory and all applicable libraries +# +# Sets the following: +# EMBREE_INCLUDE_DIR +# EMBREE_LIBRARY + +find_path(EMBREE_INCLUDE_DIR + NAME rtcore.h + PATH_SUFFIXES embree2 +) + +find_library(EMBREE_LIBRARY + NAMES embree +) + +get_filename_component(EMBREE_ROOT_INCLUDE_DIR "${EMBREE_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "EMBREE INCLUDE: " ${EMBREE_INCLUDE_DIR}) +message(STATUS "EMBREE LIB: " ${EMBREE_LIBRARY}) diff --git a/isis/cmake/FindGMM.cmake b/isis/cmake/FindGMM.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3787fa9534a6dbd9869e52383136848bc550e02d --- /dev/null +++ b/isis/cmake/FindGMM.cmake @@ -0,0 +1,14 @@ +# CMake module for find_package(GMM) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GMM_INCLUDE_DIR + +find_path(GMM_INCLUDE_DIR + NAMES gmm.h + PATH_SUFFIXES "/gmm/gmm-${GMM_FIND_VERSION}/gmm/" "gmm" +) + +get_filename_component(GMM_ROOT_INCLUDE_DIR "${GMM_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "GMM INCLUDE DIR: ${GMM_INCLUDE_DIR}") diff --git a/isis/cmake/FindGSL.cmake b/isis/cmake/FindGSL.cmake new file mode 100644 index 0000000000000000000000000000000000000000..105dad800e6f5bc253e3415c87b1745dba62c7d0 --- /dev/null +++ b/isis/cmake/FindGSL.cmake @@ -0,0 +1,25 @@ +# CMake module for find_package(GSL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GSL_INCLUDE_DIR +# GSL_LIBLIST + +find_path(GSL_INCLUDE_DIR + NAMES gsl_math.h + PATH_SUFFIXES gsl +) + +find_library(GSL_LIBRARY + NAMES gsl +) + +find_library(GSL_CBLAS_LIBRARY + NAMES gslcblas +) + +get_filename_component(GSL_ROOT_INCLUDE_DIR "${GSL_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "GSL INCLUDE DIR: ${GSL_INCLUDE_DIR}") +message(STATUS "GSL LIB: ${GSL_LIBRARY}") +message(STATUS "GSL CBLAS LIB: ${GSL_CBLAS_LIBRARY}") diff --git a/isis/cmake/FindGeoTIFF.cmake b/isis/cmake/FindGeoTIFF.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9bfbb68cacc9605611855886a1b450aee255ae30 --- /dev/null +++ b/isis/cmake/FindGeoTIFF.cmake @@ -0,0 +1,20 @@ +# CMake module for find_package(GeoTIFF) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GEOTIFF_INCLUDE_DIR +# GEOTIFF_LIBRARY + +find_path(GEOTIFF_INCLUDE_DIR + NAMES geotiff.h + PATH_SUFFIXES geotiff +) + +find_library(GEOTIFF_LIBRARY + NAMES geotiff +) + +get_filename_component(GEOTIFF_ROOT_INCLUDE_DIR "${GEOTIFF_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "GEOTIFF INCLUDE DIR: ${GEOTIFF_INCLUDE_DIR}") +message(STATUS "GEOTIFF LIB: ${GEOTIFF_LIBRARY}") diff --git a/isis/cmake/FindGeos.cmake b/isis/cmake/FindGeos.cmake new file mode 100644 index 0000000000000000000000000000000000000000..dc2df58ec29cada16fbdce15762998d30a5ce64c --- /dev/null +++ b/isis/cmake/FindGeos.cmake @@ -0,0 +1,24 @@ +# CMake module for find_package(Geos) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GEOS_INCLUDE_DIR +# GEOS_LIBRARY + +find_path(GEOS_INCLUDE_DIR + NAME geos.h + PATH_SUFFIXES "geos/geos${Geos_FIND_VERSION}" "geos" +) + +find_library(GEOS_LIBRARY + NAMES geos +) +find_library(GEOS_C_LIBRARY + NAMES geos_c +) + +message(STATUS "GEOS INCLUDE DIR: " ${GEOS_INCLUDE_DIR} ) +message(STATUS "GEOS LIB: " ${GEOS_LIBRARY} ) +message(STATUS "GEOS C LIB: " ${GEOS_C_LIBRARY} ) + +get_filename_component(GEOS_ROOT_INCLUDE_DIR "${GEOS_INCLUDE_DIR}" DIRECTORY) diff --git a/isis/cmake/FindHDF5.cmake b/isis/cmake/FindHDF5.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1ebf7edcd332b3dd4d3d2d959711fcb3c3962627 --- /dev/null +++ b/isis/cmake/FindHDF5.cmake @@ -0,0 +1,24 @@ +# CMake module for find_package(HDF5) +# Finds include directory and all applicable libraries +# +# Sets the following: +# HDF5_INCLUDE_DIR +# HDF5_LIBRARY + +find_path(HDF5_INCLUDE_DIR + NAME hdf5.h + PATH_SUFFIXES hdf5 +) + +find_library(HDF5_LIBRARY NAMES hdf5) +find_library(HDF5_CPP_LIBRARY NAMES hdf5_cpp) +find_library(HDF5_HL_LIBRARY NAMES hdf5_hl) +find_library(HDF5_HLCPP_LIBRARY NAMES hdf5_hl_cpp) + +get_filename_component(HDF5_ROOT_INCLUDE_DIR "${HDF5_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "HDF5 INCLUDE DIR: ${HDF5_INCLUDE_DIR}") +message(STATUS "HDF5 LIB: ${HDF5_LIBRARY}") +message(STATUS "HDF5 CPP LIB: ${HDF5_CPP_LIBRARY}") +message(STATUS "HDF5 HL LIB: ${HDF5_HL_LIBRARY}") +message(STATUS "HDF5 HLCPP LIB: ${HDF5_HLCPP_LIBRARY}") diff --git a/isis/cmake/FindJama.cmake b/isis/cmake/FindJama.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c547d3b27d8f6778fef5d2a65aea10c2e4c4ac06 --- /dev/null +++ b/isis/cmake/FindJama.cmake @@ -0,0 +1,14 @@ +# CMake module for find_package(Jama) +# Finds include directory and all applicable libraries +# +# Sets the following: +# JAMA_INCLUDE_DIR + +find_path(JAMA_INCLUDE_DIR + NAMES jama_cholesky.h + PATH_SUFFIXES "jama/jama${Jama_FIND_VERSION}/jama" "/jama" +) + +get_filename_component(JAMA_ROOT_INCLUDE_DIR "${JAMA_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "JAMA INCLUDE DIR: ${JAMA_INCLUDE_DIR}") diff --git a/isis/cmake/FindKakadu.cmake b/isis/cmake/FindKakadu.cmake new file mode 100644 index 0000000000000000000000000000000000000000..cb2842751228902515b9bba04c748dc79a081858 --- /dev/null +++ b/isis/cmake/FindKakadu.cmake @@ -0,0 +1,30 @@ +# CMake module for find_package(Kakadu) +# Finds include directory and all applicable libraries +# +# Sets the following: +# KAKADU_INCLUDE_DIR +# KAKADU_A_LIBRARY +# KAKADU_V_LIBRARY + +if(JP2KFLAG) + find_path(KAKADU_INCLUDE_DIR + NAME kdu_kernels.h + PATHS /usgs/apps/kakadu/v7_9_1-01762L/managed/all_includes/ + ) + + find_library(KAKADU_A_LIBRARY + NAMES kdu_a79R + ) + + find_library(KAKADU_V_LIBRARY + NAMES kdu_v79R + ) + + get_filename_component(KAKADU_ROOT_INCLUDE_DIR "${KAKADU_INCLUDE_DIR}" DIRECTORY) + + message(STATUS "KAKADU INC DIR: ${KAKADU_INCLUDE_DIR}") + message(STATUS "KAKADU A LIB: ${KAKADU_A_LIBRARY}") + message(STATUS "KAKADU V LIB: ${KAKADU_V_LIBRARY}") +else() + message(STATUS "KAKADU DISABLED") +endif() diff --git a/isis/cmake/FindLibPython.py b/isis/cmake/FindLibPython.py new file mode 100644 index 0000000000000000000000000000000000000000..38ae93fd3b3c8ad5fa58ade18a1615c4105b8a3f --- /dev/null +++ b/isis/cmake/FindLibPython.py @@ -0,0 +1,10 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS + +import sys +import distutils.sysconfig + +print("exec_prefix:%s" % sys.exec_prefix) +print("short_version:%s" % sys.version[:3]) +print("long_version:%s" % sys.version.split()[0]) +print("py_inc_dir:%s" % distutils.sysconfig.get_python_inc()) +print("site_packages_dir:%s" % distutils.sysconfig.get_python_lib(plat_specific=1)) diff --git a/isis/cmake/FindNN.cmake b/isis/cmake/FindNN.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fa2b59627865e2bb9974ed9dae25b1c4de97c135 --- /dev/null +++ b/isis/cmake/FindNN.cmake @@ -0,0 +1,19 @@ +# CMake module for find_package(TNT) +# Finds include directory and all applicable libraries +# +# Sets the following: +# TNT_INCLUDE_DIR + +find_path(NN_INCLUDE_DIR + NAMES nn.h + PATH_SUFFIXES nn +) + +find_library(NN_LIBRARY + NAMES nn +) + +get_filename_component(NN_ROOT_INCLUDE_DIR "${NN_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "NN INCLUDE DIR: ${NN_INCLUDE_DIR}") +message(STATUS "NN LIB: ${NN_LIBRARY}") diff --git a/isis/cmake/FindOpenCV.cmake b/isis/cmake/FindOpenCV.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0450572ef0795f270da6eaac9e1ac84ee5e94e3a --- /dev/null +++ b/isis/cmake/FindOpenCV.cmake @@ -0,0 +1,44 @@ +# CMake module for find_package(OpenCV) +# Finds include directory and all applicable libraries +# +# Sets the following: +# OPENCV_INCLUDE_DIR +# OPENCV_LIBLSIT + +find_path(OPENCV_INCLUDE_DIR + NAMES cv.h + PATH_SUFFIXES opencv +) + +find_library(OPENCV_CORE_LIBRARY NAMES opencv_core) +find_library(OPENCV_VIDEOSTAB_LIBRARY NAMES opencv_videostab) +find_library(OPENCV_VIDEO_LIBRARY NAMES opencv_video) +find_library(OPENCV_SUPERRES_LIBRARY NAMES opencv_superres) +find_library(OPENCV_STITCHING_LIBRARY NAMES opencv_stitching) +find_library(OPENCV_PHOTO_LIBRARY NAMES opencv_photo) +find_library(OPENCV_OBJDETECT_LIBRARY NAMES opencv_objdetect) +find_library(OPENCV_ML_LIBRARY NAMES opencv_ml) +find_library(OPENCV_IMGCODECS_LIBRARY NAMES opencv_imgcodecs) +find_library(OPENCV_IMGPROC_LIBRARY NAMES opencv_imgproc) +find_library(OPENCV_CALIB3D_LIBRARY NAMES opencv_calib3d) +find_library(OPENCV_FEATURES2D_LIBRARY NAMES opencv_features2d) +find_library(OPENCV_XFEATURES2D_LIBRARY NAMES opencv_xfeatures2d) +find_library(OPENCV_HIGHGUI_LIBRARY NAMES opencv_highgui) +find_library(OPENCV_FLANN_LIBRARY NAMES opencv_flann) + +get_filename_component(OPENCV_ROOT_INCLUDE_DIR "${OPENCV_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "OPENCV INCLUDE DIR: ${OPENCV_INCLUDE_DIR}") +message(STATUS "OPENCV CORE LIB: ${OPENCV_CORE_LIBRARY}") +message(STATUS "OPENCV VIDEOSTAB LIB: ${OPENCV_VIDEOSTAB_LIBRARY}") +message(STATUS "OPENCV SUPERRES LIB: ${OPENCV_SUPERRES_LIBRARY}") +message(STATUS "OPENCV STITCHING LIB: ${OPENCV_STITCHING_LIBRARY}") +message(STATUS "OPENCV PHOTO LIB: ${OPENCV_PHOTO_LIBRARY}") +message(STATUS "OPENCV OBJDETECT LIB: ${OPENCV_OBJDETECT_LIBRARY}") +message(STATUS "OPENCV IMGCODECS LIB: ${OPENCV_IMGCODECS_LIBRARY}") +message(STATUS "OPENCV IMGPROC LIB: ${OPENCV_IMGPROC_LIBRARY}") +message(STATUS "OPENCV CALIB3D LIB: ${OPENCV_CALIB3D_LIBRARY}") +message(STATUS "OPENCV FEATURES2D LIB: ${OPENCV_FEATURES2D_LIBRARY}") +message(STATUS "OPENCV xFEATURES2D LIB: ${OPENCV_XFEATURES2D_LIBRARY}") +message(STATUS "OPENCV HIGHGUI LIB: ${OPENCV_HIGHGUI_LIBRARY}") +message(STATUS "OPENCV FLANN LIB: ${OPENCV_FLANN_LIBRARY}") diff --git a/isis/cmake/FindPCL.cmake b/isis/cmake/FindPCL.cmake new file mode 100644 index 0000000000000000000000000000000000000000..902b5b6b1cfeb377f774a2d5ee96bc043f37a833 --- /dev/null +++ b/isis/cmake/FindPCL.cmake @@ -0,0 +1,27 @@ +# CMake module for find_package(PCL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# PCL_INCLUDE_DIR +# PCL_LIBRARY + +find_path(PCL_ROOT_INCLUDE_DIR + NAME pcl + PATH_SUFFIXES "pcl-${PCL_FIND_VERSION}" +) + +find_path(PCL_INCLUDE_DIR + NAME pcl_base.h + PATH_SUFFIXES "pcl-${PCL_FIND_VERSION}/pcl" +) + +find_library(PCL_COMMON_LIBRARY NAMES pcl_common) +find_library(PCL_OCTREE_LIBRARY NAMES pcl_octree) +find_library(PCL_IO_LIBRARY NAMES pcl_io) + +get_filename_component(PCL_ROOT_INCLUDE_DIR "${PCL_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "PCL INCLUDE DIR: ${PCL_INCLUDE_DIR}") +message(STATUS "PCL COMMON LIB: ${PCL_COMMON_LIBRARY}") +message(STATUS "PCL OCTREE LIB: ${PCL_OCTREE_LIBRARY}") +message(STATUS "PCL IO LIB: ${PCL_IO_LIBRARY}") diff --git a/isis/cmake/FindPNG.cmake b/isis/cmake/FindPNG.cmake new file mode 100644 index 0000000000000000000000000000000000000000..6c2439f113c82f0228781a974ae02850f4111553 --- /dev/null +++ b/isis/cmake/FindPNG.cmake @@ -0,0 +1,17 @@ +# Finds include directory and all applicable libraries +# +# Sets the following: +# PNG_INCLUDE_DIR +# PNG_LIBRARY + +find_path(PNG_INCLUDE_DIR + NAMES png.h + PATH_SUFFIXES png +) + +find_library(PNG_LIBRARY + NAMES png +) + +message(STATUS "PNG INCLUDE DIR: ${PNG_INCLUDE_DIR}") +message(STATUS "PNG LIB: ${PNG_LIBRARY}") diff --git a/isis/cmake/FindProtobuf.cmake b/isis/cmake/FindProtobuf.cmake new file mode 100644 index 0000000000000000000000000000000000000000..74db9e434262e517759a454d4dcc1e4ec1ca616b --- /dev/null +++ b/isis/cmake/FindProtobuf.cmake @@ -0,0 +1,11 @@ +find_path(PROTOBUF_INCLUDE_DIR + NAMES google/ + PATH_SUFFIXES "google-protobuf/protobuf${Protobuf_FIND_VERSION}/" +) + +find_library(PROTOBUF_LIBRARY NAMES protobuf) + +get_filename_component(PROTOBUF_ROOT_INCLUDE_DIR "${PROTOBUF_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "PROTOBUF INCLUDE DIR: ${PROTOBUF_INCLUDE_DIR}") +message(STATUS "PROTOBUF LIB: ${PROTOBUF_LIBRARY}") diff --git a/isis/cmake/FindPython.cmake b/isis/cmake/FindPython.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5f5a64a98ddfd2a640dd3581cbcd917fddb5cf6d --- /dev/null +++ b/isis/cmake/FindPython.cmake @@ -0,0 +1,108 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS +# +# PYTHON_EXECUTABLE - The path and filename of the Python interpreter. +# +# PYTHON_SHORT_VERSION - The version of the Python interpreter found, +# excluding the patch version number. (e.g. 2.5 and not 2.5.1)) +# +# PYTHON_LONG_VERSION - The version of the Python interpreter found as a human +# readable string. +# +# PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory. +# +# PYTHON_INCLUDE_PATH - Directory holding the python.h include file. +# +# PYTHON_LIBRARY, PYTHON_LIBRARIES- Location of the Python library. + +INCLUDE(CMakeFindFrameworks) + +if(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "${PYTHON_SITE_PACKAGES_DIR}") + # Already in cache, be silent + set(PYTHONLIBRARY_FOUND TRUE) +else(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "${PYTHON_SITE_PACKAGES_DIR}") + + FIND_PACKAGE(PythonInterp 3) + + if(PYTHONINTERP_FOUND) + FIND_FILE(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_lib_python_py} OUTPUT_VARIABLE python_config) + if(python_config) + STRING(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config}) + STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) + STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config}) + STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH ${python_config}) + if(NOT PYTHON_SITE_PACKAGES_DIR) + if(NOT PYTHON_LIBS_WITH_KDE_LIBS) + STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" PYTHON_SITE_PACKAGES_DIR ${python_config}) + else(NOT PYTHON_LIBS_WITH_KDE_LIBS) + set(PYTHON_SITE_PACKAGES_DIR ${KDE4_LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages) + endif(NOT PYTHON_LIBS_WITH_KDE_LIBS) + endif(NOT PYTHON_SITE_PACKAGES_DIR) + STRING(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) + set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT} python${PYTHON_SHORT_VERSION}m python${PYTHON_SHORT_VERSION_NO_DOT}m) + if(WIN32) + STRING(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR}) + FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs) + endif(WIN32) + FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES}) + set(PYTHON_INCLUDE_PATH ${PYTHON_INCLUDE_PATH} CACHE FILEPATH "Directory holding the python.h include file" FORCE) + set(PYTHONLIBRARY_FOUND TRUE) + endif(python_config) + + # adapted from cmake's builtin FindPythonLibs + if(APPLE) + # If a framework has been detected in the include path, make sure + # framework's versioned library (not any .dylib) is used for linking + # NOTE: don't rely upon Python.framework/Versions/Current, since that may be 2.7 + if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") + set(PYTHON_LIBRARY "") + set(PYTHON_DEBUG_LIBRARY "") + # get clean path to just framework + STRING(REGEX REPLACE "^(.*/Python\\.framework).*$" "\\1" _py_fw "${PYTHON_INCLUDE_PATH}") + if("${_py_fw}" MATCHES "Cellar/python") + # Appears to be a Homebrew Python install; do specific fix ups + # get Homebrew prefix (may not be /usr/local) + STRING(REGEX REPLACE "^(.+)/Cellar.*$" "\\1" _hb_prefix "${_py_fw}") + # prefer the Homebrew prefix framework over only versioned Python keg + set(_py_fw "${_hb_prefix}/Frameworks/Python.framework") + # prefer the symlinked-to Homebrew site-packages over only versioned Python keg + set(PYTHON_SITE_PACKAGES_DIR "${_hb_prefix}/lib/python${PYTHON_SHORT_VERSION}/site-packages") + endif("${_py_fw}" MATCHES "Cellar/python") + # prefer the Headers subdirectory for includes + if(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Headers") + set(PYTHON_INCLUDE_PATH "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Headers" CACHE FILEPATH "Directory holding the python.h include file" FORCE) + endif(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Headers") + endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") + if(NOT PYTHON_LIBRARY) + # ensure the versioned framework's library is defined, instead of relying upon -F search paths + if(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Python") + set(PYTHON_LIBRARY "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Python" CACHE FILEPATH "Python framework library" FORCE) + endif(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Python") + endif(NOT PYTHON_LIBRARY) + if(PYTHON_LIBRARY) + set(PYTHONLIBRARY_FOUND TRUE) + endif(PYTHON_LIBRARY) + endif(APPLE) + endif(PYTHONINTERP_FOUND) + + if(PYTHONLIBRARY_FOUND) + if(APPLE) + # keep reference to system or custom python site-packages + # useful during app-bundling operations + set(PYTHON_SITE_PACKAGES_SYS ${PYTHON_SITE_PACKAGES_DIR}) + endif(APPLE) + set(PYTHON_LIBRARIES ${PYTHON_LIBRARY}) + if(NOT PYTHONLIBRARY_FIND_QUIETLY) + message(STATUS "Found Python executable: ${PYTHON_EXECUTABLE}") + message(STATUS "Found Python version: ${PYTHON_LONG_VERSION}") + message(STATUS "Found Python library: ${PYTHON_LIBRARY}") + message(STATUS "Found Python site-packages: ${PYTHON_SITE_PACKAGES_DIR}") + endif(NOT PYTHONLIBRARY_FIND_QUIETLY) + else(PYTHONLIBRARY_FOUND) + if(PYTHONLIBRARY_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Python") + endif(PYTHONLIBRARY_FIND_REQUIRED) + endif(PYTHONLIBRARY_FOUND) + +endif (EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "${PYTHON_SITE_PACKAGES_DIR}") diff --git a/isis/cmake/FindQwt.cmake b/isis/cmake/FindQwt.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8262a57b6928bf83be08969138cf2e30b1be13e4 --- /dev/null +++ b/isis/cmake/FindQwt.cmake @@ -0,0 +1,20 @@ +# CMake module for find_package(Qwt) +# Finds include directory and all applicable libraries +# +# Sets the following: +# QWT_INCLUDE_DIR +# QWT_LIBRARY + +FIND_PATH(QWT_INCLUDE_DIR + NAMES qwt.h + PATH_SUFFIXES "qwt-qt5" "qwt" "qwt6" "qwt${Qwt_FIND_VERSION}" +) + +find_library(QWT_LIBRARY + NAMES qwt +) + +get_filename_component(QWT_ROOT_INCLUDE_DIR "${QWT_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "QWT INCLUDE LIB: ${QWT_INCLUDE_DIR}") +message(STATUS "QWT LIB: ${QWT_LIBRARY}") diff --git a/isis/cmake/FindSip.cmake b/isis/cmake/FindSip.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8ede37c8d7bc7d514e664f475be47d1ce9129b3c --- /dev/null +++ b/isis/cmake/FindSip.cmake @@ -0,0 +1,44 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS +# +# SIP_VERSION - The version of SIP found expressed as a 6 digit hex number +# suitable for comparison as a string. +# +# SIP_VERSION_STR - The version of SIP found as a human readable string. +# +# SIP_BINARY_PATH - Path and filename of the SIP command line executable. +# +# SIP_INCLUDE_DIR - Directory holding the SIP C++ header file. +# +# SIP_DEFAULT_SIP_DIR - Default directory where .sip files should be installed +# into. + +IF(SIP_VERSION) + # Already in cache, be silent + SET(SIP_FOUND TRUE) +ELSE(SIP_VERSION) + + FIND_FILE(_find_sip_py FindSip.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config) + IF(sip_config) + STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_version_num:([^\n]+).*$" "\\1" SIP_VERSION_NUM ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_BINARY_PATH ${sip_config}) + STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_mod_dir:([^\n]+).*$" "\\1" SIP_MOD_DIR ${sip_config}) + SET(SIP_FOUND TRUE) + ENDIF(sip_config) + + IF(SIP_FOUND) + IF(NOT SIP_FIND_QUIETLY) + MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}") + ENDIF(NOT SIP_FIND_QUIETLY) + ELSE(SIP_FOUND) + IF(SIP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find SIP") + ENDIF(SIP_FIND_REQUIRED) + ENDIF(SIP_FOUND) + +ENDIF(SIP_VERSION) diff --git a/isis/cmake/FindSip.py b/isis/cmake/FindSip.py new file mode 100644 index 0000000000000000000000000000000000000000..8cbb00fa5caa49ba7b30156ad3a2278d158060b7 --- /dev/null +++ b/isis/cmake/FindSip.py @@ -0,0 +1,13 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS + + +import sipconfig + +sipcfg = sipconfig.Configuration() +print("sip_version:%06.0x" % sipcfg.sip_version) +print("sip_version_num:%d" % sipcfg.sip_version) +print("sip_version_str:%s" % sipcfg.sip_version_str) +print("sip_bin:%s" % sipcfg.sip_bin) +print("default_sip_dir:%s" % sipcfg.default_sip_dir) +print("sip_inc_dir:%s" % sipcfg.sip_inc_dir) +print("sip_mod_dir:%s" % sipcfg.sip_mod_dir) diff --git a/isis/cmake/FindSuperLU.cmake b/isis/cmake/FindSuperLU.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2c588bd138b2a0e87fe2a680ad41a1046ae9121c --- /dev/null +++ b/isis/cmake/FindSuperLU.cmake @@ -0,0 +1,21 @@ +# CMake module for find_package(SuperLU) +# Finds include directory and all applicable libraries +# +# Sets the following: +# SUPERLU_INCLUDE_DIR +# SUPERLU_LIBRARY + +find_path(SUPERLU_INCLUDE_DIR + NAME supermatrix.h + PATH_SUFFIXES "superlu/superlu${SuperLU_FIND_VERSION}/superlu/" "superlu" +) + +find_library(SUPERLU_LIBRARY + NAMES "superlu_${SuperLU_FIND_VERSION}" "superlu" +) + +get_filename_component(SUPERLU_ROOT_INCLUDE_DIR "${SUPERLU_INCLUDE_DIR}" DIRECTORY) + + +message(STATUS "SUPERLU INCLUDE DIR: ${SUPERLU_INCLUDE_DIR}") +message(STATUS "SUPERLU LIB: ${SUPERLU_LIBRARY}") diff --git a/isis/cmake/FindTIFF.cmake b/isis/cmake/FindTIFF.cmake new file mode 100644 index 0000000000000000000000000000000000000000..f483f587789ef811e2183f39ba7c4f69492018de --- /dev/null +++ b/isis/cmake/FindTIFF.cmake @@ -0,0 +1,9 @@ +find_path(TIFF_INCLUDE_DIR + NAMES tiff.h + PATH_SUFFIXES "tiff/tiff-${TIFF_FIND_VERSION}" +) + +find_library(TIFF_LIBRARY NAMES tiff) + +message(STATUS "TIFF INCLUDE DIR: ${TIFF_INCLUDE_DIR}") +message(STATUS "TIFF LIB: ${TIFF_LIBRARY}") diff --git a/isis/cmake/FindTNT.cmake b/isis/cmake/FindTNT.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0bbfb154c0b590ea8cf5a4c1d212cdd3b8717a2c --- /dev/null +++ b/isis/cmake/FindTNT.cmake @@ -0,0 +1,14 @@ +# CMake module for find_package(TNT) +# Finds include directory and all applicable libraries +# +# Sets the following: +# TNT_INCLUDE_DIR + +find_path(TNT_INCLUDE_DIR + NAMES tnt.h + PATH_SUFFIXES "tnt/tnt${TNT_FIND_VERSION}/tnt" "tnt/" +) + +get_filename_component(TNT_ROOT_INCLUDE_DIR "${TNT_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "TNT INCLUDE DIR: ${TNT_INCLUDE_DIR}" ) diff --git a/isis/cmake/FindX11.cmake b/isis/cmake/FindX11.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fe25ac13150d49500487b695465118a7861e00e2 --- /dev/null +++ b/isis/cmake/FindX11.cmake @@ -0,0 +1,11 @@ +# CMake module for find_package(X11) +# Finds include directory and all applicable libraries +# +# Sets the following: +# X11_LIBRARY + +find_library(X11_LIBRARY + NAMES X11 +) + +message(STATUS "X11 LIB: " ${X11_LIBRARY} ) diff --git a/isis/cmake/FindXercesC.cmake b/isis/cmake/FindXercesC.cmake new file mode 100644 index 0000000000000000000000000000000000000000..335dca4fdab6cbe2be448d9c10139b9f9be9c2b7 --- /dev/null +++ b/isis/cmake/FindXercesC.cmake @@ -0,0 +1,10 @@ +find_path(XERCESC_INCLUDE_DIR + NAMES xercesc/ + PATH_SUFFIXES "xercesc/xercesc-${XercesC_FIND_VERSION}/" +) +# message("XERCESC_INCLUDE_DIR = ${XERCESC_INCLUDE_DIR}") + +find_library(XercesC_LIBRARY NAMES xerces-c) + +message(STATUS "XERCES LIB: " ${XercesC_LIBRARY} ) +message(STATUS "XERCES INCLUDE DIR: " ${XERCESC_INCLUDE_DIR} ) diff --git a/isis/cmake/Findnanoflann.cmake b/isis/cmake/Findnanoflann.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3c05e57013bca3b9b926844e4850f1e423846b73 --- /dev/null +++ b/isis/cmake/Findnanoflann.cmake @@ -0,0 +1,15 @@ +# CMake module for find_package(GSL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GSL_INCLUDE_DIR +# GSL_LIBLIST + +find_path(NANOFLANN_INCLUDE_DIR + NAMES nanoflann.hpp + PATH_SUFFIXES nanoflann/ +) + +get_filename_component(NANOFLANN_ROOT_INCLUDE_DIR "${NANOFLANN_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "NANOFLANN INCLUDE DIR: ${NANOFLANN_INCLUDE_DIR}") diff --git a/isis/cmake/InstallThirdParty.cmake b/isis/cmake/InstallThirdParty.cmake new file mode 100644 index 0000000000000000000000000000000000000000..209b3610a631b4630f08b2cdfc41dc5d442c1063 --- /dev/null +++ b/isis/cmake/InstallThirdParty.cmake @@ -0,0 +1,75 @@ +#=========================================================================== +# Code for installing the third part libraries to the output folder. +#=========================================================================== + +# Library portion of the installation +function(install_third_party_libs) + + # Where all the library files will go + set(installLibFolder "${CMAKE_INSTALL_PREFIX}/3rdParty/lib") + execute_process(COMMAND mkdir -p ${installLibFolder}) + + # Loop through all the library files in our list + foreach(library ${ALLLIBS}) + if (EXISTS ${library}) + #get path to library in libararypath + get_filename_component(librarypath ${library} PATH) + + # Copy file to output directory + file(RELATIVE_PATH relPath "${thirdPartyDir}/lib" ${library}) + + # Check if the file is a symlink + #execute_process(COMMAND readlink ${library} OUTPUT_VARIABLE link) + message(STATUS "${library}") + execute_process(COMMAND cp -L ${library} ${installLibFolder}) + endif() + endforeach() +endfunction() + +# Plugin portion of the installation +function(install_third_party_plugins) + + # Where all the plugin files will go + set(installPluginFolder "${CMAKE_INSTALL_PREFIX}/3rdParty/plugins") + + # Copy all of the plugin files + foreach(plugin ${THIRDPARTYPLUGINS}) + file(RELATIVE_PATH relPath "${PLUGIN_DIR}" ${plugin}) + get_filename_component(relPath ${relPath} DIRECTORY) # Strip filename + install(PROGRAMS ${plugin} DESTINATION ${installPluginFolder}/${relPath}) + endforeach() + +endfunction() + +# License portion of the installation +function(install_third_party_license) + # Specify top level directories + if(APPLE) + set(LIC_DIR "/opt/usgs/v007/3rdParty/license") + else() + set(LIC_DIR "/usgs/pkgs/local/v007/license") + endif() + if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/3rdParty) + install(CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/3rdParty/)") + endif() + install(CODE "execute_process(COMMAND cp -r ${LIC_DIR} ${CMAKE_INSTALL_PREFIX}/3rdParty/license)") +endfunction() + + +# Install all third party libraries and plugins +function(install_third_party) + + # The files are available pre-build but are not copied until make-install is called. + message("Setting up 3rd party lib installation...") + install_third_party_libs() + + message("Setting up 3rd party plugin installation...") + install_third_party_plugins() + + message("Obtaining licenses...") + install_third_party_license() + + # Finish miscellaneous file installation + file(WRITE "${CMAKE_INSTALL_PREFIX}/3rdParty/lib/README" "This directory contains O/S and hardware specific shared libraries needed\nto execute ISIS applications") + +endfunction() diff --git a/isis/cmake/MacPlistMacros.cmake b/isis/cmake/MacPlistMacros.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b12387277131a6a243f405a80e4706d63c12633b --- /dev/null +++ b/isis/cmake/MacPlistMacros.cmake @@ -0,0 +1,12 @@ +# Mac Plist Macros + +FUNCTION (GET_VERSION_PLIST PLISTFILE OUTVAR) + SET (PVERSION "") + IF (EXISTS ${PLISTFILE}) + FILE (READ "${PLISTFILE}" info_plist) + STRING (REGEX REPLACE "\n" "" info_plist "${info_plist}") + STRING (REGEX MATCH "CFBundleShortVersionString[ \t]*([0-9\\.]*)" PLISTVERSION "${info_plist}") + STRING (REGEX REPLACE "CFBundleShortVersionString[ \t]*([0-9\\.]*)" "\\1" PVERSION "${PLISTVERSION}") + ENDIF (EXISTS ${PLISTFILE}) + SET (${OUTVAR} ${PVERSION} PARENT_SCOPE) +ENDFUNCTION (GET_VERSION_PLIST) diff --git a/isis/cmake/Makefile b/isis/cmake/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..0e95c7b314bbe8bcfba1cc032ca73d84e4d9103d --- /dev/null +++ b/isis/cmake/Makefile @@ -0,0 +1,196 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.9 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /scratch/isiscmake/isis + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /scratch/isiscmake/isis + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /usr/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test + +# Special rule for the target test +test/fast: test + +.PHONY : test/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# The main all target +all: cmake_check_build_system + cd /scratch/isiscmake/isis && $(CMAKE_COMMAND) -E cmake_progress_start /scratch/isiscmake/isis/CMakeFiles /scratch/isiscmake/isis/cmake/CMakeFiles/progress.marks + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/all + $(CMAKE_COMMAND) -E cmake_progress_start /scratch/isiscmake/isis/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /scratch/isiscmake/isis && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/strip" + @echo "... install/local" + @echo "... test" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... install" + @echo "... list_install_components" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /scratch/isiscmake/isis && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/isis/cmake/RunMakeFileTest.cmake b/isis/cmake/RunMakeFileTest.cmake new file mode 100644 index 0000000000000000000000000000000000000000..242a9dc1ca6c464cb6721fe256a43dec47624479 --- /dev/null +++ b/isis/cmake/RunMakeFileTest.cmake @@ -0,0 +1,80 @@ +#============================================================================ +# Script to read in a MakeFile based test and run it without relying on any +# of the old Makefile infrastructure. +#============================================================================ + +cmake_minimum_required(VERSION 3.3) +list(APPEND CMAKE_MODULE_PATH "${CODE_ROOT}/cmake") +list(APPEND CMAKE_PREFIX_PATH "${CODE_ROOT}/cmake") +include(Utilities) + + +# Function to run the test and check the results +function(run_app_makefile_test makefile inputFolder outputFolder truthFolder binFolder) + + # Build the test name + get_filename_component(sourceFolder ${makefile} DIRECTORY) +# get_filename_component(testName ${sourceFolder} NAME) +# get_filename_component(folder ${sourceFolder} DIRECTORY) +# get_filename_component(folder ${folder} DIRECTORY) +# get_filename_component(appName ${folder} NAME) + set(appName ${appName}_${testName}) + + # Check if there are copies of the input/truth folders in the source folder, + # if so use those instead of the original location. + if(EXISTS ${sourceFolder}/input) + set(inputFolder ${sourceFolder}/input) + endif() + if(EXISTS ${sourceFolder}/truth) + set(truthFolder ${sourceFolder}/truth) + endif() + +# # Read in the MakeFile +# if(NOT EXISTS ${makefile}) +# message(FATAL_ERROR "App test MakeFile ${makefile} was not found!") +# endif() +# file(READ ${makefile} makefileContents) +# # Replace include line with a short list of definitions +# set(newDefinitions "INPUT=${inputFolder}\nOUTPUT=${outputFolder}\nRM=rm -f\nCP=cp\nLS=ls\nMV=mv\nSED=sed\nTAIL=tail\nECHO=echo\nCAT=cat\nLS=ls") +# string(REPLACE "include ${CODE_ROOT}/make/isismake.tsts" "${newDefinitions}" newFileContents "${makefileContents}") +# +# # Set required environment variables +# set(ENV{PATH} "${binFolder}:$ENV{PATH}") +# +# # Select the log file +# set(logFile "${binFolder}/${appName}.output") +# message("logFile = ${logFile}") +# +# # Execute the Makefile we just generated +# set(code "") +# execute_process(COMMAND rm -rf ${outputFolder}) +# execute_process(COMMAND rm -f ${logFile}) + message("SOURCE FOLDER ${sourceFolder}") + execute_process(COMMAND make test WORKING_DIRECTORY ${sourceFolder} OUTPUT_VARIABLE result) + message("result: ${result}") + if (result MATCHES "OK") + set(failed "OFF") + else() + set(failed "ON") + endif() + + + # If any file failed, the test is a failure. + if(${failed}) + message("TRUTH: ${TRUTH}") + message(FATAL_ERROR "Test failed. Result:\n ${result}") + endif() + +endfunction() + + + + +#=================================================================================== +# This is the main script that gets run during the test. +# - Just redirect to the main function call. + +# Needed for IsisPreferences and other test data to be found +set(ENV{ISIS3DATA} "${DATA_ROOT}") + +run_app_makefile_test(${MAKEFILE} ${INPUT_DIR} ${OUTPUT_DIR} ${TRUTH_DIR} ${BIN_DIR}) diff --git a/isis/cmake/RunUnitTest.cmake b/isis/cmake/RunUnitTest.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c64d10584496fbbff918378172346a4cf8a31977 --- /dev/null +++ b/isis/cmake/RunUnitTest.cmake @@ -0,0 +1,77 @@ +#========================================================================= +# Script to run a basic unit test and compare the result to a truth file. +# - This replaces the ISIS UnitTester script. +#========================================================================= + +# Multiple ISIS files need to find things relative to ISISROOT +# and ISIS3DATA so make sure those are set. +set(ENV{ISIS3DATA} "${DATA_ROOT}") + +message(STATUS "ISISROOT = $ENV{ISISROOT}") +message(STATUS "ISIS3DATA = $ENV{ISIS3DATA}") + +# Set up a file for program output +set(outputFile "${TEST_PROG}.output") +message("outputFile = ${outputFile}") +file(REMOVE ${outputFile}) # Make sure no old file exists + +# The test programs need to be run from their source folders +# so that they can find input data files. +get_filename_component(truthFolder ${TRUTH_FILE} DIRECTORY) + +# Test programs also need to be run with the EXACT name "unitTest", +# otherwise a GUI will pop up and ruin the test. +get_filename_component(binFolder ${TEST_PROG} DIRECTORY) +get_filename_component(binName ${TEST_PROG} NAME) +set(tempDir ${binFolder}/${binName}_temp) +execute_process(COMMAND rm -rf ${tempDir}) +execute_process(COMMAND mkdir -p ${tempDir}) +execute_process(COMMAND ln -s ${TEST_PROG} ${truthFolder}/unitTest) + +# Run the unit test executable and pipe the output to a text file. +execute_process(COMMAND ./unitTest + WORKING_DIRECTORY ${truthFolder} + OUTPUT_FILE ${outputFile} + ERROR_FILE ${outputFile} + OUTPUT_VARIABLE result + RESULT_VARIABLE code) +if(result) + message("Test failed: ${result}, ${code}") +endif() + +# If an exclusion file is present, use it to filter out selected lines. +# - Do this by comparing filtered versions of the two files, then +# running the diff on those two temporary files. +set(comp1 ${outputFile}) +set(comp2 ${TRUTH_FILE}) +set(exclusionPath ${truthFolder}/unitTest.exclude) +if(EXISTS ${exclusionPath}) + set(comp1 ${tempDir}/output_exclude.txt) + set(comp2 ${tempDir}/truth_exclude.txt) + # This throws out all lines containing a word from the exclusion file. + execute_process(COMMAND cat ${outputFile} COMMAND grep -v -f ${exclusionPath} + OUTPUT_FILE "${comp1}") + execute_process(COMMAND cat ${TRUTH_FILE} COMMAND grep -v -f ${exclusionPath} + OUTPUT_FILE "${comp2}") + +endif() + +# Verify that the files are exactly the same +execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files + ${comp1} ${comp2} + RESULT_VARIABLE DIFFERENT) + +if(DIFFERENT) + message("------------------ DIFFERENCES ------------------ ") + execute_process(COMMAND diff ${comp1} ${comp2} OUTPUT_VARIABLE compdiff) + message("${compdiff}") + message("------------------------------------------------- ") + message(FATAL_ERROR "Test failed - files differ") + # On error the result file is left around to aid in debugging. +else() + file(REMOVE ${outputFile}) # On success, clean out the result file. + execute_process(COMMAND rm -rf ${tempdir}) +endif() + +# Clean up our temporary folder +execute_process(COMMAND rm -f ${truthFolder}/unitTest) diff --git a/isis/cmake/TestSetup.cmake b/isis/cmake/TestSetup.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c3c3e202b1c8d568eb8220c989cca8e3dd38484e --- /dev/null +++ b/isis/cmake/TestSetup.cmake @@ -0,0 +1,83 @@ +#============================================================ +# This file contains functions to help set tests. +#============================================================ + + +# Generate a test from a folder containing a Makefile and specific sub folders. +# - These are used for application and module tests. +function(add_makefile_test_folder folder prefix_name) + + # For convenience, quietly ignore Makefiles that get passed in instead of folders. + get_filename_component(subName ${folder} NAME) + if("${subName}" STREQUAL "Makefile") + return() + endif() + + # Figure out the input, output, and truth paths + file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${folder}) + set(dataDir $ENV{ISIS3TESTDATA}/isis/${relPath}) + set(inputDir ${dataDir}/input) + set(truthDir ${dataDir}/truth) + set(makeFile ${folder}/Makefile) + + # TODO: Improve variable name (from top level file) + # The output folder may be in a different directory + + set(outputDir ${testOutputDir}/${relPath}/output) + + # Define the name CTest will use to refer to this test. + set(testName ${prefix_name}_test_${subName}) + + ## Some tests don't need an input folder but the others must exist + #if(NOT EXISTS ${makeFile}) + # message(FATAL_ERROR "Required file does not exist: ${makeFile}") + #endif() + #if(NOT EXISTS ${truthDir}) + # message(FATAL_ERROR "Required data folder does not exist: ${truthDir}") + #endif() + + # Call lower level function to finish adding the test. + add_makefile_test_target(${testName} ${makeFile} ${inputDir} ${outputDir} ${truthDir}) +endfunction() + + +# Add a Makefile based test to the CMake test list. +macro(add_makefile_test_target testName makeFile inputDir outputDir truthDir) + + set(thisFolder "${PROJECT_SOURCE_DIR}/cmake") + # Set up a cmake script which will execute the command in the makefile + # and then check the results against the truth folder. + add_test(NAME ${testName} + COMMAND ${CMAKE_COMMAND} + -DMAKEFILE=${makeFile} + -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} + -DCODE_ROOT=${PROJECT_SOURCE_DIR} + -DDATA_ROOT=$ENV{ISIS3DATA} + -DINPUT_DIR=${inputDir} + -DOUTPUT_DIR=${outputDir} + -DTRUTH_DIR=${truthDir} + -DBIN_DIR=${CMAKE_BINARY_DIR}/bin + -P ${thisFolder}/RunMakeFileTest.cmake) + set_tests_properties(${testName} PROPERTIES LABELS "app") + +endmacro() + + +# Add a class based unit test with an executable and a truth file. +macro(add_unit_test_target testFile truthFile labels) + + set(thisFolder "${PROJECT_SOURCE_DIR}/cmake") + set(fullTestPath "${CMAKE_BINARY_DIR}/unitTest/${testFile}") # The binary that the script will execute + + # Set up a cmake script which will run the executable + # and then check the results against the truth file. + set(testName ${testFile}) + add_test(NAME ${testName} + COMMAND ${CMAKE_COMMAND} + -DTEST_PROG=${fullTestPath} + -DTRUTH_FILE=${truthFile} + -DDATA_ROOT=$ENV{ISIS3DATA} + -DCODE_ROOT=${PROJECT_SOURCE_DIR} + -P ${thisFolder}/RunUnitTest.cmake) + set_tests_properties(${testName} PROPERTIES LABELS "unit;${labels}") +endmacro() diff --git a/isis/cmake/Utilities.cmake b/isis/cmake/Utilities.cmake new file mode 100644 index 0000000000000000000000000000000000000000..513668a6304e22833bea29f62831fd6c6741767d --- /dev/null +++ b/isis/cmake/Utilities.cmake @@ -0,0 +1,315 @@ +#================================================================================== +# This file contains small utility functions +#================================================================================== + +# Copy one file +function(copy_file src dest) + configure_file(${src} ${dest} COPYONLY) +endfunction() + +# Copy one folder +function(copy_folder src dest) + execute_process(COMMAND cp -r ${src} ${dest}) +endfunction() + +# Copy all files matching a wildcard to the output folder. +function(copy_wildcard wildcard outputFolder) + file(GLOB files ${wildcard}) + file(COPY ${files} DESTINATION ${outputFolder}) +endfunction() + +# Copy all input files to the output folder +function(copy_files_to_folder files folder) + foreach(f ${files}) + get_filename_component(filename ${f} NAME) + set(outputPath "${folder}/${filename}") + configure_file(${f} ${outputPath} COPYONLY) + endforeach() +endfunction() + +# Quit if the file does not exist +function(verify_file_exists path) + if(NOT EXISTS ${path}) + message( FATAL_ERROR "Required file ${path} does not exist!" ) + endif() +endfunction() + +# Set result to ON if the file contains "s", OFF otherwise. +function(file_contains path s result) + file(READ ${path} contents) + string(FIND "${contents}" "${s}" position) + set(${result} ON PARENT_SCOPE) + if(${position} EQUAL -1) + set(${result} OFF PARENT_SCOPE) + endif() +endfunction() + + +# Set result to a list of all the subdirectories in the given directory. +function(get_subdirectory_list curdir result) + file(GLOB children RELATIVE ${curdir} ${curdir}/*) + set(dirlist "") + foreach(child ${children}) + # Skip files and hidden folders. + string(SUBSTRING ${child} 0 1 firstChar) + if( (IS_DIRECTORY ${curdir}/${child}) AND (NOT ${firstChar} STREQUAL ".") ) + list(APPEND dirlist ${curdir}/${child}) + endif() + endforeach() + set(${result} ${dirlist} PARENT_SCOPE) +endfunction() + +# Append the contents of IN_FILE to the end of OUT_FILE +function(cat inFile outFile) + + # If the output file does not exist, init with an empty file. + if(NOT EXISTS "${outFile}") + file(WRITE ${outFile} "") + endif() + + # Perform the file concatenation. + if(EXISTS "${inFile}") + file(READ ${inFile} contents) + file(APPEND ${outFile} "${contents}") + endif() +endfunction() + +# Get the correct location to generate code for items in a given input folder +# - Generated code includes uic, moc, and protobuf files. +function(get_code_gen_dir inputFolder codeGenFolder) + file(RELATIVE_PATH relPath ${PROJECT_SOURCE_DIR} ${inputFolder}) + string(REPLACE "src" "objects" relPath ${relPath}) + set(${codeGenFolder} "${PROJECT_BINARY_DIR}/${relPath}" PARENT_SCOPE) + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${relPath}") + + # Also add this folder to the include path + # include_directories("${PROJECT_BINARY_DIR}/${relPath}") +endfunction() + +# Determine the text string used to describe this OS version +function(get_os_version text) + + if(UNIX AND NOT APPLE) + + # Fetch OS information + execute_process(COMMAND cat "/etc/os-release" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + if ("${code}" STREQUAL "0") + # Extract OS name and version from generic Linux system + string(REGEX MATCH "NAME=[A-Za-z\"]+" name "${result}") + string(REGEX MATCH "VERSION_ID=[0-9\\.\"]+" version "${result}") + string(SUBSTRING ${name} 5 -1 name) + string(SUBSTRING ${version} 11 -1 version) + string(REPLACE "\"" "" name ${name}) + string(REPLACE "\"" "" version ${version}) + string(REPLACE "." "_" version ${version}) + else() + # Try the Red Hat specific command. + execute_process(COMMAND cat "/etc/redhat-release" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + if ("${code}" STREQUAL "0") + # Extract OS name and version from Red Hat Linux system + string(REGEX MATCH "[0-9\\.]+" version "${result}") + set(name RedHatEnterprise) # This part is easy + else() + # TODO: Test! + # Try another command + execute_process(COMMAND cat "/etc/lsb-release" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + + message("code = ${code}") + message("result = ${result}") + + if ("${code}" STREQUAL "0") + # Extract OS name and version + string(REGEX MATCH "Description:[ A-Za-z0-9\\.]+" version "${result}") # Get the line + string(REPLACE "release" "" version ${version}) # Strip unwanted text + string(REPLACE " " "" version ${version}) + string(REPLACE "Description:" "" version ${version}) + set(name "") # Included in version + else() + # TODO: Test! + # Try the debian specific command + execute_process(COMMAND cat "/etc/debian_version" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + + message("code = ${code}") + message("result = ${result}") + if ("${code}" STREQUAL "0") + set(version "${result}") + set(name Debian) + else() + + message( FATAL_ERROR "Did not recognize UNIX operating system!" ) + + endif() + endif() + endif() + endif() + + #message("name = ${name}") + #message("version = ${version}") + + set(prefix "Linux_x86_64_") + + # Build the final output string + elseif(APPLE) + + # Fetch OS information + execute_process(COMMAND sw_vers + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + + # Format the string + string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" version "${result}") + string(REGEX MATCH "^[0-9]+.[0-9]+" version "${version}") + string(REPLACE "." "_" version ${version}) + + set(name "MacOSX") + set(prefix "Darwin_x86_64_") + + else() + message( FATAL_ERROR "Did not recognize a supported operating system!" ) + endif() + + # Final string assembly + set(${text} ${prefix}${name}${version} PARENT_SCOPE) +endfunction() + + +# Delete the first N lines of a file +function(apply_skiplines path number) + + if(${number} EQUAL 0) + return() + endif() + + # The first line counts as line 1 for the tail command + MATH(EXPR number "${number}+1") + + set(temp ${path}_temp) + file(RENAME ${path} ${temp}) + message("tail -n +${number} ${temp} OUTPUT_FILE ${path}") + execute_process(COMMAND tail -n +${number} ${temp} OUTPUT_FILE ${path}) + #file(REMOVE ${temp}) +endfunction() + +# Strip all lines beginning with one of the words +function(apply_ignorelines path words) + + set(temp ${path}_temp) + file(RENAME ${path} ${temp}) + + #Set up special grep command to remove these lines + message("words = ${words}") + string(REPLACE " " "|" fullS "${words}") + + message("COMMAND grep -vEw ${fullS} ${temp}") + execute_process(COMMAND grep -vEw ${fullS} ${temp} OUTPUT_FILE ${path}) + + #file(REMOVE ${temp}) +endfunction() + + +#------------------------------------------------------------ + +# Wrapper function to add a library and its components +function(add_library_wrapper name sourceFiles libDependencies) + + # The only optional argument is "alsoStatic", which indicates that + # the library should be build both shared and static. + set(alsoStatic ${ARGN}) + + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + + # Add library, set dependencies, and add to installation list. + add_library(${name} SHARED ${sourceFiles}) + set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(${name} ${libDependencies}) + install(TARGETS ${name} DESTINATION lib) + + # buildStaticCore is a command line option specified in the top CMakeLists.txt file. + if(alsoStatic AND ${buildStaticCore}) + # The static version needs a different name, but in the end the file + # needs to have the same name as the shared lib. + set(staticName "${name}_static") + message("Adding static library ${staticName}") + + add_library("${staticName}" STATIC ${sourceFiles}) + set_target_properties(${staticName} PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(${staticName} ${libDependencies}) + + # Use a copy -> install combo to get the file to the correct place. + add_custom_command(TARGET ${staticName} POST_BUILD + COMMAND mv ${CMAKE_BINARY_DIR}/src/lib${staticName}.a + ${CMAKE_BINARY_DIR}/src/lib${name}.a) + + install(CODE "EXECUTE_PROCESS(COMMAND cp ${CMAKE_BINARY_DIR}/lib/lib${name}.a + ${CMAKE_INSTALL_PREFIX}/lib/lib${name}.a)") + endif() + +endfunction() + +function(get_version libFile returnVar) + set(${returnVar} "") + set(FOUND_VERSION "") + # Get the File name + get_filename_component(VERSION_FILE ${libFile} NAME_WE) + # message("VERSION_FILE = ${VERSION_FILE}") + # Get the path to the dylib file as the so with version info is in the same area + string(REGEX MATCH "^/(([a-z or A-Z or 0-9])*/)*" PATH_TO_VERSION ${libFile}) + # message("PATH_TO_VERSION= ${PATH_TO_VERSION}") + # Glob for the dylib file with the version number + # message("CURRENT PREFIX = ${PATH_TO_VERSION}${VERSION_FILE}") + file(GLOB FOUND_FILES + "${PATH_TO_VERSION}${VERSION_FILE}-[0-9].[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}-[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}-3.1.so" + "${PATH_TO_VERSION}${VERSION_FILE}.[0-9].[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}_[0-9].[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}.so.[0-9]*.[0-9]*.[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}.so.[0-9]*.[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}.[0-9].dylib" + "${PATH_TO_VERSION}${VERSION_FILE}.[0-9]*.[0-9]*.dylib" + ) + # message("FOUND_FILES = ${FOUND_FILES}") + foreach(f ${FOUND_FILES}) + # Ideally glob found a single file and grep for the version number found + get_filename_component(VERSION_FILE ${f} NAME) + + string(REGEX MATCH "[\\.,-][0-9]+\\.[0-9]+\\.[0-9]+" CURR_VERSION ${VERSION_FILE}) + + if(NOT CURR_VERSION) + string(REGEX MATCH "[\\.,-][0-9]+\\.[0-9]+" CURR_VERSION ${VERSION_FILE}) + endif(NOT CURR_VERSION) + + + if(NOT CURR_VERSION) + string(REGEX MATCH "[\\.,-][0-9]+\\." CURR_VERSION ${VERSION_FILE}) + string(SUBSTRING ${CURR_VERSION} 0 2 CURR_VERSION) + endif(NOT CURR_VERSION) + + string(SUBSTRING ${CURR_VERSION} 1 -1 CURR_VERSION) + + if(FOUND_VERSION) + # message("VERSION = ${CURR_VERSION}") + # message("FOUND_VERSION = ${FOUND_VERSION}") + if(${FOUND_VERSION} VERSION_LESS ${CURR_VERSION}) + set(FOUND_VERSION ${CURR_VERSION}) + endif() + else(FOUND_VERSION) + set(FOUND_VERSION ${CURR_VERSION}) + endif(FOUND_VERSION) + + endforeach() + set(${returnVar} ${FOUND_VERSION} PARENT_SCOPE) +endfunction() diff --git a/isis/cmake/cmake_install.cmake b/isis/cmake/cmake_install.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c66bc846889856012f5050787464fd818f5ef576 --- /dev/null +++ b/isis/cmake/cmake_install.cmake @@ -0,0 +1,50 @@ +# Install script for directory: /scratch/isiscmake/isis/cmake + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/scratch/isiscmake/isis/build") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "0") +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND cp -f /scratch/isiscmake/isis/lib/libisis3.so /scratch/isiscmake/isis/build/lib/libisis3.5.0.so) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.0.so /scratch/isiscmake/isis/build/lib/libisis3.5.so) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.so /scratch/isiscmake/isis/build/lib/libisis3.so) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND ln -sf libisis3.so /scratch/isiscmake/isis/build/lib/libisis.so) +endif() + diff --git a/isis/cmake/gtest.cmake b/isis/cmake/gtest.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1208baf31e528c2a785b35284cdc1a02e3c3291a --- /dev/null +++ b/isis/cmake/gtest.cmake @@ -0,0 +1,39 @@ +if (NOT TARGET gtest) + set(GOOGLETEST_ROOT ${CMAKE_SOURCE_DIR}/../gtest/googletest CACHE STRING "Google Test source root") + + include_directories(SYSTEM + ${GOOGLETEST_ROOT} + ${GOOGLETEST_ROOT}/include + ) + + set(GOOGLETEST_SOURCES + ${GOOGLETEST_ROOT}/src/gtest-all.cc + ${GOOGLETEST_ROOT}/src/gtest_main.cc + ) + + foreach(_source ${GOOGLETEST_SOURCES}) + set_source_files_properties(${_source} PROPERTIES GENERATED 1) + endforeach() + + add_library(gtest ${GOOGLETEST_SOURCES}) +endif() + +if (NOT TARGET gmock) + set(GOOGLEMOCK_ROOT ${CMAKE_SOURCE_DIR}/../gtest/googlemock CACHE STRING "Google Mock source root") + + include_directories(SYSTEM + ${GOOGLEMOCK_ROOT} + ${GOOGLEMOCK_ROOT}/include + ) + + set(GOOGLEMOCK_SOURCES + ${GOOGLEMOCK_ROOT}/src/gmock-all.cc + ${GOOGLEMOCK_ROOT}/src/gmock_main.cc + ) + + foreach(_source ${GOOGLEMOCK_SOURCES}) + set_source_files_properties(${_source} PROPERTIES GENERATED 1) + endforeach() + + add_library(gmock ${GOOGLEMOCK_SOURCES}) +endif() diff --git a/isis/license.txt b/isis/license.txt deleted file mode 100644 index d027c85f72ad132acc9753cb7bef73201c6b5ce1..0000000000000000000000000000000000000000 --- a/isis/license.txt +++ /dev/null @@ -1,46 +0,0 @@ -ISIS Licensing, copyright, distribution, and warranty information - -USGS-authored or produced data, information, and software are in the -public domain. - -Software and related material (data and (or) documentation), contained in or -furnished in connection with a software distribution, are made available by -the U.S. Geological Survey (USGS) to be used in the public interest and in -the advancement of science. You may, without any fee or cost, use, copy, -modify, or distribute this software, and any derivative works thereof, and -its supporting documentation, subject to the following restrictions and -understandings. - -If you distribute copies or modifications of the software and related -material, make sure the recipients receive a copy of this notice and -receive or can get a copy of the original distribution. If the software and -(or) related material are modified and distributed, it must be made clear -that the recipients do not have the original and they must be informed of -the extent of the modifications. For example, modified files must include a -prominent notice stating the modifications made, the author of the -modifications, and the date the modifications were made. This restriction is -necessary to guard against problems introduced in the software by others, -reflecting negatively on the reputation of the USGS. - -The software is public property and you therefore have the right to the -source code, if desired. You may charge fees for distribution, warranties, -and services provided in connection with the software or derivative works -thereof. The name USGS can be used in any advertising or publicity to -endorse or promote any products or commercial entity using this software -if specific written permission is obtained from the USGS. - -The user agrees to appropriately acknowledge the authors and the USGS in -publications that result from the use of this software or in products that -include this software in whole or in part. - -Because the software and related material are free (other than nominal -materials and handling fees) and provided "as is," the authors, the USGS, -and the United States Government have made no warranty, express or implied, -as to accuracy or completeness and are not obligated to provide the user -with any support, consulting, training or assistance of any kind with -regard to the use, operation, and performance of this software nor to -provide the user with any updates, revisions, new versions or "bug fixes." - -The user assumes all risk for any damages whatsoever resulting from -loss of use, data, or profits arising in connection with the access, -use, quality, or performance of this software diff --git a/isis/make/config.darwin-MacOSX10_11 b/isis/make/config.darwin-MacOSX10_11 index 4a842ac98b3e35f18dc7845f0fdf47be3690d095..ecd72e9532edda40449fc3792a9217c7ad746bfb 100644 --- a/isis/make/config.darwin-MacOSX10_11 +++ b/isis/make/config.darwin-MacOSX10_11 @@ -374,10 +374,6 @@ NNLIB = -lnn #--------------------------------------------------------------------------- # Setup for Bullet Physics library #--------------------------------------------------------------------------- -#BULLETLIB = -lBullet2FileLoader -lBullet3Collision -lBullet3Common \ -# -lBullet3Dynamics -lBullet3Geometry -lBullet3OpenCL_clew \ -# -lBulletCollision -lBulletDynamics -lBulletInverseDynamics \ -# -lBulletSoftBody -lLinearMath BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ diff --git a/isis/make/config.darwin-MacOSX10_13 b/isis/make/config.darwin-MacOSX10_13 new file mode 100644 index 0000000000000000000000000000000000000000..a2134dfcd3098e92c6fcc08ff9ea088c8a25b2bc --- /dev/null +++ b/isis/make/config.darwin-MacOSX10_13 @@ -0,0 +1,602 @@ +# $Id: config.darwin,v 1.47 2010/04/07 00:07:52 kbecker Exp $ +#-------------------------------------------------------------------------- +# Compiler options +#--------------------------------------------------------------------------- +# Build architecture now automatically determined at build time via isis.conf +# include $(ISISROOT)/make/isis.conf + +MAC_ARCH=-arch x86_64 +MAC_XARCH=-Xarch_x86_64 +MAC_OS_MIN=-mmacosx-version-min=10.11 +MAC_ARCH_FLAGS = $(MAC_ARCH) $(MAC_XARCH) $(MAC_OS_MIN) + +QTDEFINES= -DQT_GUI_LIB -DQT_CORE_LIB DQT_NO_DEBUG + +ISIS_MACOSX_TARGET=10.11 + +ISIS_CFLAGS= -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall -W -Wno-unused-parameter -fPIC $(MAC_ARCH_FLAGS) $(QTDEFINES) + +ISIS_CPPFLAGS= -pipe -stdlib=libc++ -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall -W -Wno-unused-parameter -fPIC $(MAC_ARCH_FLAGS) $(QTDEFINES) + +ISIS_LFLAGS=-headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk $(MAC_ARCH_FLAGS) + +ISIS_INC_PATH= -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers + +# flags to be used only when compiling protobuf generated source files +ISIS_PROTOBUF_FLAGS= -w + +# Basically is GNU g++/gcc +CXX = g++ +CC = gcc + +ifeq ($(HOST_PROC), powerpc) + # Powerpc support + ISISCPPFLAGS += -DISIS_LITTLE_ENDIAN=0 +else + # Assumes Intel Mac + ISISCPPFLAGS += -DISIS_LITTLE_ENDIAN=1 +endif +ISISCPPFLAGS += -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE +ISISCPPFLAGS += -fPIC +ISISCPPFLAGS += -DGMM_USES_SUPERLU +ISISCPPFLAGS += -std=c++11 + +#ifeq ($(findstring DEBUG, $(MODE)),DEBUG) + ISISCPPFLAGS += -g + ISISCPPFLAGS += -O0 +#else + ISISCPPFLAGS += -O2 +#endif +ISISCFLAGS = $(ISIS_CFLAGS) + +#--------------------------------------------------------------------------- +# Linker options. Runtime paths for Mac is rooted to $ISISROOT +#--------------------------------------------------------------------------- +#ISISLDFLAGS = -headerpad_max_install_names $(MAC_ARCH_FLAGS) -bind_at_load -Wl,-w +#ISISLDFLAGS += $(ISIS_LFLAGS) -bind_at_load -Wl,-w +ISISLDFLAGS += $(ISIS_LFLAGS) -Wl,-w +ISISLDRPATH = -Wl,-rpath,@loader_path/.. -Wl,-rpath,$(ISISROOT) +ISISSYSLIBS = -lz -lm -framework ApplicationServices +ISISSTATIC = +ISISDYNAMIC = + +#--------------------------------------------------------------------------- +# Shared library options +#--------------------------------------------------------------------------- +#RANLIB = /usr/bin/ranlib +RANLIB = /usr/bin/true +SHAREDLIBEXT = dylib +DYLIBVERSION = -compatibility_version $(ISISMAJOR).$(ISISMINOR) \ + -current_version $(ISISLIBVERSION) +DYLIBFLAGS = $(MAC_ARCH_FLAGS) -dynamiclib -flat_namespace \ + -single_module -undefined suppress +ISISSHAREDFLAGS = $(MAC_ARCH_FLAGS) -bundle -flat_namespace -dynamic \ + -undefined suppress +ISISSHAREDON = +ISISSHAREDOFF = +ISISARFLAGS = + +#--------------------------------------------------------------------------- +# Set ISIS Dev Kit (IDK) paths. This setting of ISISLOCALVERSION here will +# override this macro set in isismake.os (KJB 2013-12-12) +#--------------------------------------------------------------------------- +#ISISLOCALVERSION := v006 +IDK_ROOT ?= /opt/usgs/$(ISISLOCALVERSION) +ISIS3OPT ?= $(IDK_ROOT)/ports +ISIS3EXEC ?= $(ISIS3OPT)/libexec +ISIS3LOCAL ?= $(IDK_ROOT)/3rdparty +ISIS3PROP ?= $(IDK_ROOT)/proprietary + +# Set up paths to needed for doxygen +DOXYGEN = $(ISIS3OPT)/bin/doxygen +DOT_PATH = $(ISIS3OPT)/bin +GREP = /usr/local/bin/grep + +# Set up path for OS specific locations of 3rd party licenses +THIRDPARTYLICPATH := /opt/usgs/$(ISISLOCALVERSION)/3rdParty/license/ + +#--------------------------------------------------------------------------- +# Set up for cwd +#--------------------------------------------------------------------------- +CWDINCDIR = +CWDLIBDIR = +CWDLIB = + +#--------------------------------------------------------------------------- +# Set up for Qt +#--------------------------------------------------------------------------- +QTDIR = $(ISIS3EXEC)/qt5 + +QTFRAMEWORKDIR = $(QTDIR)/lib + +QTINCDIR = -I$(QTDIR)/mkspecs/macx-clang +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtCore.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtConcurrent.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtDBus.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtGui.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtMultimedia.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtMultimediaWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtNetwork.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtNfc.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtOpenGL.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtPositioning.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtPrintSupport.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQml.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuick.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuickParticles.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuickTest.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuickWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtScript.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtScriptTools.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSensors.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSerialPort.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSql.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSvg.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtTest.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebChannel.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebEngine.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebKit.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebKitWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebSockets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtXml.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtXmlPatterns.framework/Headers +#QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtAssistant.framework/Headers +#QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtUiPlugin.framework/Headers + +QTINCDIR += -iframework $(QTFRAMEWORKDIR) + +# turn -isystem to -I and -framework to -F for QT MOC includes +QTINCDIR_MOC = $(subst -iframework ,-F,$(subst -isystem ,-I,$(QTINCDIR))) + +QTLIBDIR = -L$(QTFRAMEWORKDIR) -F$(QTFRAMEWORKDIR) + +QTFRAMEWORKS = -framework QtXmlPatterns -framework QtXml -framework QtNetwork \ + -framework QtSql -framework QtGui -framework QtCore -framework QtSvg \ + -framework QtTest -framework QtWebKit -framework QtOpenGL \ + -framework QtConcurrent -framework QtDBus \ + -framework QtMultimedia -framework QtMultimediaWidgets \ + -framework QtNfc -framework QtPositioning -framework QtPrintSupport \ + -framework QtQml -framework QtQuick -framework QtQuickParticles \ + -framework QtQuickTest -framework QtQuickWidgets -framework QtScript \ + -framework QtScriptTools -framework QtSensors -framework QtSerialPort \ + -framework QtWebKitWidgets -framework QtWebSockets -framework QtWidgets \ + -framework QtTest -framework QtWebChannel -framework QtWebEngine + +QTCOMMONFRAMEWORKS = -framework DiskArbitration -framework IOKit +QTLIB = $(QTFRAMEWORKS) $(QTCOMMONFRAMEWORKS) + +QTOPENGL = -framework OpenGL -framework AGL + +UIC = $(QTDIR)/bin/uic +RCC = $(QTDIR)/bin/rcc +RCCDEFINES = +MOC = $(QTDIR)/bin/moc +MOCDEFINES += $(QTDARWINFLAGS) +MOCDEFINES += $(QTINCDIR_MOC) # Moc may not need QT includes +MOCDEFINES += -D__APPLE__ -D__GNUC__ + +#--------------------------------------------------------------------------- +# Set up for Qwt +#--------------------------------------------------------------------------- +QWTDIR = $(ISIS3OPT) +QWTFRAMES = $(QWTDIR)/Library/Frameworks +ifeq (,$(findstring $(QWTFRAMES)/qwt.framework,$(wildcard $(QWTFRAMES)/qwt.framework ))) + QWTFRAMES = $(ISIS3OPT)/lib +endif + +QWTINCDIR = -I$(QWTFRAMES)/qwt.framework/Headers +QWTLIBDIR = -L$(QWTFRAMES) -F$(QWTFRAMES) +QWTLIB = -framework qwt + +#--------------------------------------------------------------------------- +# Set up for Xerces +#--------------------------------------------------------------------------- +XERCESINCDIR = -I$(ISIS3OPT)/include/xercesc +XERCESLIBDIR = -L$(ISIS3OPT)/lib +XERCESLIB = -lxerces-c + +XALAN = $(ISIS3OPT)/bin/Xalan + +#--------------------------------------------------------------------------- +# Set up for GeoTiff +#--------------------------------------------------------------------------- +GEOTIFFINCDIR = -I$(ISIS3OPT)/include +GEOTIFFLIBDIR = -L$(ISIS3OPT)/lib +GEOTIFFLIB = -lgeotiff + +#--------------------------------------------------------------------------- +# Set up for proj (Needed on Macs for geotiff) +#--------------------------------------------------------------------------- +PROJINCDIR = -I$(ISIS3OPT)/include +PROJLIBDIR = -L$(ISIS3OPT)/lib +PROJLIB = -lproj + +#--------------------------------------------------------------------------- +# Set up for Tiff +#--------------------------------------------------------------------------- +TIFFINCDIR = -I$(ISIS3OPT)/include +TIFFLIBDIR = -L$(ISIS3OPT)/lib +TIFFLIB = -ltiff + +#--------------------------------------------------------------------------- +# Set up for naif cspice libraries. Update for N0066 Release (KJB 2017-06-28) +#--------------------------------------------------------------------------- +NAIFINCDIR = -I$(ISIS3LOCAL)/include/naif/ +NAIFLIBDIR = -L$(ISIS3LOCAL)/lib +NAIFLIB = -lcspice + +#--------------------------------------------------------------------------- +# Set up for TNT +#--------------------------------------------------------------------------- +TNTINCDIR = -I$(ISIS3LOCAL)/include/tnt +TNTLIBDIR = +TNTLIB = + +#--------------------------------------------------------------------------- +# Set up for JAMA +#--------------------------------------------------------------------------- +JAMAINCDIR = -I$(ISIS3LOCAL)/include/jama +JAMALIBDIR = +JAMALIB = + +#--------------------------------------------------------------------------- +# Set up for GEOS +#--------------------------------------------------------------------------- +GEOSINCDIR = -isystem $(ISIS3OPT)/include/geos +GEOSLIBDIR = -L$(ISIS3OPT)/lib +GEOSLIB = -lgeos -lgeos_c + +#--------------------------------------------------------------------------- +# Set up for the GNU Scientific Library (GSL). Note that this setup +# suppports include patterns such as . With this +# format, any other include spec that points to the general include +# directory, such as GEOS, will suffice. Therefore, an explicit +# include directive is ommitted but provided as an empty reference +# in cases where it may be located elsewhere. This also goes for the +# library reference. +#--------------------------------------------------------------------------- +GSLINCDIR = -I$(ISIS3OPT)/include/gsl +GSLLIBDIR = -L$(ISIS3OPT)/lib +GSLLIB = -lgsl -lgslcblas + +#--------------------------------------------------------------------------- +# Set up for GMM +#--------------------------------------------------------------------------- +GMMINCDIR = -isystem $(ISIS3LOCAL)/include +GMMLIBDIR = +GMMLIB = + +#--------------------------------------------------------------------------- +# Set up for SuperLU +#--------------------------------------------------------------------------- +SUPERLUINCDIR = -I$(ISIS3LOCAL)/include/superlu +SUPERLULIBDIR = -L$(ISIS3LOCAL)/lib +ifeq ($(HOST_PROC), powerpc) +# Powerpc support + SUPERLULIB = -lsuperlu_3.0 -framework vecLib +else +# Assumes Intel Mac + SUPERLULIB = -lsuperlu -lblas +endif + +#--------------------------------------------------------------------------- +# Set up for Google Protocol Buffers (ProtoBuf) +#--------------------------------------------------------------------------- +PROTOBUFINCDIR = -isystem $(ISIS3OPT)/include/google +PROTOBUFLIBDIR = -L$(ISIS3OPT)/lib +PROTOBUFLIB = -lprotobuf +PROTOC = $(ISIS3OPT)/bin/protoc + +#--------------------------------------------------------------------------- +# Set up for kakadu +# The Kakadu library is proprietary. The source files cannot be distributed +# with ISIS3. If you need to rebuild ISIS3 on your system, then you will +# need to modify the lines below that pertain to the location of the +# header files and library on your system. The compilation flag, ENABLEJP2K, +# should be set to true if you are building with the Kakadu library and +# you want to use the JPEG2000 specific code in the ISIS3 system. Otherwise, +# set the ENABLEJP2K flag to false. +# +# Added abililty to automatically detect the existance of the Kakadu include +# directory. One can set the environment variable JP2KFLAG with a 1 or 0 +# depending upon need. Developers can define appropriate enviroment variables +# for the complete JP2K environment. Just redefine them based upon the usage +# below (i.e., be sure to add -I, -L and -l to the variables for KAKADUINCDIR, +# KAKADULIBDIR and KAKADULIB, respectively). +#--------------------------------------------------------------------------- +KAKADUINCDIR := "-isystem$(ISIS3PROP)/include/kakadu/v7_9_1-01762L" +KAKADULIBDIR := -L$(ISIS3PROP)/lib +KAKADULIB := -lkdu_a79R -lkdu_v79R +# Strip -I from Kakadu include directory macro and check for existance +JP2KFLAG ?= $(shell if [ -d $(subst -isystem,,$(KAKADUINCDIR)) ]; then echo "1"; else echo "0"; fi;) +ISISCPPFLAGS += -DENABLEJP2K=$(JP2KFLAG) + +#--------------------------------------------------------------------------- +# Set up for Boost Library +#--------------------------------------------------------------------------- +BOOSTINCDIR = "-isystem $(ISIS3OPT)/include" +BOOSTLIBDIR = -L$(ISIS3OPT)/lib +BOOSTLIB = -lboost_date_time-mt -lboost_filesystem-mt -lboost_graph-mt \ + -lboost_math_c99f-mt -lboost_math_c99l-mt -lboost_math_c99-mt \ + -lboost_math_tr1f-mt -lboost_math_tr1l-mt -lboost_math_tr1-mt \ + -lboost_prg_exec_monitor-mt -lboost_program_options-mt \ + -lboost_regex-mt -lboost_serialization-mt -lboost_signals-mt \ + -lboost_system-mt -lboost_thread-mt -lboost_unit_test_framework-mt \ + -lboost_wave-mt -lboost_wserialization-mt -lboost_timer-mt \ + -lboost_chrono-mt + +#--------------------------------------------------------------------------- +# Set up for Cholmod Libraries +#--------------------------------------------------------------------------- +CHOLMODINCDIR = -I$(ISIS3LOCAL)/include/SuiteSparse +CHOLMODLIBDIR = -L$(ISIS3LOCAL)/lib +CHOLMODLIB = -lcholmod -lamd -lcolamd -lcamd -framework Accelerate + +#--------------------------------------------------------------------------- +# Set up for HDF5 libraries +#--------------------------------------------------------------------------- +#HDF5INCDIR = -I$(ISIS3OPT)/include +HDF5LIBDIR = -L$(ISIS3OPT)/lib +HDF5LIB = -lhdf5 -lhdf5_hl -lhdf5_cpp -lhdf5_hl_cpp + +#--------------------------------------------------------------------------- +# Set up for OpenCV libraries +# +# Add the following line to your app's Makefile (see the NN notes) +# ALLLIBS += $(OPENCVLIBS) +#--------------------------------------------------------------------------- +#OPENCVINCDIR = -I$(ISIS3OPT)/include +#OPENCVLIBDIR = -L$(ISIS3OPT)/lib # Redundant +OPENCVLIBS = -lopencv_calib3d -lopencv_core \ + -lopencv_features2d -lopencv_xfeatures2d \ + -lopencv_flann -lopencv_highgui \ + -lopencv_imgproc -lopencv_imgcodecs \ + -lopencv_ml -lopencv_objdetect \ + -lopencv_photo -lopencv_stitching -lopencv_superres \ + -lopencv_video -lopencv_videostab + +#--------------------------------------------------------------------------- +# Set up for Natural Neighbor Library (NN) +# +# * Note that NNINCDIR is not added to ALLINCDIRS in isismake.os +# * and NNLIB is not added to ALLLIBDIRS in isismake.os +# +# For now, if you want to use this library, modify your app's Makefile. +# Add an empty line after the last line in the Makefile, then add +# ALLLIBS += $(NNLIB) +# on a new line. +#--------------------------------------------------------------------------- +NNINCDIR = -I$(ISIS3LOCAL)/include/nn +#NNLIBDIR = -L$(ISIS3LOCAL)/lib +NNLIB = -lnn + +#--------------------------------------------------------------------------- +# Setup for Bullet Physics library +#--------------------------------------------------------------------------- +BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ + -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ + -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ + -lLinearMath +BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet +BULLETLIBDIR = -L$(ISIS3LOCAL)/lib + +#--------------------------------------------------------------------------- +# Set up for PCL Python framework +#--------------------------------------------------------------------------- +PCLPYDIR = $(ISIS3OPT) +PCLPYFRAMES = $(PCLPYDIR)/Library/Frameworks +ifeq (,$(findstring $(PCLPYFRAMES)/Python.framework,$(wildcard $(PCLPYFRAMES)/Python.framework ))) + PCLPYFRAMES = $(ISIS3OPT)/lib +endif + +#--------------------------------------------------------------------------- +# Set up for PCL libraries +#--------------------------------------------------------------------------- +PCLINCDIR = -I$(ISIS3LOCAL)/include/pcl-1.8 +PCLLIBDIR = -L$(ISIS3LOCAL)/lib +PCLLIB = -lpcl_common -lpcl_octree -lpcl_io \ + -framework Python -lintl +VTKLIB = -lvtksys-7.0.1 +EMBREELIB = -lembree + +#--------------------------------------------------------------------------- +# Set up for Eigen (link to include files only, no library) +#--------------------------------------------------------------------------- +EIGENINCDIR = -I$(ISIS3OPT)/include/eigen3 + +#--------------------------------------------------------------------------- +# Final generic setup for includes at the top level +#--------------------------------------------------------------------------- +DEFAULTINCDIR = -I$(ISIS3LOCAL)/include + +#--------------------------------------------------------------------------- +# Define the third party distribution libraries (patterns) +#--------------------------------------------------------------------------- + +# Qt Libraries +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtXmlPatterns.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtXml.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtNetwork.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSql.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtGui.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtCore.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSvg.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtTest.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebEngine.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebEngineCore.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebKit.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtOpenGL.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtConcurrent.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtDBus.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtMultimedia.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtMultimediaWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtNfc.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtPositioning.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtPrintSupport.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQml.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuick.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuickParticles.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuickTest.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuickWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtScript.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtScriptTools.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSensors.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSerialPort.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebKitWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebSockets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebChannel.framework" +THIRDPARTYLIBS += "$(QWTFRAMES)/qwt.framework" + +# Qt dependencies +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libpcre16*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgthread-*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libpcre.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libharfbuzz*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgraphite2.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libleveldb*.dylib*" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libsnappy.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libwebp*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libdbus*.dylib" + +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcspice*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libsuperlu*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libprotobuf*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libiconv*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxerces-c*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgeotiff*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtiff*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/liblzma*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgsl*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libz*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libssl*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libcrypto*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libpng*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtiff.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libjpeg.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libmng.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/liblcms2.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgeos*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libsqlite3.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/postgresql*/libpq.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/mysql56/mysql/libmysqlclient*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libiodbc*.dylib" +THIRDPARTYLIBS += "$(ISIS3PROP)/lib/libkdu_a79R.dylib" +THIRDPARTYLIBS += "$(ISIS3PROP)/lib/libkdu_v79R.dylib" + + +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libamd*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcamd*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcholmod*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libsuitesparseconfig*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libccolamd*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcolamd*.dylib" +#THIRDPARTYLIBS += "/System/Library/Frameworks/Accelerate.framework" + +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libhdf5*.dylib" + +# Add all the OpenCV libraries and its dependancies +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopencv_*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtbb*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libjasper*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libImath*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libIlmImf*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libIex*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libHalf*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libIlmThread*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavcodec*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavformat*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavutil*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libswscale*.dylib" + +# Secondary requirements to all OpenCV dependancies (Yuck!) +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libSDL-1*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libnettle*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libhogweed*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgmp*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxvidcore*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libx264*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libvorbisenc*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libvorbis*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libogg*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtheoraenc*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtheoradec*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libspeex*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libschroedinger-1*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopus*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopenjpeg*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libmp3lame*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libmodplug*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libfreetype*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libbluray*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libass*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgnutls*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libbz2*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXrandr*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXext*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXrender*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libX11*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxcb*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXau*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXdmcp*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/liborc-0*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxml2*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libfribidi*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libfontconfig*.dylib" +#THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libenca*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libexpat*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libintl*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libglib-*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libp11-kit*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libffi*.dylib" + +# OpenCV3 dependencies +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavresample*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxcb-shm*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libsoxr*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopenjp2*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libOpenNI*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libswresample*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libidn*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtasn1*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libusb*.dylib" + +# libxerces-c depends on these libraries +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libicui18n*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libicuuc*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libicudata*.dylib" + +# libgeotiff depends on these libraries +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libproj*.dylib" + +# Bullet Libraries +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libLinearMath*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet2FileLoader*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Collision*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Common*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Dynamics*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Geometry*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3OpenCL_clew*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletCollision*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletDynamics*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletInverseDynamics*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletSoftBody*.dylib" + +# Add the Point Cloud Libraries and PCL dependencies +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libpcl_*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libflann*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libqhull*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libvtk*.dylib" +THIRDPARTYLIBS += "$(PCLPYFRAMES)/Python.framework" + +# Add the Embree library +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libembree*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtbb*.dylib" + +# Add the Boost libraries +#THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libboost_system-mt*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libboost*.dylib" + +# Plugins +THIRDPARTYPLUGINS += "$(QTDIR)/plugins/" diff --git a/isis/make/isismake.tsts b/isis/make/isismake.tsts index 76155b0af953014618cbb2f5ac3cfa93733f0fb9..fd840c31c8ae1352fee3bae23715309fa0f120c4 100644 --- a/isis/make/isismake.tsts +++ b/isis/make/isismake.tsts @@ -83,7 +83,7 @@ endif # Make sure all apps use the correct preferences file when testing, unless # they have set NOPREFERENCES. This is valid for non-Isis apps. ifeq ($(origin NOPREFERENCES), undefined) - APPNAME += -preference=$(ISISROOT)/src/base/objs/Preference/TestPreferences + APPNAME += -preference=$(ISISROOT)/TestPreferences endif # set the output variable to the output directory @@ -105,7 +105,7 @@ FILECOUNTMISMATCH =echo Failed ... Number of files in truth and output folder do NOTALLMATCH =echo Failed ... Not all files in truth and output folders match # Set test arguments for use in category tests -TSTARGS = -preference=$(ISISROOT)/src/base/objs/Preference/TestPreferences +TSTARGS = -preference=$(ISISROOT)/TestPreferences DIRPATTERN=2774 FILEPATTERN=2664 @@ -113,7 +113,7 @@ DIRLISTPATTERN="drwxrwsr--" #---------------------------------------------------------------------------- # Target = help -# Dependencies = +# Dependencies = # # Displays a list of targets and their descriptions. #---------------------------------------------------------------------------- @@ -190,19 +190,19 @@ test: FORCE clean if [ "$(findstring $(TESTNOCLEAN), $(MODE))" != "$(TESTNOCLEAN)" ]; \ then \ $(MAKE) ccsafeclean; \ - fi; - + fi; + #------------------------------------------------------------------------- --- -# Target = compare -# Dependencies = All files in the truth and output directories -# -# Iterates over the list of files in the truth directory and -# compares the files against the files in the output directory. -# If successful (indicated by presence of casesucceeded.txt), -# prints success message. If not, prints all errors that were -# encountered (found in errors.txt). +# Target = compare +# Dependencies = All files in the truth and output directories +# +# Iterates over the list of files in the truth directory and +# compares the files against the files in the output directory. +# If successful (indicated by presence of casesucceeded.txt), +# prints success message. If not, prints all errors that were +# encountered (found in errors.txt). #------------------------------------------------------------------------- --- -compare: FORCE +compare: FORCE if [ -d "$(OUTPUT)" ]; then \ if [ -d "$(TRUTH)" ]; then \ TRUTHDIR=`$(LS) $(TRUTH)`; \ @@ -249,7 +249,7 @@ compare: FORCE # Target = comparefiles # Dependencies = All files in the truth and output directories # -# Iterates over the list of files in the truth directory and +# Iterates over the list of files in the truth directory and # compares the files against the files in the output # directory. If there are any files that are not recognized # then an unknown file message is printed. If and only if all @@ -260,7 +260,7 @@ compare: FORCE # # Some parts of this target are not very straightforward. For comparing cubes, # users may specify make variables within their tests to indicate tolerance or -# to ignore special pixels when running cubediff +# to ignore special pixels when running cubediff # (i.e. test_cube.cub.TOLERANCE=0.0000001). The problem here is that within # this target, we have the current filename that is being compared stored in a # bash variable. We know that the *make* tolerance variable, if it exists, will @@ -279,7 +279,7 @@ compare: FORCE # # The workaround is to use make's special variable that is a space-separated # list of currently defined make variable *names* (NOT values). This variable -# is .VARIABLES. The names of each of the currently defined make .TOLERANCE +# is .VARIABLES. The names of each of the currently defined make .TOLERANCE # variables are extracted from this list, and their values are looked up as # well. A new bash variable is used to hold these name/values pairs for each of # the tolerances (the name and value is separated by a semicolon). The list of @@ -292,11 +292,11 @@ compare: FORCE # This is only a workaround. The real solution would be to completely get rid # of make variable tolerances from all tests and force the use of .DIFF files # (like pvldiff uses). However, around 138 tests are currently using make -# variables to do this, so it would be a considerable undertaking. -# -# +# variables to do this, so it would be a considerable undertaking. +# +# # 2012-06-26 - Jeannie Backer - Sent stderr of pvldiff and cnetdiff to error -# files instead of /dev/null. If errors exist, test fails and +# files instead of /dev/null. If errors exist, test fails and # error messages are reported to stdout. This was already # being handled for cubediff. #---------------------------------------------------------------------------- @@ -502,7 +502,7 @@ comparefiles: FORCE #---------------------------------------------------------------------------- # Target = truthdata -# Dependencies = +# Dependencies = # # Copies the contents of the output directory to the truth # directory. If the truth directory doesn't exist it is created. @@ -514,10 +514,10 @@ truthdata: FORCE #---------------------------------------------------------------------------- # Target = ostruthdata -# Dependencies = +# Dependencies = # # Copies the contents of the output directory to the truth -# directory. If the truth directory corresponding to the +# directory. If the truth directory corresponding to the # OS the test is being run on doesn't exist it is created. #---------------------------------------------------------------------------- ostruthdata: FORCE @@ -536,12 +536,12 @@ ostruthdata: FORCE # Target = output # Dependencies = FORCE commands modifyFiles # -# Masks target command with a better name to just run the -# commands. If the output directory doesn't exist it is +# Masks target command with a better name to just run the +# commands. If the output directory doesn't exist it is # created. The force target is needed because the directory # output causes make to check the directory output if there # is no dependency. Runs the commands and then -# modifies the output files based on the variables set +# modifies the output files based on the variables set # in the test. #---------------------------------------------------------------------------- output: FORCE clean @@ -550,14 +550,14 @@ output: FORCE clean $(MAKE) modifyFiles; #---------------------------------------------------------------------------- -# This target is needed to make the output target work. When used as a +# This target is needed to make the output target work. When used as a # dependency to a target, it forces make to always execute that target. #---------------------------------------------------------------------------- FORCE: #---------------------------------------------------------------------------- # Target = clean -# Dependencies = +# Dependencies = # # Deletes the output directory and all temporary files. #---------------------------------------------------------------------------- @@ -567,7 +567,7 @@ clean: FORCE #---------------------------------------------------------------------------- # Target = ccsafeclean -# Dependencies = +# Dependencies = # # Deletes the output directory and all temporary files except the code # coverage files. @@ -580,11 +580,11 @@ ccsafeclean: FORCE # Target = modifyFiles # Dependencies = modText modBin # -# Performs the modifications to the files in the output -# directory. Iterates over the output files and modifies +# Performs the modifications to the files in the output +# directory. Iterates over the output files and modifies # the file based on variables such as .SKIPLINES # Utilizes the modText and modBin targets to carryout -# the modifactions. +# the modifactions. #---------------------------------------------------------------------------- modifyFiles: FORCE files="$(notdir $(wildcard $(OUTPUT)/*.txt) )"; \ @@ -602,7 +602,7 @@ modifyFiles: FORCE #---------------------------------------------------------------------------- # Target = modText -# Dependencies = +# Dependencies = # # Handles the modifactions of text files in the output # directory. Looks at variables .SKIPLINES and .IGNORELINES. @@ -637,12 +637,12 @@ modText: FORCE #---------------------------------------------------------------------------- # Target = modBin -# Dependencies = +# Dependencies = # # Handles the modifactions of bin files in the output # directory. Looks at variables .BINSKIP and .BINCOUNT. # The variable FILE must be set to the name of the file in -# the output directory to be modified. +# the output directory to be modified. #---------------------------------------------------------------------------- modBin: FORCE if [ "$(FILE)" != "" ]; \ @@ -665,7 +665,7 @@ modBin: FORCE # Target = checkin # Dependencies = copyInTruth # -# Copies data from the test into the test data area. +# Copies data from the test into the test data area. # ISIS3TESTDATA needs to be set to know where to copy # data for this test to. Data in the input and all of the truth # directories are copied to the test data area. @@ -720,12 +720,12 @@ checkin: FORCE #---------------------------------------------------------------------------- # Target = copyInTruth -# Dependencies = +# Dependencies = # -# Copies all of the truth directories to the value in the +# Copies all of the truth directories to the value in the # variable DEST. Iterates over all of the directories in the # test that have truth in it. Creates the directory in DEST -# and then copies all of the files in the truth directory to +# and then copies all of the files in the truth directory to # directory in DEST. #---------------------------------------------------------------------------- copyInTruth: FORCE @@ -744,11 +744,11 @@ copyInTruth: FORCE # Target = checkout # Dependencies = dirs copyOutTruth # -# Copies data from the test data area into the test. +# Copies data from the test data area into the test. # ISIS3TESTDATA needs to be set to know where to get the # test data from. Uses the TESTDATA_PATH to get the data -# for this test. Copies the files from the input directory in the -# TESTDATA_PATH to the input directory of the test. Then +# for this test. Copies the files from the input directory in the +# TESTDATA_PATH to the input directory of the test. Then # copies all of the truth directories and their contents to the test. # If the input or truth directories exist in the local test a warning # is printed and no copying takes place. @@ -773,7 +773,7 @@ checkout: FORCE if [ "$$inputdir" != "" ]; \ then \ $(MAKE) dirs; \ - $(RSYNC) -rt --delete $(TESTDATA_PATH)/input/ input; \ + $(RSYNC) -rt --copy-links --delete $(TESTDATA_PATH)/input/ input; \ fi; \ fi; \ $(MAKE) copyOutTruth DEST=$(TESTDATA_PATH); \ @@ -781,10 +781,10 @@ checkout: FORCE #---------------------------------------------------------------------------- # Target = copyOutTruth -# Dependencies = +# Dependencies = # -# Copies all of the truth directories from the value in the -# variable DEST. Iterates over all of the directories in +# Copies all of the truth directories from the value in the +# variable DEST. Iterates over all of the directories in # DEST that have truth in it. Creates the directory in test # and then copies all of the files from the DEST directory # to the one in the test. @@ -795,7 +795,7 @@ copyOutTruth: FORCE files=`$(LS) $(DEST)/$$i`; \ if [ "$$files" != "" ]; \ then \ - $(RSYNC) -rt --delete $(DEST)/$$i/ $$i; \ + $(RSYNC) -rt --copy-links --delete $(DEST)/$$i/ $$i; \ fi; \ done; @@ -850,7 +850,7 @@ release: FORCE clean #---------------------------------------------------------------------------- # Target = dirs -# Dependencies = +# Dependencies = # # Creates the necessary directories for the test. #---------------------------------------------------------------------------- @@ -859,14 +859,14 @@ dirs: FORCE #---------------------------------------------------------------------------- # Target=changePerms -# Dependencies = +# Dependencies = # # Changes the directory permissions starting at DEST_PATH # and preceding up the directory path till a directory is found -# that matches the DIRLISTPATTERN variable. Both the +# that matches the DIRLISTPATTERN variable. Both the # LOOKUP and DEST_PATH variables need to be set in order -# to work properly. LOOKUP is the first directory to start checking -# folder permissions on, and DEST_PATH is the full directory +# to work properly. LOOKUP is the first directory to start checking +# folder permissions on, and DEST_PATH is the full directory # path above the LOOKUP directory. #---------------------------------------------------------------------------- changePerms: FORCE diff --git a/isis/scripts/IsisInlineDocumentBuild_mod.xsl b/isis/scripts/IsisInlineDocumentBuild_mod.xsl new file mode 100644 index 0000000000000000000000000000000000000000..bcf90f1f5a9588f2551e47b6dc70d84c6d2d9479 --- /dev/null +++ b/isis/scripts/IsisInlineDocumentBuild_mod.xsl @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + +# Set up Xalan's command-line option names. +XALAN := XALAN_BIN_LOCATION +XALAN_VALIDATE_OPTION := -v +XALAN_OUTFILE_OPTION := -o +XALAN_PARAM_OPTION := -p +XALAN_INFILE_OPTION := +XALAN_XSL_OPTION := + +docs: + echo " Constructing []" + + $(XALAN) $(XALAN_PARAM_OPTION) menuPath "'../../'" $(XALAN_PARAM_OPTION) filenameParam "''" $(XALAN_OUTFILE_OPTION) $(XALAN_INFILE_OPTION) .xml $(XALAN_XSL_OPTION) ../../build/IsisPrimaryPageBuild.xsl + $(XALAN) $(XALAN_PARAM_OPTION) menuPath "'../../'" $(XALAN_PARAM_OPTION) filenameParam "''" $(XALAN_OUTFILE_OPTION) $(XALAN_INFILE_OPTION) .xml $(XALAN_XSL_OPTION) ../../build/IsisSubPageBuild.xsl + + + + + + + + diff --git a/isis/scripts/fetchRequiredData.py b/isis/scripts/fetchRequiredData.py new file mode 100644 index 0000000000000000000000000000000000000000..38e6c608b0faa464842888442fcb643fe4b389e2 --- /dev/null +++ b/isis/scripts/fetchRequiredData.py @@ -0,0 +1,645 @@ + +import sys, os + +def main(): + + # Hardcoded list of downloadable files needed to run tests + fileList = ''' +cassini/testData/CM_1540484927_1_001.ir.cub +mer/testData/mer.img +mer/testData/mer.lab +galileo/testData/1213r.img +messenger/kernels/ck/msgr20111020.bc +cassini/calibration/vims/RC19/solar-spectrum/ +base/templates/labels/ +galileo/calibration/conversionFactors_v001.sav +galileo/calibration/conversionFactors_v002.sav +galileo/calibration/weightTables_v001.sav +messenger/kernels/ck/msgr20111019.bc +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +clementine1/calibration/nir/nirmodeflats/strip015_set4_061_065_33_a_n.cub +clementine1/calibration/uvvis/lub_comp_flat_long.cub +clementine1/calibration/uvvis/uvvisTemperature.tbl +newhorizons/calibration/target-wavelengths-expanded.csv +odyssey/testData/I50695002EDR.proj.reduced.cub +galileo/calibration/shutter/calibration.so02F.cub +messenger/testData/EW0089570936I.IMG +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +mer/calibration/REFPIXVAR_105.cub +mer/calibration/REFPIXVAR_110.cub +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +messenger/kernels/ck/msgr20111018.bc +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +base/dems/ulcn2005_lpo_0004.cub +clementine1/calibration/nir/clemnircal.def +calibration/uvvis/uvvisTemperature.tbl +odyssey/testData/I56969027EDR.proj.reduced.cub +galileo/calibration/gain/redf.cal04.cub +galileo/calibration/gain/clrf.cal04.cub +mro/testData/ctx_pmoi_i_00003.bottom.cub +messenger/testData/EW0031592574E.IMG +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +cassini/calibration/darkcurrent/ +apollo15/templates/apolloPanFiducialFinder.pvl +base/dems/ulcn2005_lpo_0004.cub +clementine1/translations/ +lro/translations/ +viking1/translations/ +mgs/translations/ +mariner10/translations/ +mariner10/calibration/mariner_10_CLE_A_coef.cub +mariner10/calibration/mariner_10_ORA_A_coef.cub +mariner10/calibration/mariner_10_CLE_B_coef.cub +mariner10/calibration/mariner_10_ORA_B_coef.cub +mariner10/calibration/mariner_10_UV_B_coef.cub +clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/nir.addflats.dat +clementine1/calibration/uvvis/lua_comp_flat_long.cub +clementine1/calibration/uvvis/lue_uncomp_flat_long.cub +messenger/translations/ +messenger/templates/ +lo/templates/ +chandrayaan1/bandBin/ +chandrayaan1/translations/ +chandrayaan1/kernels/ +mer/translations/ +mro/templates/ +mro/calibration/ +mgs/calibration/ +mer/calibration/ +newhorizons/translations/ +rolo/translations/ +mex/translations/ +kaguya/translations/ +hayabusa/translations/ +galileo/translations/ +dawn/translations/ +rosetta/translations/ +clementine1/kernels/ +viking1/kernels/ +viking2/kernels/ +apollo15/kernels/ +cassini/calibration/darkcurrent/ +hayabusa/kernels/ +mariner10/kernels/ +odyssey/calibration/ +odyssey/testData/I51718010EDR.crop.proj.reduced.cub +cassini/testData/vims2.cub +galileo/calibration/gll_gain.sav +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +base/dems/ulcn2005_lpo_0004.cub +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +messenger/kernels/ck/msgr20080110.bc +mro/kernels/spk/mro_psp7.bsp +messenger/kernels/ck/msgr20111017.bc +mer/translations/merInstrument.trn +mer/translations/merInstrument.trn +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +cassini/testData/vims2.cub+100 +base/translations/ +mro/testData/ctx_pmoi_i_00003.bottom.cub +mrg_Global_512ppd_radius-demprep.cub +cassini/translations/ +chandrayaan1/translations/m3Instrument.trn +Clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/nirorbitflats/nir_orbflat_284_a.cub +clementine1/calibration/uvvis/dark_5_15_96.cub +dawn/translations/dawnfcArchive.trn +dawn/translations/dawnvirArchive.trn +galileo/translations/galileoNIMSInstrument.trn +galileo/calibration/darkcurrent/2f8.dc04.cub +galileo/calibration/darkcurrent/4f8.dc04.cub +hayabusa/translations/amicaArchive.trn +hayabusa/translations/nirsArchive.trn +kaguya/translations/kaguyamiInstrument.trn +kaguya/translations/tcmapInstrument.trn +kaguya/translations/mimapBandBin.trn +base/translations/pdsExportImageImage.typ +lro/translations/lronacArchive.trn +lro/translations/lronacPdsLabelExport.trn +lro/translations/lrowacArchive.trn +lro/translations/lrowacPdsLabelExport.trn +lro/translations/mrflev1Archive.trn +lro/translations/mrflev2Archive.trn +base/translations/pdsExportImageImage.typ +mariner10/calibration/mariner_10_blem_A.cub +mariner10/calibration/mariner_10_blem_B.cub +mer/translations/merInstrument.trn +messenger/translations/mdisBandBin.trn +base/translations/pdsExportImageImage.typ +messenger/translations/mdisBandBin.trn +mex/translations/hrscBandBin.trn +mex/translations/hrscBandBin.trn +base/translations/pdsExportImageImage.typ +mro/calibration/psf/PSF_IR.cub +newhorizons/translations/leisaArchive_fit.trn +newhorizons/translations/lorriBandBin_fit.trn +rolo/translations/roloInstrument.trn +rosetta/translations/osirisBandBin.trn +viking2/reseaus/nominal.pvl +apollo15/kernels/pck/moon_assoc_me.tf +base/dems/ulcn2005_lpo_0004.cub +cassini/kernels/pck/cpck21Apr2005.tpc +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +odyssey/kernels/sclk/ORB1_SCLKSCET.00200.tsc +odyssey/kernels/sclk/ORB1_SCLKSCET.00203.tsc +apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +hayabusa/dawn/DEM/vesta512.bds +messenger/kernels/ck/msgr20080109.bc +messenger/kernels/ck/msgr20111016.bc +apollo15/templates/apolloPanFiducialFinder.pvl +base/dems/ulcn2005_lpo_0004.cub +mer/translations/merInstrument.trn +mer/translations/merInstrument.trn +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +cassini/testData/vims2.cub+100 +base/translations/pdsExportImageImage.typ +mro/testData/ctx_pmoi_i_00003.bottom.cub +cassini/translations/narrowAngle.def +cassini/translations/wideAngle.def +chandrayaan1/translations/m3Instrument.trn +Clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/nirorbitflats/nir_orbflat_284_a.cub +clementine1/calibration/uvvis/dark_5_15_96.cub +hayabusa/dawn/DEM/vesta512.bds +dawn/translations/dawnfcArchive.trn +dawn/translations/dawnvirArchive.trn +galileo/translations/galileoNIMSInstrument.trn +galileo/calibration/darkcurrent/2f8.dc04.cub +galileo/calibration/darkcurrent/4f8.dc04.cub +hayabusa/translations/amicaArchive.trn +hayabusa/translations/nirsArchive.trn +kaguya/translations/kaguyamiInstrument.trn +kaguya/translations/tcmapInstrument.trn +kaguya/translations/mimapBandBin.trn +base/translations/pdsExportImageImage.typ +cassini/translations/narrowAngle.def +lro/translations/lronacArchive.trn +lro/translations/lronacPdsLabelExport.trn +lro/translations/lrowacArchive.trn +lro/translations/lrowacPdsLabelExport.trn +lro/translations/mrflev1Archive.trn +lro/translations/mrflev2Archive.trn +base/translations/pdsExportImageImage.typ +mariner10/calibration/mariner_10_blem_A.cub +mariner10/calibration/mariner_10_blem_B.cub +mer/translations/merInstrument.trn +messenger/translations/mdisBandBin.trn +base/translations/pdsExportImageImage.typ +messenger/translations/mdisBandBin.trn +mex/translations/hrscBandBin.trn +base/translations/pdsExportImageImage.typ +mro/calibration/psf/PSF_IR.cub +newhorizons/translations/leisaArchive_fit.trn +newhorizons/translations/lorriBandBin_fit.trn +rolo/translations/roloInstrument.trn +rosetta/translations/osirisBandBin.trn +rosetta/translations/osirisBandBin.trn +viking2/reseaus/nominal.pvl +apollo15/calibration/METRIC_flatfield.cub +apollo15/calibration/ApolloPanFiducialMark.cub +base/dems/ulcn2005_lpo_0004.cub +mer/translations/merStructure.trn +newhorizons/calibration/target-wavelengths-expanded.csv. +odyssey/testData/I10047011EDR.proj.reduced.cub +viking1/reseaus/vo1.visb.template.cub +cassini/testData/vims1.cub +base/translations/pdsExportRootGen.typ +mro/testData/ctx_pmoi_i_00003.bottom.cub +Apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +base/templates/maps/polarstereographic.map +base/templates/maps/simplecylindrical.map +cassini/translations/cassiniIss.trn +cassini/translations/vimsPds.trn +chandrayaan1/translations/m3Archive.trn +clementine1/translations/clementine.trn +Clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/newnir_flat_a.cub +clementine1/calibration/uvvis/uvvis.def +base/templates/cnet_validmeasure/validmeasure.def +base/templates/cnetref/cnetref_nooperator.def +base/templates/cnetref/cnetref_operator.def +base/templates/cnetref/cnetref_nooperator.def +base/templates/cnetstats/cnetstats.def +hayabusa/dawn/DEM/vesta512.bds +dawn/translations/dawnfcBandBin.trn +dawn/translations/dawnvirBandBin.trn +dawn/translations/dawnvirBandBin.trn +galileo/translations/galileoNIMSArchive.trn +galileo/translations/galileoSsi.trn +galileo/calibration/gll_dc.sav +hayabusa/translations/amicaBandBin.trn +hayabusa/translations/nirsInstrument.trn +kaguya/translations/kaguyamiArchive.trn +kaguya/translations/tcmapBandBin.trn +base/translations/pdsExportRootGen.typ +cassini/translations/cissua2isis.trn +lro/translations/lronacInstrument.trn +lro/translations/pdsExportRootGen.typ +lro/translations/lrowacInstrument.trn +lro/translations/pdsExportRootGen.typ +lro/translations/mrflev1BandBin.trn +lro/translations/mrflev2BandBin.trn +lro/translations/mrfExportRoot.typ +mariner10/reseaus/mar10VenusNominal.pvl +mariner10/translations/mariner10isis2.trn +mariner10/calibration/mariner_10_A_dc.cub +mariner10/calibration/mariner_10_B_dc.cub +mariner10/reseaus/mar10b.template.cub +mer/translations/merStructure.trn +messenger/translations/mdisInstrument.trn +messenger/translations/mdisInstrument.trn +base/translations/pdsExportRootGen.typ +messenger/testData/EW0031509051D.cub +messenger/testData/EN0089576657M.IMG +messenger/translations/mdisInstrument.trn +mex/translations/hrscInstrument.trn +mro/calibration/ctxFlat_0001.cub +mro/calibration/HiRISE_Gain_Drift_Correction_Bin2.0001.csv +mro/calibration/HiRISE_Gain_Drift_Correction_Bin4.0001.csv +mro/calibration/HiccdstitchOffsets.def +base/translations/pdsExportRootGen.typ +mro/calibration/hijitreg.p1745.s3070.def +output/PSP_007556_2010_RED4.balance.cropped.cub +mro/calibration/psf/PSF_BG.cub +near/translations/nearImportPdsLabel.trn +newhorizons/translations/leisaInstrument_fit.trn +newhorizons/translations/lorriInstrument_fit.trn +newhorizons/translations/mvicInstrument_fit.trn +rolo/translations/roloMapping.trn +rosetta/translations/osirisArchive.trn +viking1/reseaus/nominal.pvl +iking2/reseaus/nominal.pvl +voyager1/calibration/voylin.pvl +apollo15/kernels/pck/moon_080317.tf +viking1/kernels/sclk/vo1_fsc.tsc +base/dems/ulcn2005_lpo_0004.cub +cassini/kernels/fk/cas_v40.tf +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +lro/kernels/spk/fdf29r_2009182_2009213_v01.bsp +odyssey/kernels/fk/m01_v29.tf +cassini/kernels/sclk/cas00110.tsc +hayabusa/dawn/DEM/vesta512.bds +odyssey/kernels/sclk/ORB1_SCLKSCET.00174.tsc +galileo/kernels/sclk/mk00062b.tsc +messenger/kernels/ck/msgr20111015.bc +lro/kernels/spk/fdf29r_2012275_2012306_v01.bsp +apollo15/kernels/tspk/de421.bsp +viking1/kernels/sclk/vo1_fict.tsc +base/dems/ulcn2005_lpo_0004.cub +viking1/kernels/ck/vo1_sedr_ck2.bc +cassini/kernels/ck/05047_05052ra.bc +mro/kernels/ck/mro_sc_psp_061114_061120.bc +lro/kernels/tspk/de421.bsp +odyssey/kernels/ck/m01_sc_map7.bc +odyssey/kernels/ck/m01_sc_map5_rec_nadir.bc +odyssey/kernels/sclk/ORB1_SCLKSCET.00160.tsc +cassini/kernels/iak/vimsAddendum02.ti +viking1/kernels/sclk/vo1_fict.tsc +Apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +cassini/kernels/sclk/cas00106.tsc +clementine1/kernels/fk/clem_v10.tf +clementine1/kernels/iak/nirAddendum002.ti +hayabusa/dawn/DEM/vesta512.bds +odyssey/kernels/sclk/ORB1_SCLKSCET.00174.tsc +galileo/kernels/sclk/mk00062b.tsc +messenger/kernels/ck/msgr20111014.bc +apollo15/kernels/tspk/moon_pa_de421_1900-2050.bpc +viking1/kernels/iak/vikingAddendum003.ti +base/dems/ulcn2005_lpo_0004.cub +viking1/kernels/spk/vik1_ext.bsp +cassini/kernels/spk/050414RB_SCPSE_05034_05060.bsp +mro/kernels/spk/mro_psp1.bsp +lro/kernels/tspk/moon_pa_de421_1900-2050.bpc +odyssey/kernels/spk/m01_map7.bsp +odyssey/kernels/spk/m01_map5.bsp +odyssey/kernels/iak/themisAddendum003.ti +cassini/kernels/pck/cpck19Sep2007.tpc +mgs/kernels/iak/mocAddendum003.ti +viking1/kernels/fk/vo1_v10.tf +Apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +cassini/kernels/pck/cpck01Dec2006.tpc +base/dems/Ceres_Dawn_FC_HAMO_DTM_DLR_Global_60ppd_Oct2016_prep.cub +cassini/kernels/pck/cpck01Dec2006.tpc +mgs/kernels/sclk/MGS_SCLKSCET.00060.tsc +hayabusa/dawn/DEM/vesta512.bds +odyssey/kernels/iak/themisAddendum003.ti +galileo/kernels/iak/ssiAddendum004.ti +mro/kernels/spk/mro_psp22.bsp +messenger/kernels/ck/msgr20111013.bc +mro/kernels/spk/mro_psp22.bsp +base/templates/autoreg/findrx.def +viking2/reseaus/vo2.visb.template.cub +viking2/calibration/vik2evenMask.cub +voyager1/kernels/ +voyager1/calibration/NA1CLR.CAL.cub +voyager1/calibration/NA1OFF.CAL.cub +voyager1/calibration/voycal.pvl +voyager1/reseaus/vg1naMasterReseaus.pvl +voyager2/translations/ +voyager2/kernels/ +voyager2/reseaus/nominal.pvl +base/templates/maps/sinusoidal.map +base/applications/noprojInstruments001.pvl +base/applications/noprojInstruments002.pvl +base/applications/noprojInstruments003.pvl +messenger/kernels/ck/1018221575_197834_mdis_pivot_pvtres.bc +messenger/kernels/ck/1018290560_1175_mdis_atthist.bc +messenger/kernels/ck/msgr20120630.bc +messenger/kernels/ck/msgr20120629.bc +messenger/kernels/ck/msgr20120628.bc +messenger/kernels/ck/msgr20120627.bc +messenger/kernels/ck/msgr20120626.bc +messenger/kernels/ck/msgr20120625.bc +messenger/kernels/ck/msgr20120624.bc +messenger/kernels/ck/msgr20120623.bc +messenger/kernels/ck/msgr20120622.bc +messenger/kernels/ck/msgr20120621.bc +messenger/kernels/pck/kernels.0001.db +messenger/kernels/pck/kernels.0002.db +messenger/kernels/pck/kernels.0003.db +messenger/kernels/pck/kernels.0004.db +messenger/kernels/tspk/ +messenger/testData/EW0131770376G.equi.cub +mgs/calibration +mro/kernels/fk/ +mro/kernels/ik/ +mro/kernels/sclk/ +base/kernels/lsk/ +base/kernels/pck/ +base/kernels/spk/de118.bsp +base/kernels/spk/de245.bsp +base/kernels/spk/de405.bsp +base/testData/kernels/de405.bsp +base/kernels/spk/kernels.0001.db +base/kernels/spk/kernels.0002.db +base/testData/kernels/moc.bsp +base/testData/kernels/naif0007.tls +base/testData/kernels/moc.bc +base/testData/kernels/pck00006.tpc +base/testData/kernels/mocSpiceUnitTest.ti +base/testData/kernels/mocAddendum.ti +base/testData/kernels/MGS_SCLKSCET.00045.tsc +base/testData/kernels/moc13.ti +base/kernels/pck/pck00009.tpc +base/kernels/lsk/naif0009.tls +base/kernels/spk/de405.bsp +base/kernels/lsk/naif0009.tls +base/kernels/pck/pck00009.tpc +base/dems/kernels.0003.db +base/dems/kernels.0004.db +base/dems/kernels.0005.db +mgs/testData/ab102401.cub +base/templates/labels/CubeFormatTemplate.pft +mariner10/testData/0027399_clean_equi.cub +mgs/testData/ab102401.lev2.cub +odyssey/testData/I00824006RDR.lev2.cub +base/testData/blobTruth.cub +base/testData/isisTruth.cub +base/testData/isisTruth2.cub +base/testData/xmlTestLabel.xml +base/testData/f319b18_ideal.cub +base/translations/MissionName2DataDir.trn +base/translations/MissionName2DataDir.trn +messenger/testData/EW0211286081G.lev1.cub +messenger/testData/EW0131770376G.equi.cub +base/translations/NaifErrors.trn +mariner10/testData/0027399_clean_equi.cub +dawn/testData/FC21B0001010_09049002212F5D.cub +base/testData/LRONAC_M139722912RE_cropped.cub +base/dems/molaMarsPlanetaryRadius0004.cub +base/dems/molaMarsPlanetaryRadius0005.cub +viking2/testData/f348b26.cub +viking2/kernels/sclk/vo2_fict.tsc +viking2/kernels/iak/vikingAddendum003.ti +clementine1/testData/lna1391h.cub +base/testData/ab102401_ideal.cub +lo/testData/3133_h1.cub +mgs/kernels/ik/moc20.ti +mgs/kernels/iak/mocAddendum004.ti +mgs/kernels/sclk/MGS_SCLKSCET.00061.tsc +viking2/kernels/sclk/vo2_fsc.tsc +hayabusa/kernels/dsk/hay_a_amica_5_itokawashape_v1_0_512q.bds +hayabusa/kernels/pck/itokawa_gaskell_n3.tpc +hayabusa/kernels/tspk/de403s.bsp +hayabusa/kernels/tspk/sb_25143_140.bsp +hayabusa/kernels/spk/hay_jaxa_050916_051119_v1n.bsp +hayabusa/kernels/spk/hay_osbj_050911_051118_v1n.bsp +hayabusa/kernels/ck/hayabusa_itokawarendezvous_v02n.bc +hayabusa/kernels/fk/hayabusa_hp.tf +hayabusa/kernels/fk/itokawa_fixed.tf +hayabusa/kernels/ik/amica31.ti +hayabusa/kernels/iak/amicaAddendum001.ti +hayabusa/kernels/sclk/hayabusa.tsc +base/kernels/spk/de405.bsp +mgs/kernels/spk/mgs_ab1.bsp +mgs/testData/ab102402.lev2.cub +odyssey/testData/I02609002RDR.lev2.cub +mgs/kernels/ck/mgs_sc_ab1.bc +viking2/kernels/spk/vo2_rcon.bsp +apollo15/testData/AS15-M-0533.cropped.cub +apollo15/testData/TL.cub +cassini/testData/W1294561261_1.c2i.nospice.cub +cassini/testData/N1525100863_2.cub +cassini/testData/W1525116136_1.cub +odyssey/testData/I01523019RDR.lev2.cub +odyssey/testData/I01523019RDR.lev2.cub +messenger/testData/EW0131770381F.equi.cub +mariner10/testData/0166613_clean_equi.cub +lo/testData/3133_h1.cropped.cub +lo/testData/3083_med_tohi.cub +mgs/testData/fha00491.lev1.cub +mro/testData/frt0001cfd8_07_if124s_trr3_b24.cub +mro/testData/ctx_pmoi_i_00003.bottom.cub +mro/testData/PSP_001446_1790_BG12_0.cub +mro/testData/P12_005911_3396_MA_00N009W.cropped.cub +mro/kernels/ck/mro_crm_psp_080101_080131.bc +mro/kernels/ck/mro_sc_psp_080108_080114.bc +mro/kernels/spk/mro_psp6.bsp +mro/kernels/ck/mro_sc_psp_080304_080310.bc +mro/kernels/iak/hiriseAddendum006.ti +cassini/testData/N1355543510_1.c2i.nospice.cub +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +cassini/testData/CM_1515951157_1.ir.cub +clementine1/testData/lub5992r.292.lev1.phot.cub +messenger/testData/EW0213634118G.lev1.cub +galileo/testData/1213r.cub +lo/testData/3083_med_raw.cub +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +lo/testData/4008_med_res.cropped.cub +mro/testData/ctx_pmoi_i_00003.top.cub +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +lro/kernels/pck/moon_080317.tf +viking2/kernels/ck/vo2_sedr_ck2.bc +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +mariner10/kernels/iak/mariner10Addendum002.ti +base/kernels/fk/lunarMeanEarth001.tf +viking2/kernels/fk/vo2_v10.tf +lro/kernels/pck/moon_assoc_me.tf +mro/kernels/iak/mroctxAddendum004.ti +cassini/testData/N1536363784_1.c2i.spice.cub +apollo16/testData/AS16-M-0533.reduced.cub +lo/testData/4164H_Full_mirror.cub +lo/testData/5072_med_res.cropped.cub +cassini/testData/N1313633704_1.c2i.nospice.cub +clementine1/kernels/iak/uvvisAddendum003.ti +clementine1/kernels/ck/clem_5sc.bck +apollo15/kernels/iak/apolloPanAddendum001.ti +mariner10/kernels/sclk/mariner10.0001.tsc +hayabusa/testData/st_2530292409_v.cub +lo/testData/5006_high_res_1.cropped.cub +cassini/testData/CM_1514390782_1.ir.cub +clementine1/kernels/sclk/dspse002.tsc +cassini/kernels/pck/cpck14Feb2006.tpc +apollo15/testData/BL.cub +mro/testData/G02_019106_1390_XN_41S257W.cub +apollo17/testData/AS17-M-0543.reduced.cub +cassini/kernels/iak/vimsAddendum03.ti +base/dems/ulcn2005_lpo_0004.cub +base/dems/molaMarsPlanetaryRadius0001.cub +apollo15/testData/M.cub +mro/apps/hiequal/tsts/default/input/RED0.cub +cassini/kernels/sclk/cas00130.tsc +cassini/kernels/sclk/cas00112.tsc +cassini/testData/CM_1514390782_1.vis.cub +cassini/testData/CM_1515945709_1.ir.cub +cassini/kernels/pck/cpck21Mar2006.tpc +cassini/testData/CM_1515945709_1.vis.cub +cassini/testData/C1465336166_1.ir.cub +apollo15/testData/TR.cub +apollo15/testData/BR.cub +mgs/testData/ab102401.cub +base/templates/labels/MappingGroupKeywords.pft +odyssey/testData/I00824006RDR.lev2.cub +odyssey/testData/I56632006EDR.lev2.cub +odyssey/testData/I02609002RDR.lev2.cub +odyssey/testData/I01523019RDR.lev2.cub +viking2/reseaus/vik2bMasterReseaus.pvl +mgs/testData/m0402852.cub +mariner10/reseaus/mar10aMasterReseaus.pvl +lo/testData/3133_h1.cub +base/translations/NaifErrors.trn +base/testData/blobTruth.cub +base/testData/isisTruthNoSpacecraftName.cub +base/testData/isisTruthNoInstrumentId.cub +lo/testData/5106_h1.cropped.cub +lo/testData/5106_h2.cropped.cub +mgs/calibration/MGSC_1246_wago.tab +mgs/calibration/MGSC_1290_wago.tab +mgs/calibration/MGSC_1428_wago.tab +mgs/calibration/MGSC_1546_wago.tab +mgs/calibration/MGSC_1578_wago.tab +clementine1/kernels/ck/clem_ulcn2005_type2_1sc.bc +clementine1/kernels/fk/clem_v11.tf +clementine1/kernels/sclk/dspse002.tsc +clementine1/kernels/spk/SPKMERGE_940219_940504_CLEMV001b.bsp +clementine1/kernels/iak/uvvisAddendum003.ti +base/templates/maps/equirectangular.map +newhorizons/calibration/NHSmileDefinitionNew.cub +messenger/kernels/tspk/de423s.bsp +messenger/kernels/tspk/kernels.0001.db +messenger/kernels/tspk/kernels.0002.db +messenger/kernels/tspk/kernels.0003.db +messenger/kernels/spk/msgr_20040803_20150328_od332sc_0.bsp +messenger/kernels/spk/msgr_20040803_20150430_od431sc_2.bsp +messenger/kernels/sclk/messenger_1930.tsc +base/translations/pdsProjectionLineSampToXY.def +dawn/kernels/fk/ +dawn/kernels/iak/ +dawn/kernels/ik/ +dawn/kernels/pck/ +dawn/kernels/sclk/ +dawn/kernels/tspk/ +mro/kernels/fk/ +mro/kernels/iak/ +mro/kernels/ik/ +mro/kernels/sclk/ +cassini/kernels/spk/050105RB_SCPSE_04247_04336.bsp +newhorizons/kernels/fk/ +newhorizons/kernels/iak/ +newhorizons/kernels/ik/ +newhorizons/kernels/pck/ +newhorizons/kernels/sclk/ +newhorizons/kernels/spk/ +lro/kernels/ck/lrolc_2009243_2009274_v01.bc +mro/kernels/spk/mro_psp8.bsp +newhorizons/kernels/tspk/de413.bsp +lro/kernels/ck/moc42r_2009243_2009274_v08.bc +mro/kernels/ck/mro_sc_psp_080923_080929.bc +newhorizons/kernels/tspk/jup260.bsp +near/kernels/fk/ +newhorizons/kernels/ck/merged_nhpc_2007_v006.bc +''' + + dbList = ''' +newhorizons/kernels/ck/ +near/kernels/ck/ +dawn/kernels/ck/ +dawn/kernels/pck/ +mro/kernels/ +messenger/kernels/ +messenger/kernels/spk/ +apollo15/kernels/ +base/translations/ +lo/translations/ +mgs/translations/ +odyssey/translations/ +odyssey/kernels/ck/ +odyssey/kernels/ik/ +odyssey/kernels/iak/ +odyssey/kernels/sclk/ +odyssey/kernels/fk/ +odyssey/kernels/spk/ +mro/translations/ +voyager1/kernels/ +mgs/kernels/ +cassini/kernels/ +cassini/calibration/ +lro/calibration/ +lro/kernels/ +messenger/calibration/ +newhorizons/kernels/ +base/dems/ +base/translations/ +''' + + fileList = fileList.split() + dbList = dbList.split() + + # TODO: Input argument + installDir = '/home/smcmich1/release_isis/isis3data/' + #installDir = '/Users/smcmich1/release_isis/isis3data/' + + cmd = 'rsync -azv --delete --partial ' + remote = 'isisdist.astrogeology.usgs.gov::isis3data/data/' + + for f in fileList: + + # Set up commands + target = installDir + f + + print target + + # Don't refetch existing files + if os.path.exists(target) and (not os.path.isdir(target)): + continue + + # Fetch the file + fullCmd = cmd + remote + f +' '+ target + print fullCmd + os.system('mkdir -p ' + os.path.dirname(target)) + os.system(fullCmd) + + # This is for folders where we want just the small files + for f in dbList: + fullCmd = (cmd + remote + f+' --max-size=3m ' + installDir+f) + print fullCmd + os.system('mkdir -p '+ installDir +f) + os.system(fullCmd) + + + +if __name__ == '__main__': + sys.exit( main() ) diff --git a/isis/scripts/isis3Startup.csh b/isis/scripts/isis3Startup.csh index a237ab10bc0dfe9710a7d35c74cf31273bcca6cc..1d76bec235fab905f1f6174f2df0b501f8efe36b 100755 --- a/isis/scripts/isis3Startup.csh +++ b/isis/scripts/isis3Startup.csh @@ -24,6 +24,8 @@ # to "/usgs/cpkgs/isis3/testData" # SEP 08 2017 - Christopher Combs - Removed setting of QT_PLUGIN_PATH as # an environment variable. Fixes #4617 +# NOV 15 2018 - Jesse Mapel - Changed default ISISROOT to new install +# directory. #_VER $Id: isis3Startup.csh,v 1.5 2010/03/16 19:40:22 ehyer Exp $ #_END ################################################################################ @@ -34,7 +36,7 @@ set Platform = `uname -s` # Initialize the ISISROOT environment variable if it doesn't exist # TODO: Test is obsolete, fail if no isisroot is set if ($?ISISROOT == 0) then - setenv ISISROOT /usgs/pkgs/isis3/isis + setenv ISISROOT /usgs/pkgs/isis3/install endif # Initialize the ISIS3DATA environment variable diff --git a/isis/scripts/isis3Startup.py b/isis/scripts/isis3Startup.py index cbdaf95424078892c19b8d693bea4d17b6b44b55..e9d436e1c9008d87b22b6971627a20441fb3a4b4 100755 --- a/isis/scripts/isis3Startup.py +++ b/isis/scripts/isis3Startup.py @@ -12,7 +12,7 @@ def setisis(): #... and if it's not give it a default value if ISISROOT is None: - ISISROOT = "/usgs/pkgs/isis3/isis" + ISISROOT = "/usgs/pkgs/isis3/install" os.environ['ISISROOT'] = ISISROOT #Check for the ISIS3DATA directory. If it does not exist use a default diff --git a/isis/scripts/isis3Startup.sh b/isis/scripts/isis3Startup.sh index de0dfcac526bde1be8ee6a78f93d00dbe827351a..e87d03a13eae391eb193b5aee036191bb064de1f 100755 --- a/isis/scripts/isis3Startup.sh +++ b/isis/scripts/isis3Startup.sh @@ -12,7 +12,7 @@ # the Isis distribution # if [ ! "$ISISROOT" ]; then - ISISROOT=/usgs/pkgs/isis3/isis + ISISROOT=/usgs/pkgs/isis3/install export ISISROOT fi @@ -37,7 +37,3 @@ else PATH="$ISISROOT/bin" fi export PATH - -# Create QT_PLUGIN_PATH env variable -QT_PLUGIN_PATH="$ISISROOT/3rdParty/plugins" -export QT_PLUGIN_PATH diff --git a/isis/scripts/isis3VarInit.py b/isis/scripts/isis3VarInit.py new file mode 100755 index 0000000000000000000000000000000000000000..cdb0fee7feb8b5e403723691174c026b4fe7cdc9 --- /dev/null +++ b/isis/scripts/isis3VarInit.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +"""This program builds shell scripts that define ISIS3 environment variables during conda environment activation and deactivation, and creates some directories.""" + +import argparse +import os +import sys + +########################################################################################################## +# +# This work is free and unencumbered software released into the public domain. +# 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. +# +# +# Description: This program builds the shell scripts that define the +# ISISROOT/ISIS3DATA/ISIS3TESTDATA environment variables for the user +# when the ISIS3 conda environment is activated, and clean up when it is +# deactivated. +# +# The data directory and test directory are optional command line arguments. +# If the user chooses not to set them, they will both be created in the +# $ISISROOT directory. +# +# History: +# Author: Tyler Wilson, USGS +# Date: 2018-10-05 +# Description: Initial commit. +# +# Author: Tyler Wilson, USGS +# Date: 2018-11-01 +# Description: Removed a pair of lines which were causing output errors on Mac OS X and were not +# required anyway. +# +# Author: Ross Beyer +# Date: 2018-11-19 +# Description: Streamlined the program, improved documentation, and made the directory and +# file creation more `pythonic' rather than using system calls. +# +# +########################################################################################################## + +# There are still a lot of Python 2 installations out there, and if people don't have +# their conda environment set up properly, the error message they'll get will be hard +# to decipher. This might help: +assert( sys.version_info >= (3,2) ) # Must be using Python 3.2 or later, is conda set up? + + +# This just wraps and reports on the directory creation: +def mkdir( p ): + if os.path.exists( p ): print( 'Tried to create '+p+', but it already exists.' ) + else: + os.makedirs( p ) + print( 'Created '+p ) + return + + +# Set up and then parse the command line: +parser = argparse.ArgumentParser( description=__doc__ ) + +parser.add_argument('-d','--data-dir', + default=os.environ['CONDA_PREFIX']+'/data', + help='ISIS3 Data Directory, default: %(default)s' ) +parser.add_argument('-t','--test-dir', + default=os.environ['CONDA_PREFIX']+'/testData', + help='ISIS3 Test Data Directory, default: %(default)s') +args=parser.parse_args() + + +# Create the data directories: +mkdir( args.data_dir ) +mkdir( args.test_dir ) + +# Create the conda activation and deactivation directories: +activate_dir = os.environ['CONDA_PREFIX']+'/etc/conda/activate.d' +deactivate_dir = os.environ['CONDA_PREFIX']+'/etc/conda/deactivate.d' + +mkdir( activate_dir ) +mkdir( deactivate_dir ) + +# Write the files that manage the ISIS3 environments: +activate_vars = activate_dir+'/env_vars.sh' +deactivate_vars = deactivate_dir+'/env_vars.sh' + +with open( activate_vars, mode='w' ) as a: + a.write('#!/bin/sh\n') + a.write('export ISISROOT='+ os.environ['CONDA_PREFIX']+'\n') + a.write('export ISIS3DATA='+ args.data_dir +'\n') + a.write('export ISIS3TESTDATA='+ args.test_dir +'\n') +print( 'Wrote '+activate_vars ) + +with open( deactivate_vars, mode='w' ) as d: + d.write('#!/bin/sh\n') + d.write('unset ISISROOT\n') + d.write('unset ISIS3DATA\n') + d.write('unset ISIS3TESTDATA\n') +print( 'Wrote '+deactivate_vars ) diff --git a/isis/scripts/makeOutput.py b/isis/scripts/makeOutput.py new file mode 100755 index 0000000000000000000000000000000000000000..387be1f3ecb76eceff13f726bbaab37960457a6f --- /dev/null +++ b/isis/scripts/makeOutput.py @@ -0,0 +1,90 @@ +''' +Script to create truthData for tests. + +For output it expects the command in the form of: + python3 makeOutput.py test + +where test is the cmake name for the unit or app test + +To check in truth data the command should be in the form of: + python makeOutput.py -t test + +The -t option checks in truth data + +The unit tests are pretty trivial because the executable outputs the results of +the unitTest to stdout and stderr so we just redirect the streams to the file +named object.truth where object is the ISIS object being tested. + +The app tests output has to rely on the old make system because the app test +infrastructure relies on the old make system. Otherwise all the logic for the old +makesystem would need to be reimplemented here. Because we wish to replace the testing +system with something that allows unit and app test to live in the same space the effort +to recreate the logic is not worth the outcome. +''' + +import argparse +import sys +import os + +try: + builddir = os.environ['ISISROOT'] +except KeyError: + print("The $ISISROOT environment variable is not set") + +parser = argparse.ArgumentParser() +parser.add_argument('test', action='store', help='Provide the name of the Test to create output of') +parser.add_argument('-t', action='store_true', default=False, dest='truth', help='Flag whether output is sent to truth data') +userInput = parser.parse_args() +testInput = userInput.test + +if "_unit_" in testInput: + unitTestName = testInput.split("_test_")[1] + truthFileName = unitTestName + ".truth" + + # We need to run the unit test from the object's directory because + # some tests have an xml file in the object's directory. If we ran the + # unit test from /unitTest, these files would not be able to be opened. + with open(builddir + "/objects/CTestTestfile.cmake") as testFile: + for line in testFile: + if "/" + unitTestName + "/" in line: + unitTestSrcPath = line.split("\" \"")[2][13:].split(unitTestName + "/")[0] + unitTestName + "/" + if not os.path.exists(unitTestSrcPath + "unitTest"): + os.system("ln -s " + builddir + "/unitTest/" + testInput + " " + unitTestSrcPath + "unitTest") + os.system(unitTestSrcPath + "unitTest" + ">& " + builddir + "/testOutputDir/" + truthFileName) + print("Unit Test Output In " + builddir + "/testOutputDir/ As " + truthFileName) + break + + if userInput.truth: + os.system("cp -f " + builddir + "/testOutputDir/" + truthFileName + " " + unitTestSrcPath + truthFileName) + print("Checked In Truth Data To " + unitTestSrcPath) + +else: + apptest = testInput + makefilePath = "" + with open(builddir + "/objects/CTestTestfile.cmake") as testFile: + for line in testFile: + if apptest in line: + makefilePath = line.split("\" \"")[1][11:] + break + + makefilePath = makefilePath.split("/") + del makefilePath[-1] + makefilePath = "/".join(makefilePath) + + # change dir to test dir and run make commands + os.chdir(makefilePath) + os.system("make checkout") + os.system("make output") + os.system("make truthdata") + os.system("rm -rf " + builddir + "/testOutputDir/truth") + os.system("cp -rf truth " + builddir + "/testOutputDir") + print("App Test Output In " + builddir + "/testOutputDir/truth") + + # check if the user wants data checked in + if userInput.truth: + os.system("make checkin") + print("Checked In Truth Data") + + # doing this instead of make release because make release + # can give feedback to the user that we would rather avoid + os.system("rm -rf input output truth print.prt") diff --git a/isis/sipfiles/BundleAdjust.sip b/isis/sipfiles/BundleAdjust.sip new file mode 100644 index 0000000000000000000000000000000000000000..3365780bffaf8064cb210379cd5485f3b3766d44 --- /dev/null +++ b/isis/sipfiles/BundleAdjust.sip @@ -0,0 +1,42 @@ +// SIP Wrapper to the ISIS3 bundle class +%Include type_conversions.sip + + +namespace Isis { + class BundleAdjust : public QObject { + %TypeHeaderCode + #include "BundleAdjust.h" + #include "IException.h" + %End + + public: + // Stuff in the square brackets [] indicate the C++ interface while the sip + // function name indicates the C python function interface + BundleAdjust(PyObject* settings, const QString &cnetFile, const QString &cubeList, bool printSummary = true) throw(Isis::IException) [(QSharedPointer, QString, QString, bool)]; + %MethodCode + int sipErr = 0; + QSharedPointer *wrappedSettings = new QSharedPointer(); + + Isis::BundleSettings *settings = (Isis::BundleSettings*) sipConvertToType(a0, sipType_Isis_BundleSettings, NULL, SIP_NOT_NONE, NULL, &sipErr); + wrappedSettings->reset(settings); + try { + sipCpp = new sipIsis_BundleAdjust(*wrappedSettings, *a1, *a2, a3); + } + catch (Isis::IException &error) { + PyErr_SetString(sipException_Isis_IException, error.what()); + return NULL; + } + %End + + Isis::BundleSolutionInfo* solveCholeskyBR(); + %MethodCode + try { + return sipConvertFromType(sipCpp->solveCholeskyBR(), sipType_Isis_BundleSolutionInfo, NULL); + } + catch (Isis::IException &error) { + PyErr_SetString(sipException_Isis_IException, error.what()); + return NULL; + } + %End + }; +}; diff --git a/isis/sipfiles/BundleControlPoint.sip b/isis/sipfiles/BundleControlPoint.sip new file mode 100644 index 0000000000000000000000000000000000000000..934b00bc9426ee359e0df5212b041f4614dc29f3 --- /dev/null +++ b/isis/sipfiles/BundleControlPoint.sip @@ -0,0 +1,68 @@ +namespace Isis { + class BundleControlPoint { + + %TypeHeaderCode + #include "BundleControlPoint.h" + #include + %End + + public: + + SIP_PYTYPE measures() throw(Isis::IException); + %MethodCode + size_t size = sipCpp->size(); + + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + Isis::BundleMeasure* cppMeasure = sipCpp->at(i).data(); + + PyObject *pyMeasure = sipConvertFromType((void*)(cppMeasure), sipType_Isis_BundleMeasure, NULL); + PyList_SetItem(l, i, pyMeasure); + } + + return l; + + %End + + // BundleControlPoint(ControlPoint *point); // default constructor + BundleControlPoint(const Isis::BundleControlPoint &src) throw(Isis::IException); + ~BundleControlPoint(); + + // copy + void copy(const Isis::BundleControlPoint &src) throw(Isis::IException); + + // mutators + // QSharedPointer addMeasure(ControlMeasure *controlMeasure); + void computeResiduals() throw(Isis::IException); + void setNumberOfRejectedMeasures(int numRejected) throw(Isis::IException); + void setRejected(bool reject) throw(Isis::IException); + void setWeights(const QSharedPointer settings, double metersToRadians) throw(Isis::IException); + void zeroNumberOfRejectedMeasures() throw(Isis::IException); + + // accessors + bool isRejected() const throw(Isis::IException); + int numberOfMeasures() const throw(Isis::IException); + int numberOfRejectedMeasures() const throw(Isis::IException); + double residualRms() const throw(Isis::IException); + QString id() const throw(Isis::IException); + Isis::ControlPoint::PointType type() const throw(Isis::IException); + + // string format methods + QString formatBundleOutputSummaryString(bool errorPropagation) const throw(Isis::IException); + QString formatBundleOutputDetailString(bool errorPropagation, double RTM, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/; + QString formatValue(double value, int fieldWidth, int precision) throw(Isis::IException); + QString formatAprioriSigmaString(int type, int fieldWidth, int precision, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/; + QString formatLatitudeAprioriSigmaString(int fieldWidth, int precision) const throw(Isis::IException); + QString formatLongitudeAprioriSigmaString(int fieldWidth, int precision) const throw(Isis::IException); + QString formatRadiusAprioriSigmaString(int fieldWidth, int precision, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/; + QString formatAdjustedSigmaString(int type, int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + QString formatLatitudeAdjustedSigmaString(int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + QString formatLongitudeAdjustedSigmaString(int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + QString formatRadiusAdjustedSigmaString(int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + + }; +}; diff --git a/isis/sipfiles/BundleImage.sip b/isis/sipfiles/BundleImage.sip new file mode 100644 index 0000000000000000000000000000000000000000..bf8d975d4c0a4b5153298bcd2170bd53cba8449c --- /dev/null +++ b/isis/sipfiles/BundleImage.sip @@ -0,0 +1,16 @@ +namespace Isis { + class BundleImage /NoDefaultCtors/ { + %TypeHeaderCode + #include "BundleImage.h" + %End + %InstanceCode + sipCpp = new Isis::BundleImage(NULL, "", ""); + %End + public: + + + // QSharedPointer parentObservation(); + QString serialNumber() throw(Isis::IException); + QString fileName() throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/BundleMeasure.sip b/isis/sipfiles/BundleMeasure.sip new file mode 100644 index 0000000000000000000000000000000000000000..fd2a02942c43eeb0ffa8b4eed656df4059059041 --- /dev/null +++ b/isis/sipfiles/BundleMeasure.sip @@ -0,0 +1,30 @@ +%Include type_conversions.sip + +namespace Isis { + class BundleMeasure /NoDefaultCtors/ { + %TypeHeaderCode + #include "BundleMeasure.h" + %End + + public: + + bool isRejected() const throw(Isis::IException); + // Camera *camera() const; + // Isis::BundleControlPoint *parentControlPoint(); + QSharedPointer parentBundleImage() throw(Isis::IException); + // QSharedPointer parentBundleObservation(); + // const QSharedPointer observationSolveSettings(); + + double sample() const throw(Isis::IException); + double sampleResidual() const throw(Isis::IException); + double line() const throw(Isis::IException); + double lineResidual() const throw(Isis::IException); + double residualMagnitude() const throw(Isis::IException); + QString cubeSerialNumber() const throw(Isis::IException); + double focalPlaneComputedX() const throw(Isis::IException); + double focalPlaneComputedY() const throw(Isis::IException); + double focalPlaneMeasuredX() const throw(Isis::IException); + double focalPlaneMeasuredY() const throw(Isis::IException); + int observationIndex() const throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/BundleObservationSolveSettings.sip b/isis/sipfiles/BundleObservationSolveSettings.sip new file mode 100644 index 0000000000000000000000000000000000000000..89b28277c0d18004d5feb9c4c3f7542cb84cf7b6 --- /dev/null +++ b/isis/sipfiles/BundleObservationSolveSettings.sip @@ -0,0 +1,59 @@ + +%Import QtCore/QtCoremod.sip +%Import QtXml/QtXmlmod.sip + +namespace Isis{ + class BundleObservationSolveSettings { + %TypeHeaderCode + #include "BundleObservationSolveSettings.h" + %End + public: + + enum InstrumentPointingSolveOption { + NoPointingFactors = 0, /**< Solve for none of the pointing factors.*/ + AnglesOnly = 1, /**< Solve for pointing angles: right ascension, declination + and, optionally, twist.*/ + AnglesVelocity = 2, //!< Solve for pointing angles and their angular velocities. + AnglesVelocityAcceleration = 3, /**< Solve for pointing angles, their velocities and their + accelerations.*/ + AllPointingCoefficients = 4 /**< Solve for all coefficients in the polynomials fit to + the pointing angles.*/ + }; + + //! Options for how to solve for instrument position + enum InstrumentPositionSolveOption { + NoPositionFactors = 0, /**< Solve for none of the position factors.*/ + PositionOnly = 1, /**< Solve for instrument positions only.*/ + PositionVelocity = 2, /**< Solve for instrument positions and velocities.*/ + PositionVelocityAcceleration = 3, /**< Solve for instrument positions, velocities, and + accelerations.*/ + AllPositionCoefficients = 4 /**< Solve for all coefficients in the polynomials fit to + the instrument positions.*/ + }; + + BundleObservationSolveSettings() throw(Isis::IException); + InstrumentPositionSolveOption stringToInstrumentPositionSolveOption(QString option) throw(Isis::IException); + InstrumentPointingSolveOption stringToInstrumentPointingSolveOption(QString option) throw(Isis::IException); + + void setInstrumentPositionSettings(InstrumentPositionSolveOption option, + int spkDegree = 2, + int spkSolveDegree = 2, + bool positionOverHermite = false, + double positionAprioriSigma = -1.0, + double velocityAprioriSigma = -1.0, + double accelerationAprioriSigma = -1.0) throw(Isis::IException) /KeywordArgs="Optional"/; + + + void setInstrumentPointingSettings(InstrumentPointingSolveOption option, + bool solveTwist, + int ckDegree = 2, + int ckSolveDegree = 2, + bool solvePolynomialOverExisting = false, + double anglesAprioriSigma = -1.0, + double angularVelocityAprioriSigma = -1.0, + double angularAccelerationAprioriSigma = -1.0) throw(Isis::IException) /KeywordArgs="Optional"/; + + + + }; +}; diff --git a/isis/sipfiles/BundleResults.sip b/isis/sipfiles/BundleResults.sip new file mode 100644 index 0000000000000000000000000000000000000000..777ae54aedd4579a6d2b6f4e3311083cf0a911ac --- /dev/null +++ b/isis/sipfiles/BundleResults.sip @@ -0,0 +1,125 @@ +%Include Statistics.sip +%Include type_conversions.sip + + +namespace Isis { + class BundleResults : public QObject { + %TypeHeaderCode + #include "BundleResults.h" + %End + + public: + BundleResults(const Isis::BundleResults &src); + void initialize(); + + void resizeSigmaStatisticsVectors(int numberImages); + // void setRmsImageResidualLists(QList rmsImageLineResiduals, + // QList rmsImageSampleResiduals, + // QList rmsImageResiduals); + // void setRmsImageResidualLists(QVector rmsImageLineResiduals, + // QVector rmsImageSampleResiduals, + // QVector rmsImageResiduals); + // void setSigmaLatitudeRange(Distance minLatDist, Distance maxLatDist, + // QString minLatPointId, QString maxLatPointId); + // void setSigmaLongitudeRange(Distance minLonDist, Distance maxLonDist, + // QString minLonPointId, QString maxLonPointId); + // void setSigmaRadiusRange(Distance minRadDist, Distance maxRadDist, + // QString minRadPointId, QString maxRadPointId); + void setRmsFromSigmaStatistics(double rmsFromSigmaLatStats, + double rmsFromSigmaLonStats, + double rmsFromSigmaRadStats); + + void printMaximumLikelihoodTierInformation() throw(Isis::IException); + void incrementMaximumLikelihoodModelIndex() throw(Isis::IException); + + void incrementFixedPoints() throw(Isis::IException); + int numberFixedPoints() const throw(Isis::IException); + void incrementHeldImages() throw(Isis::IException); + int numberHeldImages() const throw(Isis::IException); + void incrementIgnoredPoints() throw(Isis::IException); + int numberIgnoredPoints() const throw(Isis::IException); // currently unused ??? + void setRejectionLimit(double rejectionLimit) throw(Isis::IException); + void setRmsXYResiduals(double rx, double ry, double rxy) throw(Isis::IException); + + void setNumberRejectedObservations(int numberObservations) throw(Isis::IException); + void setNumberObservations(int numberObservations) throw(Isis::IException); + void setNumberImageParameters(int numberParameters) throw(Isis::IException); // ??? this is the same value an m_nRank + void resetNumberConstrainedPointParameters() throw(Isis::IException); + void incrementNumberConstrainedPointParameters(int incrementAmount) throw(Isis::IException); + void resetNumberConstrainedImageParameters() throw(Isis::IException); + void incrementNumberConstrainedImageParameters(int incrementAmount) throw(Isis::IException); + void resetNumberConstrainedTargetParameters() throw(Isis::IException); + void incrementNumberConstrainedTargetParameters(int incrementAmount) throw(Isis::IException); + void setNumberUnknownParameters(int numberParameters) throw(Isis::IException); + void computeDegreesOfFreedom() throw(Isis::IException); + + void computeSigma0(double dvtpv, Isis::BundleSettings::ConvergenceCriteria criteria) throw(Isis::IException); + void setDegreesOfFreedom(double degreesOfFreedom) throw(Isis::IException); + void setSigma0(double sigma0) throw(Isis::IException); + void setElapsedTime(double time) throw(Isis::IException); + void setElapsedTimeErrorProp(double time) throw(Isis::IException); + void setRadiansToMeters(double rtm) throw(Isis::IException); + void setConverged(bool converged) throw(Isis::IException); // or initialze method + // void setBundleControlPoints(QVector controlPoints); + // void setOutputControlNet(QSharedPointer outNet); + void setIterations(int iterations) throw(Isis::IException); + // void setObservations(BundleObservationVector observations) throw(Isis::IException); + + QList rmsImageSampleResiduals() const throw(Isis::IException); + QList rmsImageLineResiduals() const throw(Isis::IException); + QList rmsImageResiduals() const throw(Isis::IException); + QVector rmsImageXSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageYSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageZSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageRASigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageDECSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageTWISTSigmas() const throw(Isis::IException); // currently unused ??? + + // Distance minSigmaLatitudeDistance() const throw(Isis::IException); + // Distance maxSigmaLatitudeDistance() const throw(Isis::IException); + // Distance minSigmaLongitudeDistance() const throw(Isis::IException); + // Distance maxSigmaLongitudeDistance() const throw(Isis::IException); + // Distance minSigmaRadiusDistance() const throw(Isis::IException); + // Distance maxSigmaRadiusDistance() const throw(Isis::IException); + + QString maxSigmaLatitudePointId() const throw(Isis::IException); + QString minSigmaLatitudePointId() const throw(Isis::IException); + QString minSigmaLongitudePointId() const throw(Isis::IException); + QString maxSigmaLongitudePointId() const throw(Isis::IException); + QString minSigmaRadiusPointId() const throw(Isis::IException); + QString maxSigmaRadiusPointId() const throw(Isis::IException); + double sigmaLatitudeStatisticsRms() const throw(Isis::IException); + double sigmaLongitudeStatisticsRms() const throw(Isis::IException); + double sigmaRadiusStatisticsRms() const throw(Isis::IException); + double rmsRx() const throw(Isis::IException); // currently unused ??? + double rmsRy() const throw(Isis::IException); // currently unused ??? + double rmsRxy() const throw(Isis::IException); // currently unused ??? + double rejectionLimit() const throw(Isis::IException); + double radiansToMeters() const throw(Isis::IException); + int numberRejectedObservations() const throw(Isis::IException); + int numberObservations() const throw(Isis::IException); + + int numberImageParameters() const throw(Isis::IException); // ??? this is the same value an m_nRank + int numberConstrainedPointParameters() const throw(Isis::IException); + int numberConstrainedImageParameters() const throw(Isis::IException); + int numberConstrainedTargetParameters() const throw(Isis::IException); + int numberUnknownParameters() const throw(Isis::IException); + int degreesOfFreedom() const throw(Isis::IException); + double sigma0() const throw(Isis::IException); + double elapsedTime() const throw(Isis::IException); + double elapsedTimeErrorProp() const throw(Isis::IException); + bool converged() const throw(Isis::IException); // or initialze method + + QVector > &bundleControlPoints(); + QSharedPointer outputControlNet() const throw(Isis::IException); + + int iterations() const throw(Isis::IException); + + int numberMaximumLikelihoodModels() const throw(Isis::IException); + int maximumLikelihoodModelIndex() const throw(Isis::IException); + double maximumLikelihoodMedianR2Residuals() const throw(Isis::IException); + double maximumLikelihoodModelQuantile(int modelIndex) const throw(Isis::IException); + + }; + +}; diff --git a/isis/sipfiles/BundleSettings.sip b/isis/sipfiles/BundleSettings.sip new file mode 100644 index 0000000000000000000000000000000000000000..b6f9799ab4ee37c1413122dbb13b4cd5c1959683 --- /dev/null +++ b/isis/sipfiles/BundleSettings.sip @@ -0,0 +1,113 @@ +%Include BundleObservationSolveSettings.sip +%Include MaximumLikelihoodWFunctions.sip + +%Include type_conversions.sip + +namespace Isis { + + class BundleSettings { + %TypeHeaderCode + #include "BundleSettings.h" + #include "BundleObservationSolveSettings.h" + #include + %End + public: + + enum ConvergenceCriteria { + Sigma0, /**< The value of sigma0 will be used to determine that the bundle + adjustment has converged.*/ + ParameterCorrections /**< All parameter corrections will be used to determine that the + bundle adjustment has converged.*/ + }; + + // enum MaximumLikelihoodModel { + // NoMaximumLikelihoodEstimator, + // Huber, + // ModifiedHuber, + // Welsch, + // Chen + // }; + + BundleSettings() throw(Isis::IException); + + void setValidateNetwork(bool) throw(Isis::IException); + + void setSolveOptions(bool solveObservationMode = false, + bool updateCubeLabel = false, + bool errorPropagation = false, + bool solveRadius = false, + double globalLatitudeAprioriSigma = Isis::Null, + double globalLongitudeAprioriSigma = Isis::Null, + double globalRadiusAprioriSigma = Isis::Null) throw(Isis::IException) /KeywordArgs="Optional"/; + + void setOutlierRejection(bool outlierRejection, + double multiplier = 1.0) throw(Isis::IException); + + bool solveObservationMode() const throw(Isis::IException); + bool solveRadius() const throw(Isis::IException); + bool updateCubeLabel() const throw(Isis::IException); + bool errorPropagation() const throw(Isis::IException); + bool outlierRejection() const throw(Isis::IException); + double outlierRejectionMultiplier() const throw(Isis::IException); + double globalLatitudeAprioriSigma() const throw(Isis::IException); + double globalLongitudeAprioriSigma() const throw(Isis::IException); + double globalRadiusAprioriSigma() const throw(Isis::IException); + + int numberSolveSettings() const throw(Isis::IException); + Isis::BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const throw(Isis::IException); + Isis::BundleObservationSolveSettings observationSolveSettings(int n) const throw(Isis::IException); + + void setObservationSolveOptions(QList); + // %MethodCode + // Py_ssize_t size = PyList_Size(a0); + // QList *cppSettingsList = new QList(); + // int sipErr = 0; + // for(int i = 0; i < size; i++) { + // PyObject *pyStat = PyList_GET_ITEM(a0, i); + // Isis::BundleObservationSolveSettings *settings = (Isis::BundleObservationSolveSettings*)sipConvertToType(pyStat, sipType_Isis_BundleObservationSolveSettings, NULL, SIP_NOT_NONE, NULL, &sipErr); + // cppSettingsList->append(*settings); + // } + // + // sipCpp->setObservationSolveOptions(*cppSettingsList); + // %End + + SIP_PYLIST maximumLikelihoodEstimatorModels() const throw(Isis::IException); + %MethodCode // convert QList to Python list if tuples + typedef Isis::MaximumLikelihoodWFunctions::Model Model; + size_t size = sipCpp->maximumLikelihoodEstimatorModels().size(); + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + // get the two items from the QPair + Model *model = new Model(sipCpp->maximumLikelihoodEstimatorModels()[i].first); + double doubl = sipCpp->maximumLikelihoodEstimatorModels()[i].second; + + // Convert the two items to PyObjects + PyObject *first = sipConvertFromType((void*)(model), sipType_Isis_MaximumLikelihoodWFunctions_Model, NULL); + PyObject *second = PyFloat_FromDouble(doubl); + + // set the tuple items + PyObject *tuple = PyTuple_New(2); + PyTuple_SetItem(tuple, 0, first); + PyTuple_SetItem(tuple, 1, second); + + // Add new tuple to list + PyList_SetItem(l, i, tuple); + } + return l; + %End + + + int numberTargetBodyParameters() const throw(Isis::IException); + bool solveTargetBody() const throw(Isis::IException); + bool solvePoleRA() const throw(Isis::IException); + bool solvePoleRAVelocity() const throw(Isis::IException); + bool solvePoleDec() const throw(Isis::IException); + bool solvePoleDecVelocity() const throw(Isis::IException); + bool solvePM() const throw(Isis::IException); + bool solvePMVelocity() const throw(Isis::IException); + bool solvePMAcceleration() const throw(Isis::IException); + bool solveTriaxialRadii() const throw(Isis::IException); + bool solveMeanRadius() const throw(Isis::IException); + + }; +}; diff --git a/isis/sipfiles/BundleSolutionInfo.sip b/isis/sipfiles/BundleSolutionInfo.sip new file mode 100644 index 0000000000000000000000000000000000000000..a43fba1bd763c1169b861bc4bccdda657682f149 --- /dev/null +++ b/isis/sipfiles/BundleSolutionInfo.sip @@ -0,0 +1,26 @@ + +%Include type_conversions.sip + +namespace Isis{ + +class BundleSolutionInfo : public QObject { + %TypeHeaderCode + #include "BundleSolutionInfo.h" + %End + + public: + // do constructor since at the moment there doesn't seem to be a reason to contruct it directly in the python side + void setOutputStatistics(Isis::BundleResults statisticsResults) throw(Isis::IException); + void setRunTime(QString runTime) throw(Isis::IException); + + QString id() const throw(Isis::IException); + QSharedPointer bundleSettings() throw(Isis::IException); + Isis::BundleResults bundleResults() throw(Isis::IException); + QString runTime() const throw(Isis::IException); + + bool outputText() throw(Isis::IException); + bool outputPointsCSV() throw(Isis::IException); + bool outputResiduals() throw(Isis::IException); + + }; // end namespace Isis +}; diff --git a/isis/sipfiles/ControlNet.sip b/isis/sipfiles/ControlNet.sip new file mode 100644 index 0000000000000000000000000000000000000000..73408334cfc579dcb622c8376853677b9ff805d2 --- /dev/null +++ b/isis/sipfiles/ControlNet.sip @@ -0,0 +1,31 @@ +namespace Isis { + class ControlNet : public QObject { + %TypeHeaderCode + #include "ControlNet.h" + %End + public: + ControlNet() throw(Isis::IException); + ControlNet(const Isis::ControlNet &other) throw(Isis::IException); + + void clear() throw(Isis::IException); + + void Write(const QString &filename, bool pvl = false) throw(Isis::IException); + + double GetMaximumResidual() throw(Isis::IException); + QString GetNetworkId() const throw(Isis::IException); + int GetNumEditLockMeasures() throw(Isis::IException); + int GetNumEditLockPoints() throw(Isis::IException); + int GetNumIgnoredMeasures() throw(Isis::IException); + int GetNumberOfValidMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + int GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + void ClearJigsawRejected() throw(Isis::IException); + void IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + void DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + int GetNumMeasures() const throw(Isis::IException); + int GetNumPoints() const throw(Isis::IException); + int GetNumValidMeasures() throw(Isis::IException); + int GetNumValidPoints() throw(Isis::IException); + QString GetTarget() const throw(Isis::IException); + QString GetUserName() const throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/ControlPoint.sip b/isis/sipfiles/ControlPoint.sip new file mode 100644 index 0000000000000000000000000000000000000000..8dd80250aa2d52a8f4348137ae41d44a05a76e34 --- /dev/null +++ b/isis/sipfiles/ControlPoint.sip @@ -0,0 +1,302 @@ +namespace Isis { + + class ControlPoint : public QObject { + %TypeHeaderCode + #include "ControlPoint.h" + %End + public: + enum PointType { + Fixed = 0, + Constrained = 1, + Free = 2 + }; + + + enum Status { + Failure, + Success, + PointLocked + }; + + enum ConstraintStatus { + LatitudeConstrained = 0, + LongitudeConstrained = 1, + RadiusConstrained = 2, +// XConstrained = 3, +// YConstrained = 4, +// ZConstrained = 5; + }; + + // This stuff input to jigsaw + // How did apriori source get computed?? + struct SurfacePointSource { + enum Source { + None, + User, + AverageOfMeasures, + Reference, + Basemap, + BundleSolution + }; + }; + + struct RadiusSource { + enum Source { + None, + User, + AverageOfMeasures, + Ellipsoid, + DEM, + BundleSolution + }; + }; + + ControlPoint() throw(Isis::IException); + ControlPoint(const QString &id) throw(Isis::IException); + + // Isis::ControlNet *Parent() { return parentNetwork; } + + // void Load(PvlObject &p) throw(Isis::IException); + + // void Add(ControlMeasure *measure) throw(Isis::IException); + // int Delete(ControlMeasure *measure) throw(Isis::IException); + // int Delete(QString serialNumber) throw(Isis::IException); + // int Delete(int index) throw(Isis::IException); + // Status ResetApriori() throw(Isis::IException); + + // const Isis::ControlMeasure *GetMeasure(QString serialNumber) const throw(Isis::IException); + // ControlMeasure *GetMeasure(QString serialNumber) throw(Isis::IException); + + // const ControlMeasure *GetMeasure(int index) const throw(Isis::IException); + // ControlMeasure *GetMeasure(int index) throw(Isis::IException); + + // const ControlMeasure *GetRefMeasure() const throw(Isis::IException); + // ControlMeasure *GetRefMeasure() throw(Isis::IException); + + // Status SetChooserName(QString name) throw(Isis::IException); + // Status SetDateTime(QString newDateTime) throw(Isis::IException); + // Status SetEditLock(bool editLock) throw(Isis::IException); + // Status SetId(QString id) throw(Isis::IException); + // Status SetRefMeasure(ControlMeasure *cm) throw(Isis::IException); + // Status SetRefMeasure(int index) throw(Isis::IException); + // Status SetRefMeasure(QString sn) throw(Isis::IException); + // Status SetRejected(bool rejected) throw(Isis::IException); + // Status SetIgnored(bool newIgnoreStatus) throw(Isis::IException); + // Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint) throw(Isis::IException); + // Status SetType(PointType newType) throw(Isis::IException); + // + // Status SetAprioriRadiusSource(RadiusSource::Source source) throw(Isis::IException); + // Status SetAprioriRadiusSourceFile(QString sourceFile) throw(Isis::IException); + // Status SetAprioriSurfacePoint(SurfacePoint aprioriSP) throw(Isis::IException); + // Status SetAprioriSurfacePointSource(SurfacePointSource::Source source) throw(Isis::IException); + // Status SetAprioriSurfacePointSourceFile(QString sourceFile) throw(Isis::IException); + + // Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon, + // const Distance &radius) throw(Isis::IException); + + // Status ComputeApriori() throw(Isis::IException); + // Status ComputeResiduals() throw(Isis::IException); + // Status ComputeResiduals_Millimeters() throw(Isis::IException); + // + // SurfacePoint GetAdjustedSurfacePoint() const throw(Isis::IException); + // SurfacePoint GetBestSurfacePoint() const throw(Isis::IException); + + QString GetChooserName() const throw(Isis::IException); + QString GetDateTime() const throw(Isis::IException); + bool IsEditLocked() const throw(Isis::IException); + bool IsRejected() const throw(Isis::IException); + QString GetId() const throw(Isis::IException); + bool IsIgnored() const throw(Isis::IException); + bool IsValid() const throw(Isis::IException); + bool IsInvalid() const throw(Isis::IException); + bool IsFixed() const throw(Isis::IException); + + bool HasAprioriCoordinates() throw(Isis::IException); + bool IsConstrained() throw(Isis::IException); + bool IsLatitudeConstrained() throw(Isis::IException); + bool IsLongitudeConstrained() throw(Isis::IException); + bool IsRadiusConstrained() throw(Isis::IException); + int NumberOfConstrainedCoordinates() throw(Isis::IException); + + static QString PointTypeToString(PointType type) throw(Isis::IException); + static PointType StringToPointType(QString pointTypeString) throw(Isis::IException); + + QString GetPointTypeString() const throw(Isis::IException); + // PointType GetType() const throw(Isis::IException); + + static QString RadiusSourceToString(RadiusSource::Source source) throw(Isis::IException); + static RadiusSource::Source StringToRadiusSource(QString str) throw(Isis::IException); + QString GetRadiusSourceString() const throw(Isis::IException); + static QString SurfacePointSourceToString(SurfacePointSource::Source source) throw(Isis::IException); + // static SurfacePointSource::Source StringToSurfacePointSource(QString str) throw(Isis::IException); + QString GetSurfacePointSourceString() const throw(Isis::IException); + + // SurfacePoint GetAprioriSurfacePoint() const throw(Isis::IException); + // RadiusSource::Source GetAprioriRadiusSource() const throw(Isis::IException); + // QString GetAprioriRadiusSourceFile() const throw(Isis::IException); + // SurfacePointSource::Source GetAprioriSurfacePointSource() const throw(Isis::IException); + // QString GetAprioriSurfacePointSourceFile() const throw(Isis::IException); + + int GetNumMeasures() const throw(Isis::IException); + int GetNumValidMeasures() const throw(Isis::IException); + int GetNumLockedMeasures() const throw(Isis::IException); + bool HasSerialNumber(QString serialNumber) const throw(Isis::IException); + // int IndexOf(ControlMeasure *, bool throws = true) const throw(Isis::IException); + int IndexOf(QString sn, bool throws = true) const throw(Isis::IException); + int IndexOfRefMeasure() const throw(Isis::IException); + bool IsReferenceExplicit() const throw(Isis::IException); + QString GetReferenceSN() const throw(Isis::IException); + + // Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const throw(Isis::IException); + // Statistics GetStatistic(long dataType) const throw(Isis::IException); + + // QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const throw(Isis::IException); + // QList< QString > getCubeSerialNumbers() const throw(Isis::IException); + + // const ControlMeasure *operator[](QString serialNumber) const throw(Isis::IException); + // ControlMeasure *operator[](QString serialNumber) throw(Isis::IException); + + // const ControlMeasure *operator[](int index) const throw(Isis::IException); + // ControlMeasure *operator[](int index) throw(Isis::IException); + + // bool operator!=(const ControlPoint &pPoint) const throw(Isis::IException); + // bool operator==(const ControlPoint &pPoint) const throw(Isis::IException); + // const ControlPoint &operator=(const ControlPoint &pPoint) throw(Isis::IException); + + // The next 7 methods are specifically to support BundleAdjust + void ZeroNumberOfRejectedMeasures() throw(Isis::IException); + void SetNumberOfRejectedMeasures(int numRejected) throw(Isis::IException); + int GetNumberOfRejectedMeasures() const throw(Isis::IException); + double GetSampleResidualRms() const throw(Isis::IException); + double GetLineResidualRms() const throw(Isis::IException); + double GetResidualRms() const throw(Isis::IException); + void ClearJigsawRejected() throw(Isis::IException); + + // ControlPointFileEntryV0002 ToFileEntry() const throw(Isis::IException); + + private: + // void SetExplicitReference(ControlMeasure *measure) throw(Isis::IException); + void ValidateMeasure(QString serialNumber) const throw(Isis::IException); + // void AddMeasure(ControlMeasure *measure) throw(Isis::IException); + void PointModified() throw(Isis::IException); + + + // private: + // ControlNet *parentNetwork; + // + // //!< List of Control Measures + // QHash< QString, ControlMeasure * > * measures; + // + // QStringList *cubeSerials; + // + // ControlMeasure *referenceMeasure; + // + // /** + // * This is the control point ID. This is supposed to be a unique + // * identifier for control points. This often has a number in it, and + // * looks like "T0052" where the next one is "T0053" and so on. + // */ + // QString id; + // + // /** + // * This is the user name of the person who last modified this control + // * point. Modifications are things like updating the surface point, but + // * not things like updating the last modified time. The calculations + // * relating to this control point have to actually change for this to + // * be updated. This is an empty string if we need to dynamically + // * get the username of the caller when asked for (or written to file). + // */ + // QString chooserName; + // + // /** + // * This is the last modified date and time. This is updated automatically + // * and works virtually in the same way as chooserName. + // */ + // QString dateTime; + // + // /** + // * What this control point is tying together. + // * @see PointType + // */ + // PointType type; + // + // /** + // * If we forced a build that we would normally have thrown an exception + // * for then this is set to true. Otherwise, and most of the time, this + // * is false. + // */ + // bool invalid; + // + // /** + // * This stores the edit lock state. + // * @see SetEditLock + // */ + // bool editLock; + // + // /** + // * This stores the jigsaw rejected state. + // * @see SetJigsawReject + // */ + // bool jigsawRejected; + // + // /** + // * This stores the constraint status of the a priori SurfacePoint + // * @todo Eventually add x, y, and z + // */ + // std::bitset<6> constraintStatus; + // + // /** + // * This indicates if a program has explicitely set the reference in this + // * point or the implicit reference is still the current reference. This + // * is useful for programs that want to choose the reference for all + // * points where this hasn't happened yet. + // */ + // bool referenceExplicitlySet; + // + // /** + // * True if we should preserve but ignore the entire control point and its + // * measures. + // */ + // bool ignore; + // + // //! Where the apriori surface point originated from + // SurfacePointSource::Source aprioriSurfacePointSource; + // + // //! FileName where the apriori surface point originated from + // QString aprioriSurfacePointSourceFile; + // + // /** + // * Where the apriori surface point's radius originated from, most commonly + // * used by jigsaw. + // */ + // RadiusSource::Source aprioriRadiusSource; + // + // /** + // * The name of the file that derives the apriori surface point's radius + // */ + // QString aprioriRadiusSourceFile; + // + // /** + // * The apriori surface point. This is the "known truth" or trustworthy + // * point that should not be modified unless done very explicitely. This + // * comes from places like hand picking where you really don't want the + // * surface point to vary far from this point, but some variation is + // * okay (1/10th of a pixel is fair for human accuracy for example). Very + // * often this point does not exist. + // */ + // SurfacePoint aprioriSurfacePoint; + // + // /** + // * This is the calculated, or aposterori, surface point. This is what most + // * programs should be working with and updating. + // */ + // SurfacePoint adjustedSurfacePoint; + // + // /** + // * This parameter is used and maintained by BundleAdjust for the jigsaw + // * application. It is stored here because ControlPoint contains the index + // * of the measures. + // */ + // int numberOfRejectedMeasures; + }; +}; diff --git a/isis/sipfiles/MaximumLikelihoodWFunctions.sip b/isis/sipfiles/MaximumLikelihoodWFunctions.sip new file mode 100644 index 0000000000000000000000000000000000000000..cbc668d80d58796b89d7039716272285704aad0e --- /dev/null +++ b/isis/sipfiles/MaximumLikelihoodWFunctions.sip @@ -0,0 +1,52 @@ +namespace Isis { + + class MaximumLikelihoodWFunctions { + %TypeHeaderCode + #include "MaximumLikelihoodWFunctions.h" + %End + + public: + + enum Model { + Huber, + HuberModified, + Welsch, + Chen + }; + + static QString modelToString(Model model) throw(Isis::IException); + static Isis::MaximumLikelihoodWFunctions::Model stringToModel(QString modelName) throw(Isis::IException); + + MaximumLikelihoodWFunctions() throw(Isis::IException); + MaximumLikelihoodWFunctions(Model modelSelection) throw(Isis::IException); + MaximumLikelihoodWFunctions(Model modelSelection, double tweakingConstant) throw(Isis::IException); + MaximumLikelihoodWFunctions(const Isis::MaximumLikelihoodWFunctions &other) throw(Isis::IException); + + void setModel(Model modelSelection) throw(Isis::IException); // uses default tweaking constant + void setTweakingConstantDefault() throw(Isis::IException); + + void setModel(Model modelSelection, double tweakingConstant) throw(Isis::IException); + void setTweakingConstant(double tweakingConstant) throw(Isis::IException); + + Model model() const throw(Isis::IException); + double tweakingConstant() const throw(Isis::IException); + + // the W functions provide an additional weighting factor W which is used + // to 're-weight' each observation dynamically during an adjustment, the + // scalar functions provide access to various flavors of this scalar (as + // a function of the residual divided by the residuals sigma) + + double sqrtWeightScaler(double residualZScore) throw(Isis::IException); //it is often convient to use square roots of + //weights when building normals, this function + // provides the scaler for the square root of + // the weight directly + double tweakingConstantQuantile() throw(Isis::IException); // returns which quantile of the residuals is recommended to + // use as the tweaking constant, this varies as a function of + // the model being employed + + QString weightedResidualCutoff() throw(Isis::IException); + + QDataStream &write(QDataStream &stream) const throw(Isis::IException); + QDataStream &read(QDataStream &stream) throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/Statistics.sip b/isis/sipfiles/Statistics.sip new file mode 100644 index 0000000000000000000000000000000000000000..089b76a636977a614cae8812eacdf742b74263e7 --- /dev/null +++ b/isis/sipfiles/Statistics.sip @@ -0,0 +1,41 @@ + +namespace Isis { + class Statistics : public QObject { + %TypeHeaderCode + #include "Statistics.h" + %End + public: + Statistics(const Isis::Statistics &other) throw(Isis::IException); + + void Reset() throw(Isis::IException); + + void AddData(const double *data, const unsigned int count) throw(Isis::IException); + void AddData(const double data) throw(Isis::IException); + + void RemoveData(const double *data, const unsigned int count) throw(Isis::IException); + void RemoveData(const double data) throw(Isis::IException); + + double ValidMinimum() const throw(Isis::IException); + double ValidMaximum() const throw(Isis::IException); + bool InRange(const double value) throw(Isis::IException); + bool AboveRange(const double value) throw(Isis::IException); + bool BelowRange(const double value) throw(Isis::IException); + + double Average() const throw(Isis::IException); + double StandardDeviation() const throw(Isis::IException); + double Variance() const throw(Isis::IException); + double Sum() const throw(Isis::IException); + double SumSquare() const throw(Isis::IException); + double Rms() const throw(Isis::IException); + + double Minimum() const throw(Isis::IException); + double Maximum() const throw(Isis::IException); + double ChebyshevMinimum(const double percent = 99.5) const throw(Isis::IException); + double ChebyshevMaximum(const double percent = 99.5) const throw(Isis::IException); + double BestMinimum(const double percent = 99.5) const throw(Isis::IException); + double BestMaximum(const double percent = 99.5) const throw(Isis::IException); + double ZScore(const double value) const throw(Isis::IException); + + bool RemovedData() const throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/master.sip b/isis/sipfiles/master.sip new file mode 100644 index 0000000000000000000000000000000000000000..2cdb950c9cb1b90d2b3d9339ffc009ad26cbee7c --- /dev/null +++ b/isis/sipfiles/master.sip @@ -0,0 +1,75 @@ +%Module(name=libisispy, + version=0, + keyword_arguments="Optional") + +%ExportedHeaderCode + #include + #include + #include + #include + #include + + using namespace std; + + // Wraps glob to return a STD vector to avoid dealing with C style globbing + inline vector glob(const QString& pat){ + glob_t glob_result; + glob(pat.toLatin1().data(),GLOB_TILDE,NULL,&glob_result); + vector ret; + for(unsigned int i=0;i libs = glob(pat); + QLibrary lib_loader; + + for (vector::const_iterator i = libs.begin(); i != libs.end(); ++i) { + // Strip extension + QFileInfo file(*i); + QString lib_dir = file.path() + "/" + file.completeBaseName(); + + lib_loader.setFileName(lib_dir); + + // Load hint required for symbols to be accessible to other libraries loaded later + lib_loader.setLoadHints(QLibrary::ExportExternalSymbolsHint); + + bool load_ok = lib_loader.load(); + + // if verbose is true, print out load info + if (verbose) { + if (load_ok) { + cout << "Loaded " + lib_dir.toStdString() + " : OK" << endl; + } + else if (!load_ok) { + cout << "Loaded " + lib_dir.toStdString() + " : FAILED" << endl + << lib_loader.errorString().toStdString() << endl; + } + } + } + } +%End + +%Include type_conversions.sip + +%Include ControlPoint.sip +%Include BundleMeasure.sip +%Include BundleControlPoint.sip +%Include BundleImage.sip +%Include ControlNet.sip +%Include Statistics.sip +%Include BundleResults.sip +%Include BundleSolutionInfo.sip +%Include BundleObservationSolveSettings.sip +%Include BundleSettings.sip +%Include BundleAdjust.sip +%Include MaximumLikelihoodWFunctions.sip diff --git a/isis/sipfiles/type_conversions.sip b/isis/sipfiles/type_conversions.sip new file mode 100644 index 0000000000000000000000000000000000000000..7a337c444f80e475d9510e0081d7551d46f24f74 --- /dev/null +++ b/isis/sipfiles/type_conversions.sip @@ -0,0 +1,292 @@ + +%Import QtCore/QtCoremod.sip +%Import QtXml/QtXmlmod.sip + + + +%Exception Isis::IException(SIP_Exception) /PyName=IException/ +{ +%TypeHeaderCode +#include "IException.h" +%End +%RaiseCode + const char *detail = sipExceptionRef.what(); + + SIP_BLOCK_THREADS + PyErr_SetString(sipException_Isis_IException, detail); + SIP_UNBLOCK_THREADS +%End +}; + + +%MappedType QVector > +{ + %TypeHeaderCode + #include "BundleControlPoint.h" + #include + %End + + %ConvertFromTypeCode + size_t size = sipCpp->size(); + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + + Isis::BundleControlPoint* cppCPoint = sipCpp->at(i).data(); + + PyObject *pyCPoint = sipConvertFromType((void*)(cppCPoint), sipType_Isis_BundleControlPoint, NULL); + PyList_SetItem(l, i, pyCPoint); + } + + return l; + %End + + %ConvertToTypeCode + Py_ssize_t size = PyList_Size(sipPy); + QVector > *cppPointList = new QVector > (); + int sipErr = 0; + for(int i = 0; i < size; i++) { + PyObject *pyCPoint = PyList_GET_ITEM(sipPy, i); + Isis::BundleControlPoint *cppCPoint = (Isis::BundleControlPoint*)sipConvertToType(pyCPoint, sipType_Isis_BundleControlPoint, NULL, SIP_NOT_NONE, NULL, &sipErr); + cppPointList->append(QSharedPointer(cppCPoint)); + } + + *sipCppPtr = cppPointList; + return sipGetState(sipTransferObj); + %End + +}; + +%MappedType QList +{ + %TypeHeaderCode + #include "Statistics.h" + #include + %End + + %ConvertFromTypeCode + size_t size = sipCpp->size(); + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + Isis::Statistics* cppStats = new Isis::Statistics(sipCpp->at(i)); + PyObject *pyStats = sipConvertFromType((void*)(cppStats), sipType_Isis_Statistics, NULL); + PyList_SetItem(l, i, pyStats); + } + + return l; + %End + + %ConvertToTypeCode + Py_ssize_t size = PyList_Size(sipPy); + QList *cppStatList = new QList(); + int sipErr = 0; + for(int i = 0; i < size; i++) { + PyObject *pyStat = PyList_GET_ITEM(sipPy, i); + Isis::Statistics *stats = (Isis::Statistics*)sipConvertToType(pyStat, sipType_Isis_Statistics, NULL, SIP_NOT_NONE, NULL, &sipErr); + cppStatList->append(*stats); + } + + *sipCppPtr = cppStatList; + return sipGetState(sipTransferObj); + %End +}; + + + +%MappedType QList +{ + %TypeHeaderCode + #include "BundleObservationSolveSettings.h" + #include + %End + + %ConvertFromTypeCode + PyObject *l; + + // Create the Python list of the correct length. + if ((l = PyList_New(sipCpp->size())) == NULL) + return NULL; + + for (int i = 0; i < sipCpp->size(); ++i) { + Isis::BundleObservationSolveSettings *settings = new Isis::BundleObservationSolveSettings(sipCpp->at(i)); + + PyObject *pySettings = sipConvertFromType((void*)(settings), sipType_Isis_BundleObservationSolveSettings, NULL); + PyList_SetItem(l, i, pySettings); + } + + return l; + %End + + + %ConvertToTypeCode + if (!sipIsErr) { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToType(PyList_GET_ITEM(sipPy, i), + sipType_Isis_BundleObservationSolveSettings, SIP_NOT_NONE)) + return 0; + + return 1; + } + + Py_ssize_t size = PyList_Size(sipPy); + + QList *cppSettingsList = new QList(); + int state; + + for(Py_ssize_t i = 0; i < size; i++) { + PyObject *pySettings = PyList_GET_ITEM(sipPy, i); + Isis::BundleObservationSolveSettings *settings; + + settings = (Isis::BundleObservationSolveSettings*)sipConvertToType(pySettings, sipType_Isis_BundleObservationSolveSettings, 0, SIP_NOT_NONE, &state, sipIsErr); + + if (*sipIsErr) { + sipReleaseType(pySettings, sipType_Isis_BundleObservationSolveSettings, state); + delete cppSettingsList; + return 0; + } + + cppSettingsList->append(*settings); + sipReleaseType(pySettings, sipType_Isis_BundleObservationSolveSettings, state); + } + + *sipCppPtr = cppSettingsList; + return sipGetState(sipTransferObj); + %End +}; + +// convert Bundlesettings wrapped in a QSharedPointer in Isis +%MappedType QSharedPointer +{ + %TypeHeaderCode + #include "BundleImage.h" + #include + %End + + %ConvertFromTypeCode + Isis::BundleImage *cpp = sipCpp->data(); + PyObject *py = sipConvertFromType(cpp, sipType_Isis_BundleImage, NULL); + return py; + %End + + %ConvertToTypeCode + int sipErr = 0; + QSharedPointer* cpp_qsp = new QSharedPointer(); + Isis::BundleImage *cpp = (Isis::BundleImage*)sipConvertToType(sipPy, sipType_Isis_BundleImage, NULL, SIP_NOT_NONE, NULL, &sipErr); + cpp_qsp->reset(cpp); + *sipCppPtr = cpp_qsp; + + return sipGetState(sipTransferObj); + %End +}; + + +// convert Bundlesettings wrapped in a QSharedPointer in Isis +%MappedType QSharedPointer +{ + %TypeHeaderCode + #include "BundleSettings.h" + #include + using namespace std; + %End + + %ConvertFromTypeCode + Isis::BundleSettings *settings = sipCpp->data(); + PyObject *pySettings = sipConvertFromType(settings, sipType_Isis_BundleSettings, NULL); + return pySettings; + %End + + %ConvertToTypeCode + int sipErr = 0; + QSharedPointer* wrappedSettings = new QSharedPointer(); + + Isis::BundleSettings *settings = (BundleSettings*) sipConvertToType(sipPy, sipType_Isis_BundleSettings, NULL, SIP_NOT_NONE, NULL, &sipErr); + wrappedSettings->reset(settings); + *sipCppPtr = wrappedSettings; + + return sipGetState(sipTransferObj); + %End +}; + + +// convert Bundlesettings wrapped in a QSharedPointer in Isis +%MappedType QSharedPointer +{ + %TypeHeaderCode + #include "ControlNet.h" + #include + using namespace std; + %End + + %ConvertFromTypeCode + PyObject *pySettings = sipConvertFromType(sipCpp, sipType_Isis_ControlNet, NULL); + return pySettings; + %End + + %ConvertToTypeCode + int sipErr = 0; + QSharedPointer *qspControlNet = NULL; + if (!sipCanConvertToType(sipPy, sipType_Isis_ControlNet, SIP_NOT_NONE)) { + sipErr = 1; + } + else { + Isis::ControlNet *cppControlNet = (Isis::ControlNet*)sipConvertToType(sipPy, sipType_Isis_ControlNet, NULL, SIP_NOT_NONE, NULL, &sipErr); + qspControlNet->reset(cppControlNet); + } + + *sipCppPtr = qspControlNet; + return sipGetState(sipTransferObj); + %End +}; + + + +// Convert a python str object to a std::string. +%MappedType std::string +{ + %TypeHeaderCode + #include + %End + + %ConvertFromTypeCode + // convert an std::string to a Python (unicode) string + PyObject* newstring; + newstring = PyUnicode_DecodeUTF8(sipCpp->c_str(), sipCpp->length(), NULL); + if(newstring == NULL) { + PyErr_Clear(); + newstring = PyBytes_FromString(sipCpp->c_str()); + } + return newstring; + %End + + %ConvertToTypeCode + // Allow a Python string (or a unicode string) whenever a string is + // expected. + // If argument is a Unicode string, just decode it to UTF-8 + // If argument is a Python string, assume it's UTF-8 + if (sipIsErr == NULL) + return (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy)); + + if (sipPy == Py_None) + { + *sipCppPtr = new std::string; + return 1; + } + + if (PyUnicode_Check(sipPy)) + { + PyObject* s = PyUnicode_AsEncodedString(sipPy, "UTF-8", ""); + *sipCppPtr = new std::string(PyBytes_AS_STRING(s)); + Py_DECREF(s); + return 1; + } + + if (PyBytes_Check(sipPy)) + { + *sipCppPtr = new std::string(PyBytes_AS_STRING(sipPy)); + return 1; + } + return 0; + %End +}; diff --git a/isis/src/CMakeLists.txt b/isis/src/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2fe7b579c9e7514bf0c276766a057c24f880b85c --- /dev/null +++ b/isis/src/CMakeLists.txt @@ -0,0 +1,17 @@ +#=============================================================================== +set(CORE_LIST base database control qisis system) + +get_subdirectory_list(${CMAKE_CURRENT_LIST_DIR} modules) + +# build core into isis library +add_isis_module(${CORE_LIB_NAME} ${CORE_LIST}) + +# remove duplicates so we dont build to the core targets twice +foreach(core ${CORE_LIST}) + list(REMOVE_ITEM modules "${CMAKE_CURRENT_LIST_DIR}/${core}") +endforeach() + +foreach( mod ${modules} ) + string(REPLACE "${CMAKE_CURRENT_LIST_DIR}/" "" strippedmod ${mod}) + add_isis_module(${strippedmod} ${strippedmod}) +endforeach() diff --git a/isis/src/Makefile b/isis/src/Makefile index 150207051b52e2054a379fb956d9f806bc626228..1652458951a6de671316e9593bec4f5c25e6d352 100644 --- a/isis/src/Makefile +++ b/isis/src/Makefile @@ -7,7 +7,7 @@ else .NOTPARALLEL: endif -PACKAGES = $(filter-out Makefile docsys CVS IsisObjectConvert.xsl, $(wildcard *)) +PACKAGES = $(filter-out Makefile CMakeLists.txt docsys CVS IsisObjectConvert.xsl, $(wildcard *)) PACKAGESCLEAN := $(PACKAGES:%=%-clean) PACKAGESQUICKCLEAN := $(PACKAGES:%=%-quickclean) @@ -21,7 +21,7 @@ PACKAGESCATTEST := $(filter-out qisis-catTest, $(PACKAGES:%=%-catTest)) # Allow parallel builds of applications applications: $(PACKAGESAPPS) - + %-apps: PACKAGE=`$(ECHO) $@ | $(SED) 's/-apps//'`; \ echo $(CURTIMESTAMP) " Working on Package [$$PACKAGE]"; \ diff --git a/isis/src/apollo/apps/apollo2isis/apollo2isis.cpp b/isis/src/apollo/apps/apollo2isis/main.cpp similarity index 100% rename from isis/src/apollo/apps/apollo2isis/apollo2isis.cpp rename to isis/src/apollo/apps/apollo2isis/main.cpp diff --git a/isis/src/apollo/apps/apollocal/apollocal.cpp b/isis/src/apollo/apps/apollocal/main.cpp similarity index 100% rename from isis/src/apollo/apps/apollocal/apollocal.cpp rename to isis/src/apollo/apps/apollocal/main.cpp diff --git a/isis/src/apollo/apps/apollofindrx/apollofindrx.cpp b/isis/src/apollo/apps/apollofindrx/main.cpp similarity index 100% rename from isis/src/apollo/apps/apollofindrx/apollofindrx.cpp rename to isis/src/apollo/apps/apollofindrx/main.cpp diff --git a/isis/src/apollo/apps/apollopaninit/apollopaninit.cpp b/isis/src/apollo/apps/apollopaninit/main.cpp similarity index 100% rename from isis/src/apollo/apps/apollopaninit/apollopaninit.cpp rename to isis/src/apollo/apps/apollopaninit/main.cpp diff --git a/isis/src/apollo/apps/apollopanstitcher/Trans2d3p.h b/isis/src/apollo/apps/apollopanstitcher/Trans2d3p.h index f79883e7369a6c21330da2f46f9c03084cb14f51..4b6bcbfe9708d3eae9c08d1b0c837b14aa946318 100644 --- a/isis/src/apollo/apps/apollopanstitcher/Trans2d3p.h +++ b/isis/src/apollo/apps/apollopanstitcher/Trans2d3p.h @@ -1,45 +1,48 @@ +#ifndef trans2d3p_h +#define trans2d3p_h + #include "Cube.h" #include "Transform.h" #include -/** - * @file - * $Revision: 1.7 $ - * $Date: 2005/10/03 22:43:39 $ - * - * Unless noted otherwise, the portions of Isis written by the USGS are - * public domain. See individual third-party library and package descriptions - * for intellectual property information, user agreements, and related - * information. - * - * Although Isis has been used by the USGS, no warranty, expressed or - * implied, is made by the USGS as to the accuracy and functioning of such - * software and related material nor shall the fact of distribution +/** + * @file + * $Revision: 1.7 $ + * $Date: 2005/10/03 22:43:39 $ + * + * Unless noted otherwise, the portions of Isis written by the USGS are + * public domain. See individual third-party library and package descriptions + * for intellectual property information, user agreements, and related + * information. + * + * Although Isis has been used by the USGS, no warranty, expressed or + * implied, is made by the USGS as to the accuracy and functioning of such + * software and related material nor shall the fact of distribution * constitute any such warranty, and no responsibility is assumed by the - * USGS in connection therewith. - * - * For additional information, launch - * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html + * USGS in connection therewith. + * + * For additional information, launch + * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html * in a browser or see the Privacy & Disclaimers page on the Isis website, * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on - * http://www.usgs.gov/privacy.html. - */ + * http://www.usgs.gov/privacy.html. + */ using namespace Isis; -/** +/** * @brief Brief coming soon - * + * * Description coming soon - * + * * @author 2011-09-19 Orrin Thomas - * - * @internal + * + * @internal * @history 2011-09-19 Orrin Thomas - Original version - */ + */ class Trans2d3p : public Transform { -public: +public: Trans2d3p(double theta, double sampOffset, double lineOffset,int samples, int lines) { m_lines = lines; m_samples = samples; @@ -74,3 +77,5 @@ private: int m_lines; int m_samples; }; + +#endif diff --git a/isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp b/isis/src/apollo/apps/apollopanstitcher/main.cpp similarity index 100% rename from isis/src/apollo/apps/apollopanstitcher/apollopanstitcher.cpp rename to isis/src/apollo/apps/apollopanstitcher/main.cpp diff --git a/isis/src/apollo/apps/apolloremrx/apolloremrx.cpp b/isis/src/apollo/apps/apolloremrx/main.cpp similarity index 100% rename from isis/src/apollo/apps/apolloremrx/apolloremrx.cpp rename to isis/src/apollo/apps/apolloremrx/main.cpp diff --git a/isis/src/apollo/apps/apollowarp/apollowarp.cpp b/isis/src/apollo/apps/apollowarp/main.cpp similarity index 100% rename from isis/src/apollo/apps/apollowarp/apollowarp.cpp rename to isis/src/apollo/apps/apollowarp/main.cpp diff --git a/isis/src/base/apps/algebra/algebra.cpp b/isis/src/base/apps/algebra/main.cpp similarity index 100% rename from isis/src/base/apps/algebra/algebra.cpp rename to isis/src/base/apps/algebra/main.cpp diff --git a/isis/src/base/apps/appjit/LineScanCameraRotation.cpp b/isis/src/base/apps/appjit/LineScanCameraRotation.cpp index c5a33909787f13bdcbe475d01e5b401f68198a68..9de4057b1b87e18e7c9758fd02bd5c829fd1efc3 100644 --- a/isis/src/base/apps/appjit/LineScanCameraRotation.cpp +++ b/isis/src/base/apps/appjit/LineScanCameraRotation.cpp @@ -8,7 +8,6 @@ #include "Cube.h" #include "LineScanCameraRotation.h" #include "Quaternion.h" -#include "LineEquation.h" #include "BasisFunction.h" #include "LeastSquares.h" #include "BasisFunction.h" diff --git a/isis/src/base/apps/appjit/PixelOffset.cpp b/isis/src/base/apps/appjit/PixelOffset.cpp index 2ccef36a7f7ca4a2b192fc48fa3baadd6da8e715..b81a49f37293f539ab5402264da2787dfd85b39e 100644 --- a/isis/src/base/apps/appjit/PixelOffset.cpp +++ b/isis/src/base/apps/appjit/PixelOffset.cpp @@ -8,7 +8,6 @@ #include "PixelOffset.h" #include "TextFile.h" -#include "LineEquation.h" #include "LeastSquares.h" #include "BasisFunction.h" #include "PolynomialUnivariate.h" diff --git a/isis/src/base/apps/appjit/appjit.cpp b/isis/src/base/apps/appjit/main.cpp similarity index 100% rename from isis/src/base/apps/appjit/appjit.cpp rename to isis/src/base/apps/appjit/main.cpp diff --git a/isis/src/base/apps/ascii2isis/ascii2isis.cpp b/isis/src/base/apps/ascii2isis/main.cpp similarity index 100% rename from isis/src/base/apps/ascii2isis/ascii2isis.cpp rename to isis/src/base/apps/ascii2isis/main.cpp diff --git a/isis/src/base/apps/automos/automos.xml b/isis/src/base/apps/automos/automos.xml index 395cd9141f11ddd1dc9ee202aad3e8632f6927af..bbf9c17508bc81130062f82d22709ba346a0fee7 100644 --- a/isis/src/base/apps/automos/automos.xml +++ b/isis/src/base/apps/automos/automos.xml @@ -49,7 +49,7 @@

MATCHDEM = FALSE, the default does not check the SHAPEMODEL keyword of the input cube - files and does not propogate what DEM Shapemodel that was used when the input files were + files and does not propagate what DEM Shapemodel that was used when the input files were projected.

@@ -61,19 +61,43 @@ options is explained in the tables and descriptions below.

- The Track feature creates a band in the output mosaic file containing the index - values for every pixel in the output mosaic. The Track-band can only be used appropriately through - the QVIEW-AdvancedTracking tool. As the user interactively pans across the displayed - mosaic band (Band1), for every mosaic pixel location QVIEW-AdvancedTracking will report - the source cube filename that was input to automos. The Track-band cannot be used outside - the QVIEW-AdvancedTracking tool. The file (byte) size of the mosaic is increased due to - the track-band. + The TRACK feature creates a separate tracking cube in addition to the mosaic cube, and + contains information for the source files of every pixel within the output mosaic. + This cube will have the same base-name as the mosaic cube but will end in + "_tracking.cub". The tracking cube must always reside in the same directory as the + mosaic cube to be properly accessed; this means that if the mosaic cube is copied or + moved, then its associated tracking cube must be copied or moved to the same location. + The tracking cube will always be of type unsigned integer. Depending on the + bit-type of the mosaic cube and/or the number of bands it contains, the tracking cube + may be as much as four times the size of the mosaic cube itself.

- The Track feature works with Priority options ONTOP (with HIGHSATURATION and - LOWSATURATION parameters) and BENEATH for single band input cubes. It does NOT support - multiple band input cubes with these priority options. It does work for multiband cubes - when PRIORITY=BAND. Furthermore, this feature is NOT supported when PRIORITY=AVERAGE. + The tracking cube can be used appropriately through the QVIEW-AdvancedTracking + tool. As the user pans across the displayed mosaic, for every mosaic pixel location, + QVIEW-AdvancedTracking will interactively report the index, the filename and the + serial number of the input cube that was input to automos for that specific pixel + location. Since the tracking cube is of bit-type unsigned integer, the DN values of + 0, 1 and 2 are reserved for NULL, LRS and LIS, respectively, so valid pixel DN values + will begin at an offset of 3. In other words, a pixel of DN value 3 in the tracking + cube means that this same pixel within the mosaic was taken from the first input + image. The tracking cube cannot be used outside of the QVIEW-AdvancedTracking tool + except as a visual representation of the source cubes for the different pixels. +

+

+ The TRACK feature works with Priority options ONTOP and BENEATH for single band input + cubes. It works for multiband cubes for PRIORITY=ONTOP only when the NULL, + HIGHSATURATION and LOWSATURATION options are set to true. It also works for multiband + cubes when PRIORITY=BAND. Furthermore, this feature is NOT supported when + PRIORITY=AVERAGE. +

+

+ Please Note: Prior to ISIS version 3.6.0, tracking for the various mosaicking apllications + was being handled with an internal tracking band. Tracking is now being handled by an + external tracking cube that contains the associated tracking information. This application + can no longer add to mosaics of the old format. In order to continue to use these + older mosaics with the updated mosaicking applications, you must first use the + trackextract utility application to extract the tracking band and the associated + tracking information into an external tracking cube.

@@ -90,8 +114,17 @@ current input image will appear in the output mosaic (it replaces the output mosaic pixel). Invalid input Special Pixels (NULL,HRS,HIS,LRS,LIS) will NOT - replace an existing Valid output mosaic pixel. Refer to parameters HIGHSATURATION, - LOWSATURATION, and NULL to override replacement of Valid output mosaic pixels. + replace an existing Valid output mosaic pixel unless the optional flags are set. Refer + to parameters HIGHSATURATION,LOWSATURATION, and NULL to override replacement of Valid + output mosaic pixels. +

+ NOTE: When using this priority with multi-band mosaics and with the TRACK + option set, all Special Pixel flags must be set as well. This is because the same + pixel within different bands of a single input image may hold both Valid and Special + Pixel values, and since our Tracking capabilities can only track one input image per + pixel (as it is a single band), it must accept the values for that particular pixel + from every band in the input image being placed on top. +

@@ -120,7 +153,7 @@ Overlapping Valid pixel values from the current input image and output mosaic will be averaged for the new mosaic pixel values. A count-band is created with the output mosaic file. The count-band keeps track of the number of images involved in the - averaging of the input dn values for each pixel in the mosaic. Invalid input pixel + averaging of the input DN values for each pixel in the mosaic. Invalid input pixel values will not be included in the average. In the case where only one Valid pixel exists between the input image pixels or the current mosaic pixel, the Valid pixel is retained in the current output mosaic. Refer to parameters HIGHSATURATION, @@ -474,6 +507,11 @@ Added parameter checking to XML MAXLON and MAXLAT to check if they are greater than their minimum counterpart. Fixes #5148 + + Updated documentation to reflect new handling of tracking capabilities with an external + tracking cube as well as clarify why special pixel flags are required when priority=ontop for + multiband mosaics. References #2092 + @@ -489,7 +527,7 @@ the same ProjectionName, PixelResolution (or MapScale), EquatorialRadius, PolarRadius, LatitudeType, LongitudeDirection and specific map projection keywords such as CenterLatitude and CenterLongitude. This includes the output mosaic - if it already exists. The latitude and longtiude extents of each input file may + if it already exists. The latitude and longitude extents of each input file may vary. @@ -588,11 +626,11 @@ If the Input and Mosaic pixel of the priority band, specified by NUMBER or KEYNAME and KEYVALUE, are valid, a less than or greater than comparison is done. Depending on the CRITERIA selected, the lower or higher of the two pixels is placed on top - (i.e., replaces the mosaic pixel). This applies to all the corresponding Valid band + (i.e., replaces the mosaic pixel). This applies to all the corresponding Valid band pixels. Special pixels in the corresponding bands will not replace the output mosaic pixel unless the HIGHSATURATION, LOWSATURATION and NULL flags are set to TRUE. Refer - to parameters HIGHSATURATION, LOWSATURATION, and NULL. This means, if the results - of the priority band comparison says that the input pixel should be on top, but the + to parameters HIGHSATURATION, LOWSATURATION, and NULL. This means, if the results + of the priority band comparison shows that the input pixel should be on top, but the input pixel on any other band is NULL, without the NULL=TRUE, the output mosaic pixel will remain unchanged for that band. @@ -697,7 +735,7 @@ The keyword values can be found on the labels of the input files under the "BandBin" Group. For instance, KEYNAME=NAME where the KEYVALUE can then be set to "Phase Angle", "Emission Angle", "Incidence Angle", - "Pixel Resolution". Refer to the phocube application that will + "Pixel Resolution". Refer to the phocube application that will create these 'Named' Bands. @@ -722,7 +760,7 @@ The lower DN value of the input priority band will replace the mosaic pixel - If the dn value of a pixel in the priority band of the input cube + If the DN value of a pixel in the priority band of the input cube is lesser than the corresponding pixel in the mosaic priority band, then the output pixel of the mosaic will be replaced by the input cube pixel. This will apply to all bands at this pixel location. @@ -732,7 +770,7 @@ The greater DN value of the input priority band will replace the mosaic pixel - If the dn value of a pixel in the priority band of the input cube + If the DN value of a pixel in the priority band of the input cube is greater than the corresponding pixel in the mosaic priority band, then the output pixel of the mosaic will be retained on NOT be replaced by the input cube pixel. This will apply to all bands at @@ -824,7 +862,7 @@ double Maximum Longitude - The maximum longitude value bounary extent for the output mosaic. + The maximum longitude value boundary extent for the output mosaic. MINLON @@ -841,27 +879,26 @@

- The Track feature creates a band in the output mosaic file containing the index - values for every pixel in the output mosaic. The Track-band can only be used - appropriately through the QVIEW-AdvancedTracking tool. As the user interactively - pans across the displayed mosaic band (Band1), for every mosaic pixel location - QVIEW-AdvancedTracking will report the source cube filename that was input to - automos. The Track-band cannot be used outside the QVIEW-AdvancedTracking tool. - TRACK must be set to TRUE at the time of mosaic creation only and cannot be turned - on after the mosaic is created. When a mosaic is created with TRACK=TRUE, all - subsequent runs will default to TRACK=TRUE. When a mosaic is created with - TRACK=FALSE, an error will be encountered if subsequent runs have TRACK=TRUE. - The file (byte) size of the mosaic is increased due to - the track-band. -

-

- A table, called InputImages, containing the names of the images used in the mosaic - will be added to the cube when TRACK=TRUE. + The Track feature creates a separate tracking cube containing the index values for + the source of every pixel in the output mosaic. The tracking cube can only be used + appropriately through the QVIEW-AdvancedTracking tool. As the user pans across the + displayed mosaic, for every mosaic pixel location QVIEW-AdvancedTracking will + interactively report the filename, the serial number and the index of the input cube + that was input to automos for that specific pixel location. The tracking cube cannot + be used outside the QVIEW-AdvancedTracking tool except as a visual representation of + the source cubes for the different pixels. TRACK must be set to TRUE at the time of + mosaic creation only and cannot be turned on after the mosaic is created. When a + mosaic is created with TRACK=TRUE, all subsequent runs will default to TRACK=TRUE. + When a mosaic is created with TRACK=FALSE, an error will be encountered if subsequent + runs have TRACK=TRUE. The tracking cube will always be of type unsigned integer. + Depending on the bit-type of the mosaic cube and/or the number of bands it contains, + the tracking cube may be as much as four times the size of the mosaic cube itself.

WARNING: - If Tracking is turned on in a mosaic, any subsequent applications that modify "dn" - values will corrupt the track-band, for instance the application reduce. + If Tracking is turned on in a mosaic, any subsequent applications that modify DN + values, such as the applicationreduce, will corrupt the DN values in the + tracking cube.

@@ -887,8 +924,8 @@ The default is FALSE. If set to TRUE, this application will create a Mosaic Group in the keyword labels of the new output mosaic cube including a ShapeModel keyword. The output mosaic is created with the first input - cube listed in the FROMLIST file, the ShapeModel keyword and it's value - will be propogated to the the Mosaic Group of the output mosaic cube file. + cube listed in the FROMLIST file, the ShapeModel keyword and its value + will be propagated to the Mosaic Group of the output mosaic cube file. Subsequently, the ShapeModel keyword value of the remaining input cubes will be checked against the ShapeModel value in the mosaic cube. This application will fail if the ShapeModel keywords don't match. @@ -950,7 +987,7 @@ clarify what happens during the mosaic process.

- The output mosaic shows the result of the second input image being mosaiced with the + The output mosaic shows the result of the second input image being mosaicked with the first input image. You can see in band one that none of the special pixels were retained because none of the special pixel flags were set. In other words, regardless of whether there was a valid comparison at that pixel of the priority band, all other bands will @@ -959,7 +996,7 @@

In band two, you can still see where the special pixels were in the second input image. The second image would have been "on top" because in band two, the pixels are less than - those of the mosaic. However, the valid data in the mosaic was left alone because the + those of the mosaic. However, the valid data in the mosaic was disregarded because the special pixel flags were not set. You cannot see the special pixels from the first image because the valid pixels from the second image were kept instead.

diff --git a/isis/src/base/apps/automos/automos.cpp b/isis/src/base/apps/automos/main.cpp similarity index 100% rename from isis/src/base/apps/automos/automos.cpp rename to isis/src/base/apps/automos/main.cpp diff --git a/isis/src/base/apps/autoregtemplate/autoregtemplate.cpp b/isis/src/base/apps/autoregtemplate/main.cpp similarity index 100% rename from isis/src/base/apps/autoregtemplate/autoregtemplate.cpp rename to isis/src/base/apps/autoregtemplate/main.cpp diff --git a/isis/src/base/apps/bandnorm/bandnorm.cpp b/isis/src/base/apps/bandnorm/main.cpp similarity index 100% rename from isis/src/base/apps/bandnorm/bandnorm.cpp rename to isis/src/base/apps/bandnorm/main.cpp diff --git a/isis/src/base/apps/bandtrim/bandtrim.cpp b/isis/src/base/apps/bandtrim/main.cpp similarity index 100% rename from isis/src/base/apps/bandtrim/bandtrim.cpp rename to isis/src/base/apps/bandtrim/main.cpp diff --git a/isis/src/base/apps/barscale/barscale.cpp b/isis/src/base/apps/barscale/main.cpp similarity index 100% rename from isis/src/base/apps/barscale/barscale.cpp rename to isis/src/base/apps/barscale/main.cpp diff --git a/isis/src/base/apps/bit2bit/bit2bit.cpp b/isis/src/base/apps/bit2bit/main.cpp similarity index 100% rename from isis/src/base/apps/bit2bit/bit2bit.cpp rename to isis/src/base/apps/bit2bit/main.cpp diff --git a/isis/src/base/apps/blend/blend.cpp b/isis/src/base/apps/blend/main.cpp similarity index 100% rename from isis/src/base/apps/blend/blend.cpp rename to isis/src/base/apps/blend/main.cpp diff --git a/isis/src/base/apps/butterworth/butterworth.cpp b/isis/src/base/apps/butterworth/main.cpp similarity index 100% rename from isis/src/base/apps/butterworth/butterworth.cpp rename to isis/src/base/apps/butterworth/main.cpp diff --git a/isis/src/base/apps/cam2cam/cam2cam.cpp b/isis/src/base/apps/cam2cam/main.cpp similarity index 100% rename from isis/src/base/apps/cam2cam/cam2cam.cpp rename to isis/src/base/apps/cam2cam/main.cpp diff --git a/isis/src/base/apps/cam2map/cam2map.cpp b/isis/src/base/apps/cam2map/main.cpp similarity index 100% rename from isis/src/base/apps/cam2map/cam2map.cpp rename to isis/src/base/apps/cam2map/main.cpp diff --git a/isis/src/base/apps/cam2map/tsts/targCodeFromNaifKeywordsObj/Makefile b/isis/src/base/apps/cam2map/tsts/targCodeFromNaifKeywordsObj/Makefile deleted file mode 100644 index 068d99b44ba1e240065544d1133817a762895a23..0000000000000000000000000000000000000000 --- a/isis/src/base/apps/cam2map/tsts/targCodeFromNaifKeywordsObj/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -APPNAME = cam2map - -cam2mapTruth.cub.TOLERANCE = .000001 -cam2mapCheckRange.cub.TOLERANCE = .000001 - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/test.cub \ - to=$(OUTPUT)/cam2mapTruth.cub \ - map=$(INPUT)/test.map \ - lonseam=continue \ - pixres=map \ - >& /dev/null; - catlab from=$(OUTPUT)/cam2mapTruth.cub \ - to=$(OUTPUT)/cubeLabel.pvl \ - >& /dev/null; diff --git a/isis/src/base/apps/caminfo/caminfo.cpp b/isis/src/base/apps/caminfo/main.cpp similarity index 100% rename from isis/src/base/apps/caminfo/caminfo.cpp rename to isis/src/base/apps/caminfo/main.cpp diff --git a/isis/src/base/apps/campt/campt.cpp b/isis/src/base/apps/campt/main.cpp similarity index 100% rename from isis/src/base/apps/campt/campt.cpp rename to isis/src/base/apps/campt/main.cpp diff --git a/isis/src/base/apps/camrange/camrange.cpp b/isis/src/base/apps/camrange/main.cpp similarity index 100% rename from isis/src/base/apps/camrange/camrange.cpp rename to isis/src/base/apps/camrange/main.cpp diff --git a/isis/src/base/apps/camstats/camstats.cpp b/isis/src/base/apps/camstats/main.cpp similarity index 100% rename from isis/src/base/apps/camstats/camstats.cpp rename to isis/src/base/apps/camstats/main.cpp diff --git a/isis/src/base/apps/camtrim/camtrim.cpp b/isis/src/base/apps/camtrim/main.cpp similarity index 100% rename from isis/src/base/apps/camtrim/camtrim.cpp rename to isis/src/base/apps/camtrim/main.cpp diff --git a/isis/src/base/apps/cathist/cathist.cpp b/isis/src/base/apps/cathist/main.cpp similarity index 100% rename from isis/src/base/apps/cathist/cathist.cpp rename to isis/src/base/apps/cathist/main.cpp diff --git a/isis/src/base/apps/catlab/catlab.cpp b/isis/src/base/apps/catlab/main.cpp similarity index 100% rename from isis/src/base/apps/catlab/catlab.cpp rename to isis/src/base/apps/catlab/main.cpp diff --git a/isis/src/base/apps/catoriglab/catoriglab.cpp b/isis/src/base/apps/catoriglab/main.cpp similarity index 100% rename from isis/src/base/apps/catoriglab/catoriglab.cpp rename to isis/src/base/apps/catoriglab/main.cpp diff --git a/isis/src/base/apps/catoriglab/tsts/XmlLabel/Makefile b/isis/src/base/apps/catoriglab/tsts/XmlLabel/Makefile index 8c7d14ac85ca530f6cb0b8c8b5bd904ea877628f..13d8c87d2d7568c3bbcc10988c469a29ea912bad 100644 --- a/isis/src/base/apps/catoriglab/tsts/XmlLabel/Makefile +++ b/isis/src/base/apps/catoriglab/tsts/XmlLabel/Makefile @@ -1,21 +1,7 @@ APPNAME = catoriglab -# history 2018-09-05 Kristin Berry - Added code to strip out XML attributes from test, since their order can chage. include $(ISISROOT)/make/isismake.tsts commands: - $(APPNAME) from=$(INPUT)/tgoCaSSISImage.cub \ - APPEND=false TO=$(OUTPUT)/XmlLabelTemp.txt > /dev/null; - $(SED) 's+\FSW_HEADER.*>+\FSW_HEADER>+' \ - $(OUTPUT)/XmlLabelTemp.txt \ - > $(OUTPUT)/tempLabel1.txt; - $(SED) 's+\PEHK_HEADER.*>+\PEHK_HEADER>+' \ - $(OUTPUT)/tempLabel1.txt \ - > $(OUTPUT)/tempLabel2.txt; - $(SED) 's+\Science_Facets.*>+\Science_Facets>+' \ - $(OUTPUT)/tempLabel2.txt \ - > $(OUTPUT)/XmlLabel.txt; - $(RM) $(OUTPUT)/XmlLabelTemp.txt; - $(RM) $(OUTPUT)/tempLabel1.txt; - $(RM) $(OUTPUT)/tempLabel2.txt; - + $(APPNAME) from= $(INPUT)/tgoCaSSISImage.cub \ + APPEND= false TO= $(OUTPUT)/XmlLabel.txt > /dev/null; diff --git a/isis/src/base/apps/center/center.cpp b/isis/src/base/apps/center/main.cpp similarity index 100% rename from isis/src/base/apps/center/center.cpp rename to isis/src/base/apps/center/main.cpp diff --git a/isis/src/base/apps/circle/circle.cpp b/isis/src/base/apps/circle/main.cpp similarity index 100% rename from isis/src/base/apps/circle/circle.cpp rename to isis/src/base/apps/circle/main.cpp diff --git a/isis/src/base/apps/ckwriter/CkKernelWriter.cpp b/isis/src/base/apps/ckwriter/CkKernelWriter.cpp index 8ebb9c3124ef26385b6ef34942cf7cde27f73f37..5057893df07904312967721568fe82847b3a528a 100644 --- a/isis/src/base/apps/ckwriter/CkKernelWriter.cpp +++ b/isis/src/base/apps/ckwriter/CkKernelWriter.cpp @@ -37,7 +37,7 @@ #include "IString.h" #include "NaifStatus.h" #include "Pvl.h" -#include "SpiceSegment.h" +#include "CkSpiceSegment.h" #include "TextFile.h" using namespace std; @@ -105,7 +105,7 @@ namespace Isis { return; } - void CkKernelWriter::write(const SpiceSegment &segment) const { + void CkKernelWriter::write(const CkSpiceSegment &segment) const { switch ( _ckType ) { case 1: writeCk1(segment); @@ -175,10 +175,10 @@ namespace Isis { return; } - void CkKernelWriter::writeCk1(const SpiceSegment &segment) const { + void CkKernelWriter::writeCk1(const CkSpiceSegment &segment) const { - const SpiceSegment::SVector &sclks = segment.SCLKTimes(); - const SpiceSegment::SMatrix &quats = segment.Quaternions(); + const CkSpiceSegment::SVector &sclks = segment.SCLKTimes(); + const CkSpiceSegment::SMatrix &quats = segment.Quaternions(); ConstSpiceDouble *avvs(0); SpiceBoolean hasAvvs(SPICEFALSE); if ( segment.hasAngularVelocities() ) { @@ -198,28 +198,28 @@ namespace Isis { return; } - void CkKernelWriter::writeCk2(const SpiceSegment &segment) const { + void CkKernelWriter::writeCk2(const CkSpiceSegment &segment) const { if ( !segment.hasAngularVelocities() ) { QString mess = "Type 2 CK kernels require angular velocities"; throw IException(IException::User, mess, _FILEINFO_); } - const SpiceSegment::SVector &sclks = segment.SCLKTimes(); - const SpiceSegment::SMatrix &quats = segment.Quaternions(); - const SpiceSegment::SMatrix &avvs = segment.AngularVelocities(); + const CkSpiceSegment::SVector &sclks = segment.SCLKTimes(); + const CkSpiceSegment::SMatrix &quats = segment.Quaternions(); + const CkSpiceSegment::SMatrix &avvs = segment.AngularVelocities(); QString refFrame = segment.ReferenceFrame(); QString segId = segment.Id(); int nrecs = segment.size(); - SpiceSegment::SVector stops(nrecs); + CkSpiceSegment::SVector stops(nrecs); for ( int i = 0 ; i < nrecs-1 ; i++) { stops[i] = sclks[i+1]; } stops[nrecs-1] = sclks[nrecs-1]; - SpiceSegment::SVector rates(nrecs, segment.TickRate()); + CkSpiceSegment::SVector rates(nrecs, segment.TickRate()); NaifStatus::CheckErrors(); ckw02_c(_handle, sclks[0], sclks[nrecs-1], segment.InstCode(), refFrame.toLatin1().data(), segId.toLatin1().data(), nrecs, &sclks[0], @@ -229,10 +229,10 @@ namespace Isis { } - void CkKernelWriter::writeCk3(const SpiceSegment &segment) const { + void CkKernelWriter::writeCk3(const CkSpiceSegment &segment) const { - const SpiceSegment::SVector &sclks = segment.SCLKTimes(); - const SpiceSegment::SMatrix &quats = segment.Quaternions(); + const CkSpiceSegment::SVector &sclks = segment.SCLKTimes(); + const CkSpiceSegment::SMatrix &quats = segment.Quaternions(); ConstSpiceDouble *avvs(0); SpiceBoolean hasAvvs(SPICEFALSE); if ( segment.hasAngularVelocities() ) { @@ -257,5 +257,3 @@ namespace Isis { }; // namespace Isis - - diff --git a/isis/src/base/apps/ckwriter/CkKernelWriter.h b/isis/src/base/apps/ckwriter/CkKernelWriter.h index 1d2ede9103d71f0cfa82f1bd5ebebaf6cc36bb0c..c1c492244b886cf7aa14f49327e8b17545228e32 100644 --- a/isis/src/base/apps/ckwriter/CkKernelWriter.h +++ b/isis/src/base/apps/ckwriter/CkKernelWriter.h @@ -1,67 +1,67 @@ #ifndef CkKernelWriter_h #define CkKernelWriter_h -/** - * @file - * $Revision$ +/** + * @file + * $Revision$ * $Date$ - * - * Unless noted otherwise, the portions of Isis written by the USGS are - * public domain. See individual third-party library and package descriptions - * for intellectual property information, user agreements, and related - * information. - * - * Although Isis has been used by the USGS, no warranty, expressed or - * implied, is made by the USGS as to the accuracy and functioning of such - * software and related material nor shall the fact of distribution + * + * Unless noted otherwise, the portions of Isis written by the USGS are + * public domain. See individual third-party library and package descriptions + * for intellectual property information, user agreements, and related + * information. + * + * Although Isis has been used by the USGS, no warranty, expressed or + * implied, is made by the USGS as to the accuracy and functioning of such + * software and related material nor shall the fact of distribution * constitute any such warranty, and no responsibility is assumed by the - * USGS in connection therewith. - * - * For additional information, launch - * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html + * USGS in connection therewith. + * + * For additional information, launch + * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html * in a browser or see the Privacy & Disclaimers page on the Isis website, * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on * http://www.usgs.gov/privacy.html. - * + * * $Id$ - */ + */ #include namespace Isis { -class SpiceSegment; +class CkSpiceSegment; /** * @brief Support writting of CK kernels to NAIF SPICE files - * + * * This class is designed to support the fundamentals of opening/creating a NAIF * CK kernel file for writing if CK segments. There are currently up to 5 * different types of CK kernels that NAIF supports in its toolkit. We are * mainly concerned with creation of type 3 CK kernels. - * + * * As such, this object provides the ability to create general CK files, specify * comment section size, get the I/O handle associated with the output file, * write comments to the kernel and then close the file when you are done. - * + * * The thing you may see as missing is the write method. Due to the structure * of the NAIF CK writing procedure, each CK type has its own routine that has * different arguments. This makes it "messy" to try and support writing of all * CK types directly in this class. It makes more sense, to me anyway, that the * environment that contains the data to write can better provide the data * required to properly write the CK segment. See the implementation of - * SpiceSegment which provides this procedure. It will have a method that - * looks like SpiceSegment::write(CkKernelWriter &writer). This class exposes + * CkSpiceSegment which provides this procedure. It will have a method that + * looks like CkSpiceSegment::write(CkKernelWriter &writer). This class exposes * the handle need to write the segment and the addComment() method to add * details in the kernel file regarding the segment being written. * * @author 2010-11-25 Kris Becker * - * @internal + * @internal * @history 2015-07-21 Kristin Berry - Added NaifStatus::CheckErrors() to see if any NAIF errors * were signaled. References #2248. */ class CkKernelWriter { public: CkKernelWriter(); - CkKernelWriter(const QString &kfile, const int &csize = 0, + CkKernelWriter(const QString &kfile, const int &csize = 0, const int &cktype = 3); virtual ~CkKernelWriter() { close(); } @@ -74,9 +74,9 @@ class CkKernelWriter { bool addComment(const QString &comment); bool addCommentFile(const QString &comfile); - void open(const QString &kfile, + void open(const QString &kfile, const QString &intCkName = "USGS_CK_File"); - void write(const SpiceSegment &segment) const; + void write(const CkSpiceSegment &segment) const; void close(); private: @@ -89,13 +89,11 @@ class CkKernelWriter { void init(); bool writeComment(const QString &comment) const; - void writeCk1(const SpiceSegment &segment) const; - void writeCk2(const SpiceSegment &segment) const; - void writeCk3(const SpiceSegment &segment) const; + void writeCk1(const CkSpiceSegment &segment) const; + void writeCk2(const CkSpiceSegment &segment) const; + void writeCk3(const CkSpiceSegment &segment) const; }; }; // namespace Isis #endif - - diff --git a/isis/src/base/apps/ckwriter/SpiceSegment.cpp b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp similarity index 87% rename from isis/src/base/apps/ckwriter/SpiceSegment.cpp rename to isis/src/base/apps/ckwriter/CkSpiceSegment.cpp index 526cd89bdfcbe58b65308bf69f090dc0d03a777f..cf6930447588935cee101762a0079c034b895ef6 100644 --- a/isis/src/base/apps/ckwriter/SpiceSegment.cpp +++ b/isis/src/base/apps/ckwriter/CkSpiceSegment.cpp @@ -43,7 +43,7 @@ #include "IException.h" #include "IString.h" #include "NaifStatus.h" -#include "SpiceSegment.h" +#include "CkSpiceSegment.h" #include "Table.h" using namespace std; @@ -52,12 +52,12 @@ namespace Isis { /** Default constructor */ -SpiceSegment::SpiceSegment() { +CkSpiceSegment::CkSpiceSegment() { init(); } /** Construct with an ISIS cube file */ -SpiceSegment::SpiceSegment(const QString &fname) { +CkSpiceSegment::CkSpiceSegment(const QString &fname) { init(); Cube cube; cube.open(fname); @@ -65,13 +65,13 @@ SpiceSegment::SpiceSegment(const QString &fname) { } /** Construct with a Cube and optional naming of table */ -SpiceSegment::SpiceSegment(Cube &cube, const QString &tblname) { +CkSpiceSegment::CkSpiceSegment(Cube &cube, const QString &tblname) { init(); import(cube, tblname); } /** Set the name of the CK SPICE segment */ -void SpiceSegment::setId(const QString &name) { +void CkSpiceSegment::setId(const QString &name) { _name = name; return; } @@ -87,7 +87,7 @@ void SpiceSegment::setId(const QString &name) { * * @return int Returns number of kernels loaded */ -int SpiceSegment::FurnshKernelType(const QString &ktypes) const { +int CkSpiceSegment::FurnshKernelType(const QString &ktypes) const { return (_kernels.Load(ktypes)); } @@ -103,7 +103,7 @@ int SpiceSegment::FurnshKernelType(const QString &ktypes) const { * * @return int Returns number of kernels unloaded */ -int SpiceSegment::UnloadKernelType(const QString &ktypes) const { +int CkSpiceSegment::UnloadKernelType(const QString &ktypes) const { return (_kernels.UnLoad(ktypes)); } @@ -115,9 +115,9 @@ int SpiceSegment::UnloadKernelType(const QString &ktypes) const { * 1-element vector with the start time of the first quaternion. * * - * @return SpiceSegment::SVector& Vector of start times for each interval + * @return CkSpiceSegment::SVector& Vector of start times for each interval */ -SpiceSegment::SVector SpiceSegment::SCLKStartIntervals() const { +CkSpiceSegment::SVector CkSpiceSegment::SCLKStartIntervals() const { return (SVector(1, _times[0])); } @@ -129,9 +129,9 @@ SpiceSegment::SVector SpiceSegment::SCLKStartIntervals() const { * 1-element vector with the stop time of the last quaternion. * * - * @return SpiceSegment::SVector& Vector of stop times for each interval + * @return CkSpiceSegment::SVector& Vector of stop times for each interval */ -SpiceSegment::SVector SpiceSegment::SCLKStopIntervals() const { +CkSpiceSegment::SVector CkSpiceSegment::SCLKStopIntervals() const { return (SVector(1, _times[size(_times)-1])); } @@ -148,13 +148,13 @@ SpiceSegment::SVector SpiceSegment::SCLKStopIntervals() const { * time. * * - * @return SpiceSegment::SVector& Vector of tick rates for each interval + * @return CkSpiceSegment::SVector& Vector of tick rates for each interval */ -SpiceSegment::SVector SpiceSegment::TickRate() const { +CkSpiceSegment::SVector CkSpiceSegment::TickRate() const { return (SVector(1, _tickRate)); } -QString SpiceSegment::getKeyValue(PvlObject &label, +QString CkSpiceSegment::getKeyValue(PvlObject &label, const QString &keyword) { QString value(""); if ( label.hasKeyword(keyword,Pvl::Traverse) ) { @@ -163,7 +163,7 @@ QString SpiceSegment::getKeyValue(PvlObject &label, return (value); } -void SpiceSegment::import(Cube &cube, const QString &tblname) { +void CkSpiceSegment::import(Cube &cube, const QString &tblname) { _fname = cube.fileName(); @@ -279,7 +279,7 @@ void SpiceSegment::import(Cube &cube, const QString &tblname) { } -SpiceSegment::SMatrix SpiceSegment::getQuaternions(const SMatrix &spice) const { +CkSpiceSegment::SMatrix CkSpiceSegment::getQuaternions(const SMatrix &spice) const { int nrecs = size(spice); SMatrix quats(nrecs, 4); @@ -291,7 +291,7 @@ SpiceSegment::SMatrix SpiceSegment::getQuaternions(const SMatrix &spice) const { return (quats); } -SpiceSegment::SMatrix SpiceSegment::getAngularVelocities(const SMatrix &spice) +CkSpiceSegment::SMatrix CkSpiceSegment::getAngularVelocities(const SMatrix &spice) const { int nrecs = size(spice); int fields = spice.dim2(); @@ -310,7 +310,7 @@ SpiceSegment::SMatrix SpiceSegment::getAngularVelocities(const SMatrix &spice) } -SpiceSegment::SVector SpiceSegment::getTimes(const SMatrix &spice) const { +CkSpiceSegment::SVector CkSpiceSegment::getTimes(const SMatrix &spice) const { int nrecs = size(spice); SVector etdp(nrecs); int tcol = spice.dim2() - 1; @@ -321,7 +321,7 @@ SpiceSegment::SVector SpiceSegment::getTimes(const SMatrix &spice) const { return (etdp); } -bool SpiceSegment::getTimeDependentFrameIds(Table &table, int &toId, int &fromId) const { +bool CkSpiceSegment::getTimeDependentFrameIds(Table &table, int &toId, int &fromId) const { // Load the constant and time-based frame traces and mission frame ids std::vector tdfids; if ( table.Label().hasKeyword("TimeDependentFrames") ) { @@ -343,32 +343,32 @@ bool SpiceSegment::getTimeDependentFrameIds(Table &table, int &toId, int &fromId /** - * @brief Determine left/right CK rotation chains that match mission CK format - * - * This method determines the left and right rotation chains that are needed to - * convert the quaternions stored in ISIS CK blobs to reference and frame states + * @brief Determine left/right CK rotation chains that match mission CK format + * + * This method determines the left and right rotation chains that are needed to + * convert the quaternions stored in ISIS CK blobs to reference and frame states * as represented in the mission CK kernels. These chains are determined solely - * from the time dependent frames from the blob labels. - * - * Note that if there is no rotation required, an empty or 1 element vector is + * from the time dependent frames from the blob labels. + * + * Note that if there is no rotation required, an empty or 1 element vector is * returned. It is up to the caller to decide how to handle this situation. - * - * @author 2013-06-07 Kris Becker - * @internal + * + * @author 2013-06-07 Kris Becker + * @internal * @history 2012-12-16 Kris Becker - Fixed problem when the * TimeDependentFrames keyword does not contain one or * both of the CK reference frames. Fixes #1737. - * - * @param table - * @param leftBase - * @param rightBase - * @param leftChain - * @param rightChain - * - * @return bool True if both left and right chains are valid, false if failure + * + * @param table + * @param leftBase + * @param rightBase + * @param leftChain + * @param rightChain + * + * @return bool True if both left and right chains are valid, false if failure * occurs. */ -bool SpiceSegment::getFrameChains(Table &table, const int &leftBase, +bool CkSpiceSegment::getFrameChains(Table &table, const int &leftBase, const int &rightBase, QVector &leftChain, QVector &rightChain) const { @@ -397,8 +397,8 @@ bool SpiceSegment::getFrameChains(Table &table, const int &leftBase, if ( (nfound == 0) || (nfound > 2) ) { ostringstream mess; - mess << "Left/Right CK frame ids invalid in TimeDependentFrames label keyword." - << " Must have at least 1 and no more than 2 ids but have " + mess << "Left/Right CK frame ids invalid in TimeDependentFrames label keyword." + << " Must have at least 1 and no more than 2 ids but have " << QString::number(nfound); throw IException(IException::User, mess.str(), _FILEINFO_); } @@ -417,7 +417,7 @@ bool SpiceSegment::getFrameChains(Table &table, const int &leftBase, if ( leftBase != lastLeft) leftChain.push_back(leftBase); // Get the right CK ID chain - int lastRight(rightBase); + int lastRight(rightBase); BOOST_REVERSE_FOREACH (int rightId, tdfids) { // if (rightId == 1) continue; // REMOVE THIS - its only testing B1950! // Order is important in this code section! @@ -434,7 +434,7 @@ bool SpiceSegment::getFrameChains(Table &table, const int &leftBase, return (true); } -QString SpiceSegment::getFrameName(int frameid) const { +QString CkSpiceSegment::getFrameName(int frameid) const { SpiceChar frameBuf[40]; NaifStatus::CheckErrors(); frmnam_c ( (SpiceInt) frameid, sizeof(frameBuf), frameBuf); @@ -442,7 +442,7 @@ QString SpiceSegment::getFrameName(int frameid) const { return (QString(frameBuf)); } -SpiceSegment::SMatrix SpiceSegment::getConstantRotation(Table &table) const { +CkSpiceSegment::SMatrix CkSpiceSegment::getConstantRotation(Table &table) const { // Get constant rotation matrix from label SMatrix crot(3,3); try { @@ -461,7 +461,7 @@ SpiceSegment::SMatrix SpiceSegment::getConstantRotation(Table &table) const { return (crot); } -SpiceSegment::SMatrix SpiceSegment::getIdentityRotation(const int &nelements) const { +CkSpiceSegment::SMatrix CkSpiceSegment::getIdentityRotation(const int &nelements) const { // Get constant rotation matrix from label SMatrix irot(nelements, nelements, 0.0); for (int i=0; i < nelements ; i++) { @@ -491,14 +491,14 @@ SpiceSegment::SMatrix SpiceSegment::getIdentityRotation(const int &nelements) co * @param frame2 Frame name of desired state * @param etTime Empheris time to acquire state rotation for * - * @return SpiceSegment::SMatrix A 6x6 state rotation matrix + * @return CkSpiceSegment::SMatrix A 6x6 state rotation matrix */ -SpiceSegment::SMatrix SpiceSegment::computeStateRotation(const QString &frame1, +CkSpiceSegment::SMatrix CkSpiceSegment::computeStateRotation(const QString &frame1, const QString &frame2, double etTime) const { SMatrix state(6,6); NaifStatus::CheckErrors(); -// cout << "StateRotations for frame1 = " << frame1 +// cout << "StateRotations for frame1 = " << frame1 // << " to frame2 = " << frame2 << "\n"; try { @@ -524,8 +524,8 @@ SpiceSegment::SMatrix SpiceSegment::computeStateRotation(const QString &frame1, return (state); } -SpiceSegment::SMatrix SpiceSegment::computeChainRotation( - const QVector &fChain, +CkSpiceSegment::SMatrix CkSpiceSegment::computeChainRotation( + const QVector &fChain, const int &terminatorID, const double &etTime) const { @@ -536,7 +536,7 @@ SpiceSegment::SMatrix SpiceSegment::computeChainRotation( if ( fChain.size() > 0 ) { QVector chain = fChain; - // Check for case where only 1 frame is given. It should be the + // Check for case where only 1 frame is given. It should be the // terminating frame. If it isn't, append it to the list as the last // to frame if ( chain.size() == 1 ) { @@ -561,7 +561,7 @@ SpiceSegment::SMatrix SpiceSegment::computeChainRotation( } -void SpiceSegment::getRotationMatrices(Cube &cube, Camera &camera, Table &table, +void CkSpiceSegment::getRotationMatrices(Cube &cube, Camera &camera, Table &table, SMatSeq &lmats, SMatSeq &rmats, SVector &sclks) { @@ -576,7 +576,7 @@ void SpiceSegment::getRotationMatrices(Cube &cube, Camera &camera, Table &table, QString mess = "Cannot determine time dependent frames! - perhaps a spiceinit is in order."; throw IException(IException::User, mess, _FILEINFO_); } -#else +#else QVector leftFrames, rightFrames; if ( !getFrameChains(table, leftId, rightId, leftFrames, rightFrames) ) { QString mess = "Cannot determine left/right frame chains! - perhaps a spiceinit is in order."; @@ -607,7 +607,7 @@ void SpiceSegment::getRotationMatrices(Cube &cube, Camera &camera, Table &table, return; } -const SpiceSegment::SMatrix &SpiceSegment::getMatrix(const SpiceSegment::SMatSeq &seq, +const CkSpiceSegment::SMatrix &CkSpiceSegment::getMatrix(const CkSpiceSegment::SMatSeq &seq, const int &nth) const { if ( (nth < size(seq)) && (nth >= 0) ) { return (seq[nth]); @@ -615,9 +615,9 @@ const SpiceSegment::SMatrix &SpiceSegment::getMatrix(const SpiceSegment::SMatSeq return (seq[0]); } -SpiceSegment::SVector SpiceSegment::convertTimes( +CkSpiceSegment::SVector CkSpiceSegment::convertTimes( int sclkCode, - const SpiceSegment::SVector &etTimes + const CkSpiceSegment::SVector &etTimes ) { NaifStatus::CheckErrors(); SVector sclks(size(etTimes)); @@ -639,12 +639,12 @@ SpiceSegment::SVector SpiceSegment::convertTimes( } -void SpiceSegment::convert(const SpiceSegment::SMatrix &quats, - const SpiceSegment::SMatrix &avvs, - const SpiceSegment::SMatSeq &lmats, - const SpiceSegment::SMatSeq &rmats, - SpiceSegment::SMatrix &ckQuats, - SpiceSegment::SMatrix &ckAvvs) const { +void CkSpiceSegment::convert(const CkSpiceSegment::SMatrix &quats, + const CkSpiceSegment::SMatrix &avvs, + const CkSpiceSegment::SMatSeq &lmats, + const CkSpiceSegment::SMatSeq &rmats, + CkSpiceSegment::SMatrix &ckQuats, + CkSpiceSegment::SMatrix &ckAvvs) const { ckQuats = SMatrix(quats.dim1(), quats.dim2()); ckAvvs = SMatrix(avvs.dim1(), avvs.dim2()); @@ -683,7 +683,7 @@ void SpiceSegment::convert(const SpiceSegment::SMatrix &quats, } -QString SpiceSegment::getComment() const { +QString CkSpiceSegment::getComment() const { ostringstream comment; FileName fname(_fname); @@ -719,7 +719,7 @@ QString SpiceSegment::getComment() const { return (QString(comment.str().c_str())); } -void SpiceSegment::init() { +void CkSpiceSegment::init() { _camVersion = 1; _name = _fname = ""; _startTime = _endTime = 0.0; @@ -733,7 +733,7 @@ void SpiceSegment::init() { return; } -SpiceSegment::SMatrix SpiceSegment::load(Table &table) { +CkSpiceSegment::SMatrix CkSpiceSegment::load(Table &table) { // Allocate the internal cache and transfer. // Makes some assumptions about the format of the SPICE table in that @@ -784,10 +784,10 @@ SpiceSegment::SMatrix SpiceSegment::load(Table &table) { * @param vec number of elements to add to the bottom * @param matrix Matrix to add elements to * - * @return SpiceSegment::SMatrix Expanded matrix + * @return CkSpiceSegment::SMatrix Expanded matrix */ -SpiceSegment::SMatrix SpiceSegment::expand(int ntop, int nbot, - const SpiceSegment::SMatrix &matrix) +CkSpiceSegment::SMatrix CkSpiceSegment::expand(int ntop, int nbot, + const CkSpiceSegment::SMatrix &matrix) const { // Add lines to matrix at top and bottom int ndim(matrix.dim1()); @@ -841,10 +841,10 @@ SpiceSegment::SMatrix SpiceSegment::expand(int ntop, int nbot, * @param vec number of elements to add to the bottom * @param vector Vector to add elements to * - * @return SpiceSegment::SVector Expanded vector + * @return CkSpiceSegment::SVector Expanded vector */ -SpiceSegment::SVector SpiceSegment::expand(int ntop, int nbot, - const SpiceSegment::SVector &vec) +CkSpiceSegment::SVector CkSpiceSegment::expand(int ntop, int nbot, + const CkSpiceSegment::SVector &vec) const { // Add lines to matrix at top and bottom int ndim(vec.dim1()); @@ -872,7 +872,7 @@ SpiceSegment::SVector SpiceSegment::expand(int ntop, int nbot, return (myvec); } -double SpiceSegment::SCLKtoET(SpiceInt scCode, double sclk) const { +double CkSpiceSegment::SCLKtoET(SpiceInt scCode, double sclk) const { SpiceDouble et; NaifStatus::CheckErrors(); @@ -882,7 +882,7 @@ double SpiceSegment::SCLKtoET(SpiceInt scCode, double sclk) const { return (et); } -double SpiceSegment::ETtoSCLK(SpiceInt scCode, double et) const { +double CkSpiceSegment::ETtoSCLK(SpiceInt scCode, double et) const { SpiceDouble sclk; NaifStatus::CheckErrors(); @@ -892,7 +892,7 @@ double SpiceSegment::ETtoSCLK(SpiceInt scCode, double et) const { return (sclk); } -QString SpiceSegment::toUTC(const double &et) const { +QString CkSpiceSegment::toUTC(const double &et) const { const int UTCLEN = 80; char utcout[UTCLEN]; @@ -904,4 +904,3 @@ QString SpiceSegment::toUTC(const double &et) const { } }; // namespace Isis - diff --git a/isis/src/base/apps/ckwriter/SpiceSegment.h b/isis/src/base/apps/ckwriter/CkSpiceSegment.h similarity index 79% rename from isis/src/base/apps/ckwriter/SpiceSegment.h rename to isis/src/base/apps/ckwriter/CkSpiceSegment.h index 9bee3707d37defdc4879a5eb46bce5183a98072d..e25a40589d528a8674cbe3201ffd63886a724b82 100644 --- a/isis/src/base/apps/ckwriter/SpiceSegment.h +++ b/isis/src/base/apps/ckwriter/CkSpiceSegment.h @@ -1,29 +1,29 @@ -#ifndef SpiceSegment_h -#define SpiceSegment_h -/** - * @file - * $Revision$ +#ifndef CkSpiceSegment_h +#define CkSpiceSegment_h +/** + * @file + * $Revision$ * $Date$ - * - * Unless noted otherwise, the portions of Isis written by the USGS are - * public domain. See individual third-party library and package descriptions - * for intellectual property information, user agreements, and related - * information. - * - * Although Isis has been used by the USGS, no warranty, expressed or - * implied, is made by the USGS as to the accuracy and functioning of such - * software and related material nor shall the fact of distribution + * + * Unless noted otherwise, the portions of Isis written by the USGS are + * public domain. See individual third-party library and package descriptions + * for intellectual property information, user agreements, and related + * information. + * + * Although Isis has been used by the USGS, no warranty, expressed or + * implied, is made by the USGS as to the accuracy and functioning of such + * software and related material nor shall the fact of distribution * constitute any such warranty, and no responsibility is assumed by the - * USGS in connection therewith. - * - * For additional information, launch - * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html + * USGS in connection therewith. + * + * For additional information, launch + * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html * in a browser or see the Privacy & Disclaimers page on the Isis website, * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on * http://www.usgs.gov/privacy.html. - * + * * $Id$ - */ + */ #include #include @@ -55,18 +55,18 @@ class PvlObject; /** * @brief Maintain a SPICE kernel segment for conversions and export - * + * * This class is designed to read SPICE data from ISIS cube blobs and convert * them to proper formats for export to NAIF formatted SPICE kernel files. This * particular implementation supports NAIF CK kernel types 1, 2 and 3. - * - * @author 2010-11-10 Kris Becker - * @internal + * + * @author 2010-11-10 Kris Becker + * @internal * @history 2010-12-09 Kris Becker Added more documentation - * @history 2011-05-04 Kris Becker Added pad time. + * @history 2011-05-04 Kris Becker Added pad time. * @history 2011-05-29 Debbie A. Cook Changed name of local Kernels class to * LocalKernels to avoid confusion - * @history 2011-06-15 Kris Becker Removed use of LocalKernels and use version + * @history 2011-06-15 Kris Becker Removed use of LocalKernels and use version * in system; added loading of IAK kernel * specifically for Cassini support; removed * conditionalized obsolete code. @@ -77,23 +77,23 @@ class PvlObject; * instrument code since the IdealCamera has * no code. This is safe to do since the * camera is not being used to manipulate - * pixels. - * @history 2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis + * pixels. + * @history 2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis * coding standards. References #972. - * - * @history 2015-07-21 Kristin Berry - Added NaifStatus::CheckErrors() to see if any NAIF errors + * + * @history 2015-07-21 Kristin Berry - Added NaifStatus::CheckErrors() to see if any NAIF errors * were signaled. References #2248. */ -class SpiceSegment { +class CkSpiceSegment { public: typedef TNT::Array1D SVector; //!< 1-D Buffer typedef TNT::Array2D SMatrix; //!< 2-D buffer - SpiceSegment(); - SpiceSegment(const QString &fname); - SpiceSegment(Cube &cube, const QString &tblname = "SpiceSegment"); - virtual ~SpiceSegment() { } - + CkSpiceSegment(); + CkSpiceSegment(const QString &fname); + CkSpiceSegment(Cube &cube, const QString &tblname = "CkSpiceSegment"); + virtual ~CkSpiceSegment() { } + /** Returns the number of elements in the quaternions */ int size() const { return (size(_quats)); } @@ -106,7 +106,7 @@ class SpiceSegment { /** End time of segment in ET */ double endTime() const { return (_endTime); } - bool operator<(const SpiceSegment &segment) const { + bool operator<(const CkSpiceSegment &segment) const { return (startTime() < segment.startTime()); } @@ -165,14 +165,14 @@ class SpiceSegment { template int size(const TNTSTORE &t) const { return (t.dim1()); } QString getKeyValue(PvlObject &label, const QString &keyword); - void import(Cube &cube, const QString &tblname = "SpiceSegment"); + void import(Cube &cube, const QString &tblname = "CkSpiceSegment"); SMatrix load(Table &cache); SMatrix getQuaternions(const SMatrix &spice) const; SMatrix getAngularVelocities(const SMatrix &spice) const; SVector getTimes(const SMatrix &spice) const; bool getTimeDependentFrameIds(Table &table, int &toId, int &fromId) const; - bool getFrameChains(Table &table, const int &leftBase, + bool getFrameChains(Table &table, const int &leftBase, const int &rightBase, QVector &leftChain, QVector &rightChain) const; @@ -180,17 +180,17 @@ class SpiceSegment { SMatrix getConstantRotation(Table &table) const; SMatrix getIdentityRotation(const int &nelements = 3) const; - SMatrix computeStateRotation(const QString &frame1, - const QString &frame2, + SMatrix computeStateRotation(const QString &frame1, + const QString &frame2, double etTime) const; - SMatrix computeChainRotation(const QVector &fChain, - const int &ckId, const double &etTime) const; + SMatrix computeChainRotation(const QVector &fChain, + const int &ckId, const double &etTime) const; void getRotationMatrices(Cube &cube, Camera &camera, Table &table, SMatSeq &lmats, SMatSeq &rmat, SVector &sclks); SVector convertTimes(int scCode, const SVector &etTimes); void convert(const SMatrix &quats, const SMatrix &avvs, - const SMatSeq &lmats, const SMatSeq &rmats, + const SMatSeq &lmats, const SMatSeq &rmats, SMatrix &ckQuats, SMatrix &ckAvvs) const; const SMatrix &getMatrix(const SMatSeq &seq, const int &nth) const; @@ -206,4 +206,3 @@ class SpiceSegment { }; // namespace Isis #endif - diff --git a/isis/src/base/apps/ckwriter/SpiceKernel.cpp b/isis/src/base/apps/ckwriter/SpiceKernel.cpp index 00450d17a1955085d2b5bfd9631a6d692da26c14..52b7d6c1c08f4ffeb1764b3935674b491cc043e3 100644 --- a/isis/src/base/apps/ckwriter/SpiceKernel.cpp +++ b/isis/src/base/apps/ckwriter/SpiceKernel.cpp @@ -60,20 +60,20 @@ void SpiceKernel::add(const QString &cfile) { } void SpiceKernel::add(Cube &cube) { - m_segments.push_back(SpiceSegment(cube)); + m_segments.push_back(CkSpiceSegment(cube)); return; } -const SpiceSegment &SpiceKernel::operator[](const int i) const { +const CkSpiceSegment &SpiceKernel::operator[](const int i) const { return (m_segments[i]); } -bool CheckSegment(const SpiceSegment *s1, const SpiceSegment *s2) { +bool CheckSegment(const CkSpiceSegment *s1, const CkSpiceSegment *s2) { return (s1->startTime() < s2->startTime()); } QString SpiceKernel::getSummary(const QString &commfile) const { - vector seglist; + vector seglist; for ( int i = 0 ; i < size() ; i++) { seglist.push_back(&m_segments[i]); } @@ -92,7 +92,7 @@ QString SpiceKernel::getSummary(const QString &commfile) const { bool SpiceKernel::validate() const { - QVector seglist; + QVector seglist; for ( int i = 0 ; i < size() ; i++) { seglist.push_back(&m_segments[i]); } @@ -124,13 +124,13 @@ bool SpiceKernel::validate() const { throw IException(IException::User, mess, _FILEINFO_); } - return (true); + return (true); } void SpiceKernel::write(const QString &kname, const QString &comfile, const int cktype) const { - vector seglist; + vector seglist; int comChars(0); for ( int i = 0 ; i < size() ; i++) { seglist.push_back(&m_segments[i]); @@ -282,4 +282,3 @@ Segment (by file) Summary\n\ } }; // namespace Isis - diff --git a/isis/src/base/apps/ckwriter/SpiceKernel.h b/isis/src/base/apps/ckwriter/SpiceKernel.h index 2e40da3dc02f6a0944d1616fb9d68fce413a737d..ce17c42e6e71031860823804cf8b0a3c407f6df6 100644 --- a/isis/src/base/apps/ckwriter/SpiceKernel.h +++ b/isis/src/base/apps/ckwriter/SpiceKernel.h @@ -1,29 +1,29 @@ #ifndef SpiceKernel_h #define SpiceKernel_h -/** - * @file - * $Revision$ +/** + * @file + * $Revision$ * $Date$ - * - * Unless noted otherwise, the portions of Isis written by the USGS are - * public domain. See individual third-party library and package descriptions - * for intellectual property information, user agreements, and related - * information. - * - * Although Isis has been used by the USGS, no warranty, expressed or - * implied, is made by the USGS as to the accuracy and functioning of such - * software and related material nor shall the fact of distribution + * + * Unless noted otherwise, the portions of Isis written by the USGS are + * public domain. See individual third-party library and package descriptions + * for intellectual property information, user agreements, and related + * information. + * + * Although Isis has been used by the USGS, no warranty, expressed or + * implied, is made by the USGS as to the accuracy and functioning of such + * software and related material nor shall the fact of distribution * constitute any such warranty, and no responsibility is assumed by the - * USGS in connection therewith. - * - * For additional information, launch - * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html + * USGS in connection therewith. + * + * For additional information, launch + * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html * in a browser or see the Privacy & Disclaimers page on the Isis website, * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on * http://www.usgs.gov/privacy.html. - * + * * $Id$ - */ + */ #include #include @@ -33,19 +33,19 @@ #include "IString.h" #include "IException.h" -#include "SpiceSegment.h" +#include "CkSpiceSegment.h" namespace Isis { /** * @brief Container for SPICE kernel creation - * + * * This class serves as a container for ISIS cube files to prep for writing the * contents to a NAIF SPICE kernel. Each file added is a CK segment. When the * ISIS cube is added, the contents of the Table BLOB (InstrumentRotation for * CKs, InstrumentPosition for SPKs) are read and transformed to the appropriate * state intended to be compatible with kernels issued by each mission source. - * + * * It is designed for ease of use. Here is an example to create the most basic * of CK kernel from a single ISIS file: * @code @@ -53,21 +53,21 @@ namespace Isis { * kernel.add("mycube.cub"); * kernel.write("mycube.ck"); // Writes a type 3 CK kernel by default * @endcode - * + * * Note that processing ISIS cubes is expensive in terms of NAIF kernel * management. Lots of NAIF kernel activity is incurred in resolving all the * necessary requirements to get the SPICE data in a form that satisfies NAIF * kernel specifications. - * + * * @ingroup Utility - * + * * @author 2010-11-22 Kris Becker * @internal - * @history 2010-12-09 Kris Becker Add documentation and example - * @history 2013-07-10 Kris Becker Updated to better conform with coding + * @history 2010-12-09 Kris Becker Add documentation and example + * @history 2013-07-10 Kris Becker Updated to better conform with coding * standards - * @history 2013-12-17 Kris Becker Include user comments in generic comments - * rather than replacing them. + * @history 2013-12-17 Kris Becker Include user comments in generic comments + * rather than replacing them. */ class SpiceKernel { public: @@ -76,7 +76,7 @@ class SpiceKernel { /** Returns the number of segments */ int size() const { return (m_segments.size()); } - const SpiceSegment &operator[](const int i) const; + const CkSpiceSegment &operator[](const int i) const; void add(const QString &fname); void add(Cube &cube); @@ -89,7 +89,7 @@ class SpiceKernel { const int ckType = 3) const; private: - typedef std::vector Segments; + typedef std::vector Segments; Segments m_segments; void init(); @@ -98,4 +98,3 @@ class SpiceKernel { }; // namespace Isis #endif - diff --git a/isis/src/base/apps/ckwriter/ckwriter.cpp b/isis/src/base/apps/ckwriter/main.cpp similarity index 97% rename from isis/src/base/apps/ckwriter/ckwriter.cpp rename to isis/src/base/apps/ckwriter/main.cpp index d2ecfc9b4142d059e49fa5580047689db7c3b079..3871d14c6c31a41c8c07ee61cdaae35a033b1ac7 100644 --- a/isis/src/base/apps/ckwriter/ckwriter.cpp +++ b/isis/src/base/apps/ckwriter/main.cpp @@ -6,7 +6,7 @@ #include "Process.h" #include "Pvl.h" #include "SpiceKernel.h" -#include "SpiceSegment.h" +#include "CkSpiceSegment.h" using namespace std; using namespace Isis; @@ -51,7 +51,7 @@ void IsisMain() { PvlGroup overlap = overrors.group(i); overlap.setName("Overlaps"); overlap.addKeyword(PvlKeyword("Class", "WARNING"), PvlContainer::Replace); - Application::Log(overlap); + Application::Log(overlap); } } diff --git a/isis/src/base/apps/copylabel/copylabel.cpp b/isis/src/base/apps/copylabel/main.cpp similarity index 100% rename from isis/src/base/apps/copylabel/copylabel.cpp rename to isis/src/base/apps/copylabel/main.cpp diff --git a/isis/src/base/apps/cosi/cosi.cpp b/isis/src/base/apps/cosi/main.cpp similarity index 100% rename from isis/src/base/apps/cosi/cosi.cpp rename to isis/src/base/apps/cosi/main.cpp diff --git a/isis/src/base/apps/crop/crop.cpp b/isis/src/base/apps/crop/crop.cpp index 074924e29cf6ab92b1b17394e695896ffe04b0a1..0c7a9d0209169eb5539a626b1c72107eab46252c 100644 --- a/isis/src/base/apps/crop/crop.cpp +++ b/isis/src/base/apps/crop/crop.cpp @@ -1,35 +1,37 @@ -#include "Isis.h" - #include -#include "Cube.h" -#include "ProcessByLine.h" -#include "SpecialPixel.h" -#include "LineManager.h" -#include "FileName.h" -#include "IException.h" -#include "Projection.h" -#include "AlphaCube.h" -#include "Table.h" -#include "SubArea.h" +#include "crop.h" using namespace std; using namespace Isis; -// Globals and prototypes -int ss, sl, sb; -int ns, nl, nb; -int sinc, linc; -Cube *cube = NULL; -LineManager *in = NULL; +PvlGroup crop(UserInterface &ui) { + // Globals and prototypes + int ss, sl, sb; + int ns, nl, nb; + int sinc, linc; + + Cube *cube = NULL; + LineManager *in = NULL; + + // Line processing routine + auto cropProccess = [&](Buffer &out)->void { + // Read the input line + int iline = sl + (out.Line() - 1) * linc; + in->SetLine(iline, sb); + cube->read(*in); + + // Loop and move appropriate samples + for(int i = 0; i < out.size(); i++) { + out[i] = (*in)[(ss - 1) + i * sinc]; + } -void crop(Buffer &out); + if(out.Line() == nl) sb++; + }; -void IsisMain() { ProcessByLine p; // Open the input cube - UserInterface &ui = Application::GetUserInterface(); QString from = ui.GetAsString("FROM"); CubeAttributeInput inAtt(from); cube = new Cube(); @@ -170,7 +172,7 @@ void IsisMain() { in = new LineManager(*cube); // Crop the input cube - p.StartProcess(crop); + p.StartProcess(cropProccess); delete in; in = NULL; @@ -204,20 +206,5 @@ void IsisMain() { cube = NULL; // Write the results to the log - Application::Log(results); -} - -// Line processing routine -void crop(Buffer &out) { - // Read the input line - int iline = sl + (out.Line() - 1) * linc; - in->SetLine(iline, sb); - cube->read(*in); - - // Loop and move appropriate samples - for(int i = 0; i < out.size(); i++) { - out[i] = (*in)[(ss - 1) + i * sinc]; - } - - if(out.Line() == nl) sb++; + return results; } diff --git a/isis/src/base/apps/crop/crop.h b/isis/src/base/apps/crop/crop.h new file mode 100644 index 0000000000000000000000000000000000000000..d6142d72bbb03246e7b7cea92aab8b2db3326cf9 --- /dev/null +++ b/isis/src/base/apps/crop/crop.h @@ -0,0 +1,18 @@ +#ifndef crop_h +#define crop_h + +#include "Cube.h" +#include "ProcessByLine.h" +#include "SpecialPixel.h" +#include "LineManager.h" +#include "FileName.h" +#include "IException.h" +#include "Projection.h" +#include "AlphaCube.h" +#include "Table.h" +#include "SubArea.h" +#include "UserInterface.h" + +extern Isis::PvlGroup crop(Isis::UserInterface &ui); + +#endif diff --git a/isis/src/base/apps/crop/main.cpp b/isis/src/base/apps/crop/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bda49e09f5a27699a7752f98dac123332bd1f267 --- /dev/null +++ b/isis/src/base/apps/crop/main.cpp @@ -0,0 +1,12 @@ +#include "Isis.h" + +#include "crop.h" + +using namespace std; +using namespace Isis; + +void IsisMain() { + UserInterface &ui = Application::GetUserInterface(); + PvlGroup results = crop(ui); + Application::Log(results); +} diff --git a/isis/src/base/apps/cropspecial/cropspecial.cpp b/isis/src/base/apps/cropspecial/main.cpp similarity index 100% rename from isis/src/base/apps/cropspecial/cropspecial.cpp rename to isis/src/base/apps/cropspecial/main.cpp diff --git a/isis/src/base/apps/csv2table/Makefile b/isis/src/base/apps/csv2table/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7578f0b21d038db6a5042c095cda9b34b6bb2570 --- /dev/null +++ b/isis/src/base/apps/csv2table/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.apps +endif \ No newline at end of file diff --git a/isis/src/base/apps/csv2table/csv2table.xml b/isis/src/base/apps/csv2table/csv2table.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2bd1a7c0f1779d4ca0bc449b568d613ff383ac0 --- /dev/null +++ b/isis/src/base/apps/csv2table/csv2table.xml @@ -0,0 +1,103 @@ + + + + + Convert a CSV file to a table and attach it to a cube + + + + This application converts a CSV file to a table and attaches it to a cube + The first row of the CSV will be used as the fieldnames for the table. + The contents of the CSV file will be converted to floating point numbers + before they are inserted into the table. + + + + Scripting + + + + + tabledump + + + + + + Original version + + + + + + + filename + input + Input CSV filename + + Input CSV filename. The first row of this file will be used as the + table field names. + + + *.csv + + + + + filename + input + Input table label PVL filename + + Input table label PVL filename. This is expected to be a flat PVL + file where all of the keywords and their values will be added to + the tabel label. + + None + + *.pvl + + + + + cube + output + Output cube filename + + Output cube filename that the table will be attached to + + + *.cub + + + + + + + string + The name of the table + + A table will be created with this name on the output cube using the + data from the CSV file. If a table with this name already exists on + the cube it will be overwritten. + + + + + + + + + Write a simple table + Write a simple csv file to a cube. + + csv=test.csv tablename=TestTable to=isisTruth.cub + + + In this example, csv2table will write a table called TestTable on + isisTruth.cub with the contents of test.csv. + + + + + + diff --git a/isis/src/base/apps/csv2table/main.cpp b/isis/src/base/apps/csv2table/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..439e274d9c3a6facbba616004ba9a02837424c9f --- /dev/null +++ b/isis/src/base/apps/csv2table/main.cpp @@ -0,0 +1,120 @@ +/** + * @file + * $Revision: 1.8 $ + * $Date: 2010/04/08 15:28:20 $ + * + * Unless noted otherwise, the portions of Isis written by the USGS are public + * domain. See individual third-party library and package descriptions for + * intellectual property information,user agreements, and related information. + * + * Although Isis has been used by the USGS, no warranty, expressed or implied, + * is made by the USGS as to the accuracy and functioning of such software + * and related material nor shall the fact of distribution constitute any such + * warranty, and no responsibility is assumed by the USGS in connection + * therewith. + * + * For additional information, launch + * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see + * the Privacy & Disclaimers page on the Isis website, + * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on + * http://www.usgs.gov/privacy.html. + */ + +#include "Isis.h" + +#include + +#include "Cube.h" +#include "CSVReader.h" +#include "IException.h" +#include "IString.h" +#include "Pvl.h" +#include "PvlObject.h" +#include "Table.h" +#include "TableField.h" +#include "TableRecord.h" + +using namespace Isis; + + +void IsisMain() { + UserInterface &ui = Application::GetUserInterface(); + + // Read the CSV file and get the header + QString csvFileName = ui.GetFileName("csv"); + CSVReader reader; + try { + reader = CSVReader(csvFileName, true); + } + catch(IException &e) { + QString msg = "Failed to read CSV file [" + csvFileName + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + int numColumns = reader.columns(); + int numRows = reader.rows(); + if (numColumns < 1 || numRows < 1) { + QString msg = "CSV file does not have data.\nFile has [" + toString(numRows) + + "] rows and [" + toString(numColumns) +"] columns."; + throw IException(IException::User, msg, _FILEINFO_); + } + CSVReader::CSVAxis header = reader.getHeader(); + + // Construct an empty table with the CSV header as field names + TableRecord tableRow; + for (int columnIndex = 0; columnIndex < numColumns; columnIndex++) { + TableField columnField(QString(header[columnIndex]), TableField::Double); + tableRow += columnField; + } + QString tableName = ui.GetString("tablename"); + Table table(tableName, tableRow); + + // Fill the table + for (int rowIndex = 0; rowIndex < numRows; rowIndex++) { + CSVReader::CSVAxis csvRow = reader.getRow(rowIndex); + for (int columnIndex = 0; columnIndex < numColumns; columnIndex++) { + tableRow[columnIndex] = toDouble(csvRow[columnIndex]); + } + table += tableRow; + } + + // If a set of label keywords was passed add them to the table + if (ui.WasEntered("label")) { + QString labelPvlFilename = ui.GetFileName("label"); + Pvl labelPvl; + try { + labelPvl.read(labelPvlFilename); + } + catch(IException &e) { + QString msg = "Failed to read PVL label file [" + labelPvlFilename + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + + PvlObject &tableLabel = table.Label(); + for (int keyIndex = 0; keyIndex < labelPvl.keywords(); keyIndex++) { + tableLabel.addKeyword(labelPvl[keyIndex]); + } + } + + // Write the table to the cube + QString outCubeFileName(ui.GetFileName("to")); + Cube outCube; + try { + outCube.open(outCubeFileName, "rw"); + } + catch(IException &e) { + QString msg = "Could not open output cube [" + outCubeFileName + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + + try { + outCube.write(table); + } + catch(IException &e) { + QString msg = "Could not write output table [" + tableName + + "] to output cube [" + outCubeFileName + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + + outCube.close(); + +} diff --git a/isis/src/base/apps/csv2table/tsts/Label/Makefile b/isis/src/base/apps/csv2table/tsts/Label/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..48d2f26e42e878485e2bf9c82cc5c2e16a9808e7 --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/Label/Makefile @@ -0,0 +1,14 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + $(APPNAME) csv=$(INPUT)/test.csv \ + label=$(INPUT)/label.pvl \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub > /dev/null; + catlab from=$(OUTPUT)/isisTruth.cub | \ + sed -n '/Object = Table/,/End_Object/p' > \ + $(OUTPUT)/table.pvl; + rm $(OUTPUT)/isisTruth.cub; diff --git a/isis/src/base/apps/csv2table/tsts/Makefile b/isis/src/base/apps/csv2table/tsts/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..46d84c74c297304e943452a44e06b111f179a92b --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/Makefile @@ -0,0 +1,4 @@ +BLANKS = "%-6s" +LENGTH = "%-40s" + +include $(ISISROOT)/make/isismake.tststree diff --git a/isis/src/base/apps/csv2table/tsts/NewTable/Makefile b/isis/src/base/apps/csv2table/tsts/NewTable/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..183ba78dfbb2a7655a7922f6a76834cc9f207bbf --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/NewTable/Makefile @@ -0,0 +1,13 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + $(APPNAME) csv=$(INPUT)/test.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub > /dev/null; + tabledump from=$(OUTPUT)/isisTruth.cub \ + to=$(OUTPUT)/output.csv \ + NAME="TestTable" > /dev/null; + rm $(OUTPUT)/isisTruth.cub; diff --git a/isis/src/base/apps/csv2table/tsts/OverwriteTable/Makefile b/isis/src/base/apps/csv2table/tsts/OverwriteTable/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..183ba78dfbb2a7655a7922f6a76834cc9f207bbf --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/OverwriteTable/Makefile @@ -0,0 +1,13 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + $(APPNAME) csv=$(INPUT)/test.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub > /dev/null; + tabledump from=$(OUTPUT)/isisTruth.cub \ + to=$(OUTPUT)/output.csv \ + NAME="TestTable" > /dev/null; + rm $(OUTPUT)/isisTruth.cub; diff --git a/isis/src/base/apps/csv2table/tsts/errors/Makefile b/isis/src/base/apps/csv2table/tsts/errors/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..ab23c6904b4931eacf0058f1b90df3ad1f8ccbb6 --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/errors/Makefile @@ -0,0 +1,33 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + + if [ `$(APPNAME) csv=$(INPUT)/not_a_file.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub 2> $(OUTPUT)/errors.txt` ]; \ + then \ + true; \ + fi; + + if [ `$(APPNAME) csv=$(INPUT)/empty.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub 2>> $(OUTPUT)/errors.txt` ]; \ + then \ + true; \ + fi; + + if [ `$(APPNAME) csv=$(INPUT)/test.csv \ + label=$(INPUT)/not_a_file.pvl \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub 2>> $(OUTPUT)/errors.txt` ]; \ + then \ + true; \ + fi; + + cat $(OUTPUT)/errors.txt | sed 's+\[.*input/+[+' \ + > $(OUTPUT)/clean_errors.txt; + + rm $(OUTPUT)/isisTruth.cub $(OUTPUT)/errors.txt; diff --git a/isis/src/base/apps/cubeatt/cubeatt.cpp b/isis/src/base/apps/cubeatt/main.cpp similarity index 100% rename from isis/src/base/apps/cubeatt/cubeatt.cpp rename to isis/src/base/apps/cubeatt/main.cpp diff --git a/isis/src/base/apps/cubeavg/cubeavg.cpp b/isis/src/base/apps/cubeavg/main.cpp similarity index 100% rename from isis/src/base/apps/cubeavg/cubeavg.cpp rename to isis/src/base/apps/cubeavg/main.cpp diff --git a/isis/src/base/apps/cubediff/cubediff.cpp b/isis/src/base/apps/cubediff/main.cpp similarity index 100% rename from isis/src/base/apps/cubediff/cubediff.cpp rename to isis/src/base/apps/cubediff/main.cpp diff --git a/isis/src/base/apps/cubefunc/cubefunc.cpp b/isis/src/base/apps/cubefunc/main.cpp similarity index 100% rename from isis/src/base/apps/cubefunc/cubefunc.cpp rename to isis/src/base/apps/cubefunc/main.cpp diff --git a/isis/src/base/apps/cubeit/cubeit.xml b/isis/src/base/apps/cubeit/cubeit.xml index c6f69f541bb634f1d27463f94c099ae049138429..139d37846317c83533d93bf39f7bfcf6c1750f4b 100644 --- a/isis/src/base/apps/cubeit/cubeit.xml +++ b/isis/src/base/apps/cubeit/cubeit.xml @@ -79,6 +79,9 @@ Modified Makefile of badinputs app test to truncate paths before data directory. Allows tests to pass when not using the default data area. Fixes #4783. + + Removed the tracking label group if it exists in the output cube. Fixes #5533. + diff --git a/isis/src/base/apps/cubeit/cubeit.cpp b/isis/src/base/apps/cubeit/main.cpp similarity index 96% rename from isis/src/base/apps/cubeit/cubeit.cpp rename to isis/src/base/apps/cubeit/main.cpp index 35e677f8c2986f96b0f9584dd7739fb7386b3722..971245e190bdec7519742aaada5e7f5471e99819 100644 --- a/isis/src/base/apps/cubeit/cubeit.cpp +++ b/isis/src/base/apps/cubeit/main.cpp @@ -183,6 +183,13 @@ void IsisMain() { ocube->deleteBlob("Table", "InputImages"); } + // Delete the Tracking group if it exists (3.6.0 and up) + // The tracking group could be transfered from the first input cube, but it does not + // represent the images used in any other band after cubeit. + if(ocube->hasGroup("Tracking")) { + ocube->deleteGroup("Tracking"); + } + p2.EndProcess(); // Now loop and mosaic in each cube diff --git a/isis/src/base/apps/cubenorm/cubenorm.cpp b/isis/src/base/apps/cubenorm/main.cpp similarity index 100% rename from isis/src/base/apps/cubenorm/cubenorm.cpp rename to isis/src/base/apps/cubenorm/main.cpp diff --git a/isis/src/base/apps/ddd2isis/ddd2isis.cpp b/isis/src/base/apps/ddd2isis/main.cpp similarity index 100% rename from isis/src/base/apps/ddd2isis/ddd2isis.cpp rename to isis/src/base/apps/ddd2isis/main.cpp diff --git a/isis/src/base/apps/decorstretch/decorstretch.cpp b/isis/src/base/apps/decorstretch/main.cpp similarity index 100% rename from isis/src/base/apps/decorstretch/decorstretch.cpp rename to isis/src/base/apps/decorstretch/main.cpp diff --git a/isis/src/base/apps/demprep/demprep.cpp b/isis/src/base/apps/demprep/main.cpp similarity index 100% rename from isis/src/base/apps/demprep/demprep.cpp rename to isis/src/base/apps/demprep/main.cpp diff --git a/isis/src/base/apps/deriv/deriv.cpp b/isis/src/base/apps/deriv/main.cpp similarity index 100% rename from isis/src/base/apps/deriv/deriv.cpp rename to isis/src/base/apps/deriv/main.cpp diff --git a/isis/src/base/apps/desmear/desmear.cpp b/isis/src/base/apps/desmear/main.cpp similarity index 100% rename from isis/src/base/apps/desmear/desmear.cpp rename to isis/src/base/apps/desmear/main.cpp diff --git a/isis/src/base/apps/desmile/desmile.cpp b/isis/src/base/apps/desmile/main.cpp similarity index 100% rename from isis/src/base/apps/desmile/desmile.cpp rename to isis/src/base/apps/desmile/main.cpp diff --git a/isis/src/base/apps/divfilter/divfilter.cpp b/isis/src/base/apps/divfilter/main.cpp similarity index 100% rename from isis/src/base/apps/divfilter/divfilter.cpp rename to isis/src/base/apps/divfilter/main.cpp diff --git a/isis/src/base/apps/dsk2isis/dsk2isis.cpp b/isis/src/base/apps/dsk2isis/main.cpp similarity index 100% rename from isis/src/base/apps/dsk2isis/dsk2isis.cpp rename to isis/src/base/apps/dsk2isis/main.cpp diff --git a/isis/src/base/apps/dstripe/dstripe.cpp b/isis/src/base/apps/dstripe/main.cpp similarity index 100% rename from isis/src/base/apps/dstripe/dstripe.cpp rename to isis/src/base/apps/dstripe/main.cpp diff --git a/isis/src/base/apps/editlab/editlab.cpp b/isis/src/base/apps/editlab/main.cpp similarity index 100% rename from isis/src/base/apps/editlab/editlab.cpp rename to isis/src/base/apps/editlab/main.cpp diff --git a/isis/src/base/apps/edrget/edrget.cpp b/isis/src/base/apps/edrget/main.cpp similarity index 100% rename from isis/src/base/apps/edrget/edrget.cpp rename to isis/src/base/apps/edrget/main.cpp diff --git a/isis/src/base/apps/enlarge/enlarge.cpp b/isis/src/base/apps/enlarge/main.cpp similarity index 100% rename from isis/src/base/apps/enlarge/enlarge.cpp rename to isis/src/base/apps/enlarge/main.cpp diff --git a/isis/src/base/apps/equalizer/equalizer.cpp b/isis/src/base/apps/equalizer/main.cpp similarity index 99% rename from isis/src/base/apps/equalizer/equalizer.cpp rename to isis/src/base/apps/equalizer/main.cpp index ab5e714d554a2497aaa93b270cd025f751a3742d..35ba79383aff6f5c2093589ee60d611b03da8c02 100644 --- a/isis/src/base/apps/equalizer/equalizer.cpp +++ b/isis/src/base/apps/equalizer/main.cpp @@ -111,4 +111,4 @@ void IsisMain() { equalizer.applyCorrection(ui.WasEntered("TOLIST") ? ui.GetFileName("TOLIST") : ""); } -} \ No newline at end of file +} diff --git a/isis/src/base/apps/equalizer/tsts/gain/Makefile b/isis/src/base/apps/equalizer/tsts/gain/Makefile index 24de02e521d68a0d6ff059149173b9d7db2bfe8a..f55593948ffb1459a2484a1527343868e825ed59 100644 --- a/isis/src/base/apps/equalizer/tsts/gain/Makefile +++ b/isis/src/base/apps/equalizer/tsts/gain/Makefile @@ -1,3 +1,6 @@ +equalizerTruth4.cub.TOLERANCE = .00005 +equalizerTruth5.cub.TOLERANCE = .00007 + APPNAME = equalizer include $(ISISROOT)/make/isismake.tsts @@ -10,7 +13,7 @@ commands: > /dev/null; $(MV) I00824006RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth1.cub; $(MV) I01523019RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth2.cub; - $(MV) I02609002RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth3.cub; + $(MV) I02609002RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth3.cub; $(LS) $(INPUT)/EN*.cub > $(OUTPUT)/files.lis; $(LS) $(INPUT)/EN*top*.cub > $(OUTPUT)/hold.lis; $(ECHO) "$(OUTPUT)/equalizerTruth4.cub" > $(OUTPUT)/tolist.lis @@ -19,4 +22,3 @@ commands: $(APPNAME) fromlist=$(OUTPUT)/files.lis holdlist=$(OUTPUT)/hold.lis \ adjust=gain tolist=$(OUTPUT)/tolist.lis > /dev/null; $(RM) $(OUTPUT)/files.lis $(OUTPUT)/hold.lis $(OUTPUT)/tolist.lis; - diff --git a/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile b/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile index 4860d96539440fe2cf65e0a28c8fcb9b9b99666b..48ded0bc4ef09fb5ed766249ea4c30913ee2a108 100644 --- a/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile +++ b/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile @@ -1,12 +1,14 @@ # This tests calculating statistics for input with non-overlapping files, -# correcting the input list by REMOVING non-overlaps and recalculating to -# determine normalization gains and offsets for equalization, +# correcting the input list by REMOVING non-overlaps and recalculating to +# determine normalization gains and offsets for equalization, # and then applying corrections. # # NOTE: An exception occurs when there are non-overlaps during calculation, # it is handled and the output is sent to nonOverlapError.txt APPNAME = equalizer +I10047011EDR.proj.reduced.cub.TOLERANCE = .00001 + include $(ISISROOT)/make/isismake.tsts commands: diff --git a/isis/src/base/apps/errors/errors.cpp b/isis/src/base/apps/errors/main.cpp similarity index 100% rename from isis/src/base/apps/errors/errors.cpp rename to isis/src/base/apps/errors/main.cpp diff --git a/isis/src/base/apps/explode/explode.cpp b/isis/src/base/apps/explode/main.cpp similarity index 100% rename from isis/src/base/apps/explode/explode.cpp rename to isis/src/base/apps/explode/main.cpp diff --git a/isis/src/base/apps/fakecube/fakecube.cpp b/isis/src/base/apps/fakecube/main.cpp similarity index 100% rename from isis/src/base/apps/fakecube/fakecube.cpp rename to isis/src/base/apps/fakecube/main.cpp diff --git a/isis/src/base/apps/fft/fft.cpp b/isis/src/base/apps/fft/main.cpp similarity index 100% rename from isis/src/base/apps/fft/fft.cpp rename to isis/src/base/apps/fft/main.cpp diff --git a/isis/src/base/apps/fillgap/fillgap.cpp b/isis/src/base/apps/fillgap/main.cpp similarity index 100% rename from isis/src/base/apps/fillgap/fillgap.cpp rename to isis/src/base/apps/fillgap/main.cpp diff --git a/isis/src/base/apps/findgaps/findgaps.cpp b/isis/src/base/apps/findgaps/main.cpp similarity index 100% rename from isis/src/base/apps/findgaps/findgaps.cpp rename to isis/src/base/apps/findgaps/main.cpp diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp b/isis/src/base/apps/findimageoverlaps/main.cpp similarity index 100% rename from isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp rename to isis/src/base/apps/findimageoverlaps/main.cpp diff --git a/isis/src/base/apps/findrx/findrx.cpp b/isis/src/base/apps/findrx/main.cpp similarity index 100% rename from isis/src/base/apps/findrx/findrx.cpp rename to isis/src/base/apps/findrx/main.cpp diff --git a/isis/src/base/apps/fits2isis/fits2isis.cpp b/isis/src/base/apps/fits2isis/main.cpp similarity index 100% rename from isis/src/base/apps/fits2isis/fits2isis.cpp rename to isis/src/base/apps/fits2isis/main.cpp diff --git a/isis/src/base/apps/flip/flip.cpp b/isis/src/base/apps/flip/main.cpp similarity index 100% rename from isis/src/base/apps/flip/flip.cpp rename to isis/src/base/apps/flip/main.cpp diff --git a/isis/src/base/apps/footprintinit/footprintinit.cpp b/isis/src/base/apps/footprintinit/main.cpp similarity index 100% rename from isis/src/base/apps/footprintinit/footprintinit.cpp rename to isis/src/base/apps/footprintinit/main.cpp diff --git a/isis/src/base/apps/footprintmerge/footprintmerge.cpp b/isis/src/base/apps/footprintmerge/main.cpp similarity index 100% rename from isis/src/base/apps/footprintmerge/footprintmerge.cpp rename to isis/src/base/apps/footprintmerge/main.cpp diff --git a/isis/src/base/apps/fx/fx.cpp b/isis/src/base/apps/fx/main.cpp similarity index 100% rename from isis/src/base/apps/fx/fx.cpp rename to isis/src/base/apps/fx/main.cpp diff --git a/isis/src/base/apps/gauss/gauss.cpp b/isis/src/base/apps/gauss/main.cpp similarity index 100% rename from isis/src/base/apps/gauss/gauss.cpp rename to isis/src/base/apps/gauss/main.cpp diff --git a/isis/src/base/apps/gaussstretch/gaussstretch.cpp b/isis/src/base/apps/gaussstretch/main.cpp similarity index 100% rename from isis/src/base/apps/gaussstretch/gaussstretch.cpp rename to isis/src/base/apps/gaussstretch/main.cpp diff --git a/isis/src/base/apps/getkey/getkey.cpp b/isis/src/base/apps/getkey/main.cpp similarity index 100% rename from isis/src/base/apps/getkey/getkey.cpp rename to isis/src/base/apps/getkey/main.cpp diff --git a/isis/src/base/apps/getsn/getsn.cpp b/isis/src/base/apps/getsn/main.cpp similarity index 100% rename from isis/src/base/apps/getsn/getsn.cpp rename to isis/src/base/apps/getsn/main.cpp diff --git a/isis/src/base/apps/gradient/gradient.cpp b/isis/src/base/apps/gradient/main.cpp similarity index 100% rename from isis/src/base/apps/gradient/gradient.cpp rename to isis/src/base/apps/gradient/main.cpp diff --git a/isis/src/base/apps/greyscale/greyscale.cpp b/isis/src/base/apps/greyscale/main.cpp similarity index 100% rename from isis/src/base/apps/greyscale/greyscale.cpp rename to isis/src/base/apps/greyscale/main.cpp diff --git a/isis/src/base/apps/grid/grid.cpp b/isis/src/base/apps/grid/main.cpp similarity index 100% rename from isis/src/base/apps/grid/grid.cpp rename to isis/src/base/apps/grid/main.cpp diff --git a/isis/src/base/apps/handmos/handmos.xml b/isis/src/base/apps/handmos/handmos.xml index 28665efabeac54d61fe0c2a2bd76bc85f5fff9f4..370e684746eef95b4dee566a634da5d575f9a4d7 100644 --- a/isis/src/base/apps/handmos/handmos.xml +++ b/isis/src/base/apps/handmos/handmos.xml @@ -24,7 +24,7 @@ falls outside of the dimensions of the mosaic, it will be clipped. The line, sample, band dimensions of the output mosaic are required to be specified at the time of creation. This - appication does not require a camera model, Instrument Group or + application does not require a camera model, Instrument Group or Mapping Group keywords as required by the other mosaic applications, mapmos and automos.

@@ -36,7 +36,7 @@

MATCHDEM = FALSE, the default does not check the SHAPEMODEL keyword of the input cube - files and does not propogate what DEM Shapemodel that was used when the input files were + files and does not propagate what DEM Shapemodel that was used when the input files were projected.

@@ -47,19 +47,43 @@ options is explained in the tables and descriptions below.

- The Track feature creates a band in the output mosaic file containing the index - values for every pixel in the output mosaic.The Track-band can only be used appropriately through - the QVIEW-AdvancedTracking tool. As the user interactively pans across the displayed - mosaic band (Band1), for every mosaic pixel location QVIEW-AdvancedTracking will report - the source cube filename that was input to automos. The Track-band cannot be used outside - the QVIEW-AdvancedTracking tool. Hence the file (byte) size of the mosaic is increased due to - the track-band. + The TRACK feature creates a separate tracking cube in addition to the mosaic cube, and + contains information for the source files of every pixel within the output mosaic. + This cube will have the same base-name as the mosaic cube, but will end in + "_tracking.cub". The tracking cube must always reside in the same directory as the + mosaic cube to be properly accessed; this means that if the mosaic cube is copied or + moved, then its associated tracking cube must be copied or moved to the same location. + The tracking cube will always be of type unsigned integer. Depending on the + bit-type of the mosaic cube and/or the number of bands it contains, the tracking cube + may be as much as four times the size of the mosaic cube itself.

- The Track feature works with Priority options ONTOP (with HIGHSATURATION and - LOWSATURATION parameters) and BENEATH for single band input cubes. It does NOT support - multiple band input cubes with these priority options. It does work for multiband cubes - when PRIORITY=BAND. Furthermore, this feature is NOT supported when PRIORITY=AVERAGE. + The tracking cube can be used appropriately through the QVIEW-AdvancedTracking + tool. As the user pans across the displayed mosaic, for every mosaic pixel location, + QVIEW-AdvancedTracking will interactively report the index, the filename and the + serial number of the input cube that was input to handmos for that specific pixel + location. Since the tracking cube is of bit-type unsigned integer, the DN values of + 0, 1 and 2 are reserved for NULL, LRS and LIS, respectively, so valid pixel DN values + will begin at an offset of 3. In other words, a pixel of DN value 3 in the tracking + cube means that this same pixel within the mosaic was taken from the first input + image. The tracking cube cannot be used outside of the QVIEW-AdvancedTracking tool + except as a visual representation of the source cubes for the different pixels. +

+

+ The TRACK feature works with Priority options ONTOP and BENEATH for single band input + cubes. It works for multiband cubes for PRIORITY=ONTOP only when the NULL, + HIGHSATURATION and LOWSATURATION options are set to true. It also works for multiband + cubes when PRIORITY=BAND. Furthermore, this feature is NOT supported when + PRIORITY=AVERAGE. +

+

+ Please Note: Prior to ISIS version 3.6.0, tracking for the various mosaicking apllications + was being handled with an internal tracking band. Tracking is now being handled by an + external tracking cube that contains the associated tracking information. This application + can no longer add to mosaics of the old format. In order to continue to use these + older mosaics with the updated mosaicking applications, you must first use the + trackextract utility application to extract the tracking band and the associated + tracking information into an external tracking cube.

@@ -76,8 +100,17 @@ current input image will appear in the output mosaic (it replaces the output mosaic pixel). Invalid input Special Pixels (NULL,HRS,HIS,LRS,LIS) will NOT - replace an existing Valid output mosaic pixel. Refer to parameters HIGHSATURATION, - LOWSATURATION, and NULL to override replacement of Valid output mosaic pixels. + replace an existing Valid output mosaic pixel unless the optional flags are set. Refer + to parameters HIGHSATURATION,LOWSATURATION, and NULL to override replacement of Valid + output mosaic pixels. +

+ NOTE: When using this priority with multi-band mosaics and with the TRACK + option set, all Special Pixel flags must be set as well. This is because the same + pixel within different bands of a single input image may hold both Valid and Special + Pixel values, and since our Tracking capabilities can only track one input image per + pixel (as it is a single band), it must accept the values for that particular pixel + from every band in the input image being placed on top. +

@@ -106,7 +139,7 @@ Overlapping Valid pixel values from the current input image and output mosaic will be averaged for the new mosaic pixel values. A count-band is created with the output mosaic file. The count-band keeps track of the number of images involved in the - averaging of the input dn values for each pixel in the mosaic. Invalid input pixel + averaging of the input DN values for each pixel in the mosaic. Invalid input pixel values will not be included in the average. In the case where only one Valid pixel exists between the input image pixels or the current mosaic pixel, the Valid pixel is retained in the current output mosaic. Refer to parameters HIGHSATURATION, @@ -436,6 +469,11 @@ group in the cube labels which could impact processing scripts/pipelines. Fixes #1620. References #1623. + + Updated code and documentation to reflect new handling of tracking capabilities with an + external tracking cube as well as clarify why special pixel flags are required when + priority=ontop for multiband mosaics. References #2092 + @@ -536,7 +574,7 @@ If the input and mosaic pixel of the priority band, specified by NUMBER or KEYNAME - and KEYVALUE, are valid, a less than or greater than comparison is done. Depending on + and KEYVALUE are valid, a less than or greater than comparison is done. Depending on the CRITERIA selected, the lower or higher of the two pixels is placed on top. Special and NULL pixels are not placed on top unless their flags are set. So, if the comparison of the priority band says that the input pixel should be on top but the @@ -588,7 +626,7 @@