Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added skeleton of executables for Photometry Toolkit

Compiles .. That's about it.
  • Loading branch information...
commit 49fc2e91f1e86534e28ab26a0fb997d2e96294be 1 parent 26c3397
Zack Moratto authored
View
3  configure.ac
@@ -306,6 +306,7 @@ AX_MODULE(SPICEIO, [src/asp/SpiceIO], [libaspSpiceIO.la], yes, [], [VW BOOST_
AX_MODULE(ISISIO, [src/asp/IsisIO], [libaspIsisIO.la], yes, [], [ISIS VW_CARTOGRAPHY BOOST])
AX_MODULE(SESSIONS, [src/asp/Sessions], [libaspSessions.la], yes, [CORE], [], [ISISIO SPICEIO])
AX_MODULE(MPI, [src/asp/MPI], [], no, [VW_BUNDLEADJUSTMENT ISISIO CORE], [BOOST_SERIALIZATION BOOST_MPI OPEN_MPI VW_ALL])
+AX_MODULE(PHOTOMETRYTK, [src/asp/PhotometryTK], [], no, [VW_PLATE], [BOOST])
AX_APP(STEREO, [src/asp/Tools], yes, [SESSIONS])
AX_APP(ORTHOPROJECT, [src/asp/Tools], yes, [SESSIONS])
@@ -333,6 +334,7 @@ AM_CONDITIONAL(MAKE_MODULE_ISISIO, [test "$MAKE_MODULE_ISISIO" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_SPICEIO, [test "$MAKE_MODULE_SPICEIO" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_SESSIONS, [test "$MAKE_MODULE_SESSIONS" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_MPI, [test "$MAKE_MODULE_MPI" = "yes"])
+AM_CONDITIONAL(MAKE_MODULE_PHOTOMETRYTK, [test "$MAKE_MODULE_PHOTOMETRYTK" = "yes"])
AM_CONDITIONAL(MAKE_APP_STEREO, [test "$MAKE_APP_STEREO" = "yes"])
AM_CONDITIONAL(MAKE_APP_STEREOGUI, [test "$MAKE_APP_STEREOGUI" = "yes"])
@@ -397,6 +399,7 @@ AC_CONFIG_FILES([ \
src/asp/Sessions/RMAX/Makefile \
src/asp/MPI/Makefile \
src/asp/Tools/Makefile \
+ src/asp/PhotometryTK/Makefile \
])
AC_OUTPUT
View
5 src/asp/Makefile.am
@@ -25,11 +25,14 @@ tools_subdirs = Tools
mpi_subdirs = MPI
+photometry_subdirs = PhotometryTK
+
include_HEADERS = $(core_headers) $(spiceio_headers) \
$(isisio_headers) $(sessions_headers) asp_config.h
SUBDIRS = $(core_subdirs) $(spiceio_subdirs) $(isisio_subdirs) \
- $(sessions_subdirs) $(tools_subdirs) $(mpi_subdirs)
+ $(sessions_subdirs) $(tools_subdirs) $(mpi_subdirs) \
+ $(photometry_subdirs)
CLEANFILES = asp_config.h.pre.in~
View
58 src/asp/PhotometryTK/Makefile.am
@@ -0,0 +1,58 @@
+# __BEGIN_LICENSE__
+# Copyright (C) 2006-2009 United States Government as represented by
+# the Administrator of the National Aeronautics and Space Administration.
+# All Rights Reserved.
+# __END_LICENSE__
+
+
+#########################################################################
+# sources
+#########################################################################
+
+if MAKE_MODULE_PHOTOMETRYTK
+
+#include_HEADERS =
+
+if ENABLE_EXCEPTIONS
+
+phodrg2plate_SOURCES = phodrg2plate.cc
+phodrg2plate_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoinitalbedo_SOURCES = phoinitalbedo.cc
+phoinitalbedo_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoinitfile_SOURCES = phoinitfile.cc
+phoinitfile_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoitalbedo_SOURCES = phoitalbedo.cc
+phoitalbedo_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoitdem_SOURCES = phoitdem.cc
+phoitdem_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoiterror_SOURCES = phoiterror.cc
+phoiterror_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoitreflect_SOURCES = phoitreflect.cc
+phoitreflect_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+phoittime_SOURCES = phoittime.cc
+phoittime_LDADD = @MODULE_PHOTOMETRYTK_LIBS@
+
+bin_PROGRAMS = phodrg2plate phoinitalbedo phoinitfile phoitalbedo \
+ phoitdem phoiterror phoitreflect phoittime
+
+endif
+
+endif
+
+AM_CPPFLAGS = @ASP_CPPFLAGS@
+AM_LDFLAGS = @ASP_LDFLAGS@
+
+dist_noinst_SCRIPTS = phoinit.py phosolve.py
+
+SUBDIRS = .
+
+#includedir = $(prefix)/include/asp/PhotometryTK
+
+include $(top_srcdir)/config/rules.mak
View
65 src/asp/PhotometryTK/phodrg2plate.cc
@@ -0,0 +1,65 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry DRG 2 Platefiles
+//
+// It's supposed to insert and help create several things, DRG,
+// Reflectance, and Error.
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
34 src/asp/PhotometryTK/phoinit.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import os, optparse, multiprocessing;
+
+class Usage(Exception):
+ def __init__(self,msg):
+ self.msg = msg
+
+def main():
+ try:
+ try:
+ usage = "phoinit.py [--help] not-sure-yet "
+ parser = optparse.OptionParser(usage=usage);
+
+ (options, args) = parser.parse_args()
+
+ if not args: parser.error("missing files")
+
+ except optparse.OptionError, msg:
+ raise Usage(msg)
+
+ return 0
+
+ except Usage, err:
+ print >>sys.stderr, err.msg
+ return 2
+
+ except Exception, err:
+ sys.stderr.write( str(err) + '\n' )
+ return 1
+
+if __name__ == "__main__":
+ sys.exit(main())
+
View
65 src/asp/PhotometryTK/phoinitalbedo.cc
@@ -0,0 +1,65 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (Init)ialize (Albedo)
+//
+// This starts the albedo and creates it's platefile.
+// Eq: A = sum( I^k/(R^k*T^k) )
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
64 src/asp/PhotometryTK/phoinitfile.cc
@@ -0,0 +1,64 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (Init)ialize Phofile
+//
+// It's used to create project file and to solve for the starting ET.
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
68 src/asp/PhotometryTK/phoitalbedo.cc
@@ -0,0 +1,68 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (It)eration (Albedo) Update
+//
+// With Reflectance
+// .... see docs
+//
+// With out Relectance
+// A = A + sum((I^k-T^k*A)*T^k*S^k)/sum((T^k*S^k)^2)
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
65 src/asp/PhotometryTK/phoitdem.cc
@@ -0,0 +1,65 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (It)eration (DEM) Update
+//
+// Here be dragons! Actually this is the spot for shape from shading.
+// We're not going to work on this until later.
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
68 src/asp/PhotometryTK/phoiterror.cc
@@ -0,0 +1,68 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (It)eration (Error) Update
+//
+// Equation:
+//
+// e = Sumk( Sumij( ((I - A*T*R)*S)^2 ))
+//
+// If there's no reflectance, don't multiply by it.
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
66 src/asp/PhotometryTK/phoitreflect.cc
@@ -0,0 +1,66 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (It)eration (Reflect)ance Update
+//
+// This will be a straigt up recalculation of reflectance
+// This is also only required for shape from shading. Don't worry about this
+// right away.
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
68 src/asp/PhotometryTK/phoittime.cc
@@ -0,0 +1,68 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2010 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+// What's this file supposed to do ?
+//
+// (Pho)tometry (It)eration Exposure (Time) Update
+//
+// With Reflectance
+// .... see docs
+//
+// With out Relectance
+// T = T + sum((Ik-Tk*A)*A*Sk)/sum((A*Sk)^2)
+
+#include <vw/Image.h>
+using namespace vw;
+
+#include <boost/program_options.hpp>
+namespace po = boost::program_options;
+
+using namespace std;
+
+struct Options {
+
+ // For spawning multiple jobs
+ int job_id, num_jobs;
+};
+
+void handle_arguments( int argc, char *argv[], Options& opt ) {
+ po::options_description general_options("");
+ general_options.add_options()
+ ("job_id,j", po::value<int>(&opt.job_id)->default_value(0), "")
+ ("num_jobs,n", po::value<int>(&opt.num_jobs)->default_value(1), "")
+ ("help,h", "Display this help message");
+
+ po::variables_map vm;
+ try {
+ po::store( po::command_line_parser( argc, argv ).options(general_options).run(), vm );
+ po::notify( vm );
+ } catch (po::error &e) {
+ vw_throw( ArgumentErr() << "Error parsing input:\n\t"
+ << e.what() << general_options );
+ }
+
+ std::ostringstream usage;
+ usage << "Usage: " << argv[0] << " [programmer hasn't filled this out]\n";
+
+ if ( vm.count("help") )
+ vw_throw( ArgumentErr() << usage.str() << general_options );
+}
+
+int main( int argc, char *argv[] ) {
+
+ Options opt;
+ try {
+ handle_arguments( argc, argv, opt );
+ } catch ( const ArgumentErr& e ) {
+ vw_out() << e.what() << std::endl;
+ return 1;
+ } catch ( const Exception& e ) {
+ std::cerr << "Error: " << e.what() << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
View
34 src/asp/PhotometryTK/phosolve.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import os, optparse, multiprocessing;
+
+class Usage(Exception):
+ def __init__(self,msg):
+ self.msg = msg
+
+def main():
+ try:
+ try:
+ usage = "phosolve.py [--help] not-sure-yet "
+ parser = optparse.OptionParser(usage=usage);
+
+ (options, args) = parser.parse_args()
+
+ if not args: parser.error("missing files")
+
+ except optparse.OptionError, msg:
+ raise Usage(msg)
+
+ return 0
+
+ except Usage, err:
+ print >>sys.stderr, err.msg
+ return 2
+
+ except Exception, err:
+ sys.stderr.write( str(err) + '\n' )
+ return 1
+
+if __name__ == "__main__":
+ sys.exit(main())
+
Please sign in to comment.
Something went wrong with that request. Please try again.