Skip to content

Commit

Permalink
Update FileName test and merge dev into testing (#598)
Browse files Browse the repository at this point in the history
* Update CMakeLists.txt with version 3.6.0 (patch 1)

* Update cmake/CMakeLists.txt library version

* Updated the Installation instructions based on user feedback.  Also fixed a problem with the isis3VarInit.py script.

* Updates made in accordance with requests made on this PR by other developers.

* Fix tgo cassis unit test correctly

* Fix tgo cassis unit test correctly (#544)

* Fixed two bug with AutoReg. One occurs with one dimensional pattern cubes and the other causes the revious registration sample/line to be returned on sub-pixel registration failure.

* Fix tgo cassis camera truth again (#554)

* Update docsys Makefile to support wwwdoc (#559)

The documentation is installed under `docs`, not `doc`, so this file has been updated.
`setisis isis3.6.0` and running `make wwwdoc` in `$ISISROOT/../isis/src/docsys` will properly sync the documentation to our web server.

* Update isis3VarInit.py

Unnecessary 'touch'ing, the '>' redirect will create the file if it doesn't exist.
Also, the first redirect should be the single '>'.  Otherwise, multiple runs of this program will continue appending to these files.  They still work, its just a lot of setting and unsetting for no good reason.

* Fixed isis3Startup scripts

* Removed unneeded LineEquation include

* Make this program more pythonic (#589)

* Updated documentation, user interaction, and made the file and directory
handling more 'pythonic'.

* Correcting for PR comments.

* Fixed broken links in the Installation instructions due to the hyperlinks to our GitHub wiki changing.

* Removed unused Parabola class

* Removed old license, added new unlicense (#594)

* Tweaked FileName test to use ISISROOT variable
  • Loading branch information
jessemapel authored and SgStapleton committed Nov 20, 2018
1 parent 1c7d600 commit d0764eb
Show file tree
Hide file tree
Showing 22 changed files with 232 additions and 352 deletions.
24 changes: 24 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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 <http://unlicense.org/>
7 changes: 3 additions & 4 deletions isis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ set(PACKAGE "ISIS")
set(PACKAGE_NAME "USGS ISIS")

# Version number
set(VERSION "3.6.00.0")
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-11-09")
set(THIRD_PARTY_LIBS_VERSION "v008")
set(RELEASE_STAGE "alpha") # (alpha, beta, stable)
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")
Expand Down
6 changes: 3 additions & 3 deletions isis/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
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.5.0${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.0${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.5${SO})")
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.5${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3${SO})")
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
Expand Down
46 changes: 0 additions & 46 deletions isis/license.txt

This file was deleted.

4 changes: 3 additions & 1 deletion isis/scripts/isis3Startup.csh
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion isis/scripts/isis3Startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion isis/scripts/isis3Startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# the Isis distribution
#
if [ ! "$ISISROOT" ]; then
ISISROOT=/usgs/pkgs/isis3/isis
ISISROOT=/usgs/pkgs/isis3/install
export ISISROOT
fi

Expand Down
135 changes: 90 additions & 45 deletions isis/scripts/isis3VarInit.py
Original file line number Diff line number Diff line change
@@ -1,52 +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
#Author: Tyler Wilson
#Date : 2018-10-05
#Description: This script sets ISISROOT/ISIS3DATA/ISIS3TESTDATA for the user and is executed
#within the conda environment created for the ISIS3 installation.
#The data directory and test directory are optional command line arguments. If the user chooses
#not to set them, they will both be placed created on the same level as the $ISISROOT directory
#within the conda environment.

parser = argparse.ArgumentParser(description='Usage: ./isis3VarInit --data_dir <data dir path> --test_dir <test dir path')

isisroot = '$CONDA_PREFIX'
data_dir='$CONDA_PREFIX/data'
testdata_dir='$CONDA_PREFIX/testData'

parser.add_argument("--data-dir",default= data_dir,help="ISIS3 Mission Data Directory")
parser.add_argument("--test-dir",default=testdata_dir,help="ISIS3 Mission Test Data Directory")

##########################################################################################################
#
# 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()
if (data_dir != args.data_dir):
os.system("mkdir -p "+args.data_dir)
data_dir = args.data_dir
else:
os.system("mkdir -p "+data_dir)

if (testdata_dir != args.test_dir):
os.system("mkdir -p "+args.test_dir)
testdata_dir=args.test_dir
else:
os.system("mkdir -p "+testdata_dir)

os.popen('mkdir -p '+isisroot+'/etc/conda/activate.d')
os.popen('mkdir -p '+isisroot+'/etc/conda/deactivate.d')

os.system("echo -n '' >"+isisroot+"/etc/conda/activate.d/env_vars.sh")
os.popen("echo -n '' >"+isisroot+"/etc/conda/deactivate.d/env_vars.sh")
os.popen('touch '+isisroot+'/etc/conda/activate.d/env_vars.sh')
os.popen('touch '+isisroot+'/etc/conda/activate.d/env_vars.sh')

os.popen("echo '#!/bin/sh' >> "+isisroot+ "/etc/conda/activate.d/env_vars.sh")
os.popen("echo 'export ISISROOT="+isisroot+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh")
os.popen("echo 'export ISIS3DATA="+data_dir+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh")
os.popen("echo 'export ISIS3TESTDATA="+testdata_dir+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh")

os.popen("echo '#!/bin/sh' >> "+isisroot+ "/etc/conda/deactivate.d/env_vars.sh")
os.popen("echo 'unset ISISROOT' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh")
os.popen("echo 'unset ISIS3DATA' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh")
os.popen("echo 'unset ISIS3TESTDATA' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh")


# 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 )
1 change: 0 additions & 1 deletion isis/src/base/apps/appjit/LineScanCameraRotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion isis/src/base/apps/appjit/PixelOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "PixelOffset.h"
#include "TextFile.h"
#include "LineEquation.h"
#include "LeastSquares.h"
#include "BasisFunction.h"
#include "PolynomialUnivariate.h"
Expand Down
27 changes: 19 additions & 8 deletions isis/src/base/objs/AutoReg/AutoReg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,11 @@ namespace Isis {
// Before we attempt to apply the reduction factor, we need to make sure
// we won't produce a chip of a bad size.
// ----------------------------------------------------------------------
if(gradientPatternChip.Samples() / p_reduceFactor < 2 || gradientPatternChip.Lines() / p_reduceFactor < 2) {
string msg = "Reduction factor is too large";
throw IException(IException::User, msg, _FILEINFO_);
if (p_reduceFactor != 1) {
if(gradientPatternChip.Samples() / p_reduceFactor < 2 || gradientPatternChip.Lines() / p_reduceFactor < 2) {
string msg = "Reduction factor is too large";
throw IException(IException::User, msg, _FILEINFO_);
}
}

// Establish the center search tack point as best pixel to start for the
Expand Down Expand Up @@ -852,15 +854,21 @@ namespace Isis {
if (!window.IsValid(100.0 * 2.1 / 3.0)) {
p_surfaceModelNotEnoughValidDataCount++;
p_registrationStatus = SurfaceModelNotEnoughValidData;
p_chipSample = p_bestSamp;
p_chipLine = p_bestLine;
return SurfaceModelNotEnoughValidData;
}

// Now that we know we have enough data to model the surface we call
// SetSubpixelPosition() to get the sub-pixel accuracy we are looking for.
bool computedSubPixel = SetSubpixelPosition(window);
if (!computedSubPixel)
return p_registrationStatus;

if (!computedSubPixel) {
p_chipSample = p_bestSamp;
p_chipLine = p_bestLine;
p_registrationStatus = SurfaceModelSolutionInvalid;
return SurfaceModelSolutionInvalid;
}

// See if the surface model solution moved too far from our whole pixel
// solution
p_sampMovement = fabs(p_bestSamp - p_chipSample);
Expand All @@ -870,18 +878,20 @@ namespace Isis {

p_surfaceModelDistanceInvalidCount++;
p_registrationStatus = SurfaceModelDistanceInvalid;
p_chipSample = p_bestSamp;
p_chipLine = p_bestLine;
return SurfaceModelDistanceInvalid;
}

p_registrationStatus = SuccessSubPixel;
return SuccessSubPixel;
}
else {
p_chipSample = p_bestSamp;
p_chipLine = p_bestLine;
p_registrationStatus = SuccessPixel;
return SuccessPixel;
}

return p_registrationStatus;
}


Expand Down Expand Up @@ -1320,3 +1330,4 @@ namespace Isis {
return reg;
}
}

6 changes: 6 additions & 0 deletions isis/src/base/objs/AutoReg/AutoReg.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ namespace Isis {
* give useful results due to the 2x2 matrix it uses.
* @history 2012-01-05 Travis Addair - Added separate variables for Whole
* Pixel Correlation and Subpixel Correlation.
* @history 2018-07-27 Makayla Shepherd - Fixed a bug that made registration fail for
* one dimensional pattern chips. Fixes #5247.
* @history 2018-07-27 Makayla Shepherd - Fixed a bug that upon sub-pixel registration failure
* caused the previous registration to be returned. If sub-pixel
* registration fails now it will return to the whole pixel
* registration values. Fixes #5248.
*/
class AutoReg {
public:
Expand Down
7 changes: 0 additions & 7 deletions isis/src/base/objs/Parabola/Makefile

This file was deleted.

Loading

0 comments on commit d0764eb

Please sign in to comment.