Skip to content

Commit

Permalink
Csm branch clean up (#4191)
Browse files Browse the repository at this point in the history
* Removed csmpt

* General cleanup

* Review feedback
  • Loading branch information
jessemapel authored Dec 10, 2020
1 parent edeca74 commit 56b68b0
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 331 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ update the Unreleased link so that it compares against the latest release tag.

## [Unreleased]

### Added

- Added the new csminit application and CSM Library loading to the IsisPreferences file. Together these allow users to get CSM state strings from ISD files. Once CSM camera model support is added, these will be used to setup a Cube to use a CSM camera model.


- Fixed so required files are reported instead of continuing without them. [#4038](https://github.com/USGS-Astrogeology/ISIS3/issues/4038)

Expand Down
41 changes: 30 additions & 11 deletions isis/src/base/apps/csminit/csminit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@

<application name="csminit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd">
<brief>
Attach a CSM Model state to a cube
Attach a CSM model state to a cube.
</brief>

<description>
<p>
This program takes an ISD or state string and attempts to create
a valid CSM Model from the loaded CSM Libraries. Then, it attaches the
state string from the CSM Model to the cube for later use. If there are
multiple valid CSM Models that can be instantiated, then this program
will error and the user will have to re-run it with a specific model
and/or plugin name.
This program takes Instrument Support Data (ISD) and attempts to create a
valid Community Sensor Model (CSM) state string using modesl from the
loaded CSM Libraries. If a single state string can be created, it is
attached to the cube in the CSMState BLOB for later use. If there are
multiple models that create valid state strings, then this program will
error and return a list of possible models. The user will then have to
re-run this program using the PLUGINNAME and/or MODELNAME parameters to
select a specific model.
</p>
<p>
Information about the CSM model will also be added to the CsmInfo group on
the cube label. These are just for users to reference and are not used
programmatically.
</p>
<p>
This program can be run on any Cube file, but if the Cube has spice data
from spiceinit then it will be removed so that there is no ambiguity
between the ISIS and CSM model.
</p>
<p>
See the Plugins group in the IsisPreferences file for information about
how to load CSM Libraries for use with this and other ISIS applications.
</p>
</description>

Expand All @@ -35,7 +51,9 @@
The input cube that the state string will be attached to.
</brief>
<description>
The input cube that the state string will be attached to.
The input cube that the state string will be attached to. Any kernels
specified in the kernels group and any attached SPICE tables will be
removed when the model state is attached.
</description>
<filter>*.cub</filter>
</parameter>
Expand All @@ -44,10 +62,11 @@
<type>filename</type>
<fileMode>input</fileMode>
<brief>
The ISD file that will be used.
The Instrument Support Data (ISD) file that will be used.
</brief>
<description>
The ISD file that will be used to create the model state string.
The Instrument Support Data (ISD) file that will be used to create the
model state string. The ISD can be just a filename ISD or a NITF2.1 ISD.
</description>
</parameter>
</group>
Expand All @@ -74,7 +93,7 @@
<description>
The shapemodel to represent the surface of the observed body. If none
is entered, then a bi-axial ellipsoid is used. The radii are defined
by the CSM Model.
by the CSM model.
</description>
</parameter>
</group>
Expand Down
7 changes: 0 additions & 7 deletions isis/src/base/apps/csmpt/Makefile

This file was deleted.

116 changes: 0 additions & 116 deletions isis/src/base/apps/csmpt/csmpt.cpp

This file was deleted.

18 changes: 0 additions & 18 deletions isis/src/base/apps/csmpt/csmpt.h

This file was deleted.

78 changes: 0 additions & 78 deletions isis/src/base/apps/csmpt/csmpt.xml

This file was deleted.

35 changes: 0 additions & 35 deletions isis/src/base/apps/csmpt/main.cpp

This file was deleted.

3 changes: 3 additions & 0 deletions isis/src/base/apps/spiceinit/spiceinit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@
derived from bundle adjustment can be used alongside CKs derived from bundle adjustment.
Fixes #3669.
</change>
<change name="Jesse Mapel" date="2020-12-10">
Modified to remove state string and model information from the csminit application.
</change>
</history>

<oldName>
Expand Down
16 changes: 4 additions & 12 deletions isis/src/base/objs/CameraFactory/CameraFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ namespace Isis {


/**
* Reads the appropriate plugin file for the ISIS cameras, and scans the
* directories specified in IsisPreferences for CSM cameras.
* Reads the appropriate plugin file for the ISIS cameras, and scans the
* directories specified in IsisPreferences for CSM cameras.
*/
void CameraFactory::initPlugin() {

Expand All @@ -129,7 +129,7 @@ namespace Isis {

// Find the CSM plugins by searching the directories identified in the Preferences.
// Load the found libraries. This causes the static instance(s) to be constructed,
// and thus registering the model with the csm Plugin class.
// and thus registering the model with the csm Plugin class.
Preference &p = Preference::Preferences();
PvlGroup &grp = p.findGroup("Plugins", Isis::Pvl::Traverse);
for (int i = 0; i<grp["CSMDirectory"].size(); i++) {
Expand All @@ -139,17 +139,9 @@ namespace Isis {
while (csmLib.hasNext()) {
QString csmLibName = csmLib.next();
QLibrary csmDynamicLib(csmLibName);

bool loadedOk = csmDynamicLib.load();

if (!loadedOk) {
std::cout << "Unloadable library " << csmLibName << std::endl;
}
csmDynamicLib.load();
}
}

PluginList csmPluginList = csm::Plugin::getList();
std::cout << "csm plugin list size " << csmPluginList.size() << std::endl;
}


Expand Down
Loading

0 comments on commit 56b68b0

Please sign in to comment.