Loading isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp 0 → 100644 +71 −0 Original line number Diff line number Diff line /** * @file * $Revision: 1.1.1.1 $ * $Date: 2006/10/31 23:18:08 $ * * 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 <math.h> #include <QString> #include "FileName.h" #include "Constants.h" #include "IException.h" #include "NthOrderPolynomial.h" using namespace std; namespace Isis { /** * Create an NthOrderPolynomial * * @param degree The order/degree of the polynomial * */ NthOrderPolynomial::NthOrderPolynomial(int degree) : Isis::BasisFunction("NthOrderPolynomial", 2, degree) { p_degree = degree; } /** * This is the the overriding virtual function that provides the expansion into * the nth order polynomial equation. * * See BasisFunction for more information. * * @param vars A vector of double values to use for the expansion. */ void NthOrderPolynomial::Expand(const std::vector<double> &vars) { if((int) vars.size() != Variables()) { QString mess = "Number of variables given (" + QString::number(vars.size()) + ") does not match expected (" + Variables() + ")!"; throw IException(IException::Programmer, mess, _FILEINFO_); } double t1 = vars[0]; double t2 = vars[1]; p_terms.clear(); for (int i = p_degree; i >= 1; i--) { p_terms.push_back(pow(t1, i) - pow(t2, i)); } return; } } // end namespace isis isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.h 0 → 100644 +60 −0 Original line number Diff line number Diff line #ifndef NthOrderPolynomial_h #define NthOrderPolynomial_h /** * @file * $Revision: 1.1.1.1 $ * $Date: 2006/10/31 23:18:08 $ * * 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 <vector> #include "BasisFunction.h" namespace Isis { /** * @brief NthOrderPolynomial basis function * * This is a derived class from the BasisFunction class which creates an nth order polynomial. * * @ingroup Math * * @author 2018-01-01 Unknown * * @internal * @history 2018-01-01 Unknown - Initial Version * @history 2020-01-08 Kristin Berry - Update documentation prior to checkin to dev. */ class NthOrderPolynomial : public Isis::BasisFunction { public: NthOrderPolynomial(int degree); //! Destroys the NthOrderPolynomial object ~NthOrderPolynomial() {} void Expand(const std::vector<double> &vars); private: int p_degree; }; } #endif isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.truth 0 → 100644 +27 −0 Original line number Diff line number Diff line Name = NthOrderPolynomial Ncoefs = 3 Vars = 2 0.5 0.5 0.5 --- -12.5 -19 -5 -1 --- 4.5 9 -3 3 -------- Name = NthOrderPolynomial Ncoefs = 6 Vars = 2 -13.5 -63 33 -15 9 -3 3 isis/src/base/objs/NthOrderPolynomial/unitTest.cpp 0 → 100644 +56 −0 Original line number Diff line number Diff line #include "NthOrderPolynomial.h" #include <iostream> #include "Preference.h" using namespace Isis; using namespace std; int main() { Preference::Preferences(true); NthOrderPolynomial b(3); vector<double> coefs; coefs.push_back(0.5); coefs.push_back(0.5); coefs.push_back(0.5); b.SetCoefficients(coefs); cout << "Name = " << b.Name() << endl; cout << "Ncoefs = " << b.Coefficients() << endl; cout << "Vars = " << b.Variables() << endl; for(int i = 0; i < b.Coefficients(); i++) { cout << b.Coefficient(i) << endl; } cout << "---" << endl; vector<double> vars; vars.push_back(2.0); vars.push_back(3.0); cout << b.Evaluate(vars) << endl; for(int i = 0; i < b.Coefficients(); i++) { cout << b.Term(i) << endl; } cout << "---" << endl; vars[0] = 1.0; vars[1] = -2.0; cout << b.Evaluate(vars) << endl; for(int i = 0; i < b.Coefficients(); i++) { cout << b.Term(i) << endl; } NthOrderPolynomial c(6); cout << "--------" << endl; cout << "Name = " << c.Name() << endl; cout << "Ncoefs = " << c.Coefficients() << endl; cout << "Vars = " << c.Variables() << endl; coefs.push_back(1.0); coefs.push_back(1.0); coefs.push_back(1.0); c.SetCoefficients(coefs); cout << c.Evaluate(vars) << endl; for(int i = 0; i < c.Coefficients(); i++) { cout << c.Term(i) << endl; } } isis/src/clipper/apps/eis2isis/eis2isis.xml 0 → 100644 +163 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <application name="eis2isis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd"> <brief> Import Clipper EIS NAC files into ISIS format </brief> <description> <p> This program will import PDS4 formatted files from the Europa Clipper Europa Imaging System (EIS) instrument into the ISIS Cube format. This includes three required components: the main EIS data image, the associated image label, and the associated main image readout times table (CSV). Two additional (optional) files are the checkline image (and associated xml label) and the checkline image readout times table (CSV). </p> </description> <history> <change name="Makayla Shepherd, Stuart Sides, Ian Humphrey" date="2017-12-19"> Original version. </change> <change name="Tyler Wilson" date="2018-04-03"> Added normalizeTimeTable which outputs check tables (and check line tables) with time values normalized in the interval [-1,1]. Added checktable/check line readout table, and normalized readout table to the output cubes (the main image and the checkline image). </change> <change name="Tyler Wilson" date="2018-04-04"> Added PvlGroup jitter with PvlKeyword Coefficients to output cube labels, and initialized the Coefficients array to (0.0,0.0,0.0) </change> <change name="Tyler Wilson" date="2018-04-12"> Added the ability to write the checkline cube as a Blob to the Pvl label of the main EIS cube. </change> <change name="Summer Stapleton-Greig" date="2019-06-13"> Updated application to be able to handle both the nacRs and the wacFc image ingestion. This change should cover the basics of the other two camera models as well. Also updated logic for the nacRs to handle cases differently: a main image may now be ingested without the associated checkline image, a main image may not be ingested without the associated times text file, and a checkline image may not be ingested without it's associated line times text file. Test have been updated to reflect these changes. </change> <change name="Stuart Sides and Summer Stapleton-Greig" date="2019-06-17"> Updated application to ingest PDS4 rather than PDS3 files as the mission will be using the PDS4 standards for their label .xml files. </change> <change name="Kristin Berry" date="2020-01-08"> Updates to documentation to add detail and bring it up to date with the current version of the software, prior to checkin to dev. </change> </history> <seeAlso> <applications> <item>pds2isis</item> </applications> </seeAlso> <category> <missionItem>Clipper</missionItem> </category> <groups> <group name="Files"> <parameter name="FROM"> <type>filename</type> <fileMode>input</fileMode> <brief> An EIS NAC main image file to be converted to an ISIS cube </brief> <description> Use this parameter to select the filename of the xml label for a a Clipper EIS NAC <em>main image</em> file to be converted to a cube. This is expected to be a PDS4 formatted file. The associated image must have the same name as the label and end in ".dat." </description> <filter> *.xml </filter> </parameter> <parameter name="FROM2"> <type>filename</type> <fileMode>input</fileMode> <internalDefault>None</internalDefault> <brief> An EIS NAC checkline image file to be converted to an ISIS cube </brief> <description> Use this parameter to select the filename of the xml label for a Clipper EIS NAC <em>checkline image</em> file to be converted to a cube. This is expceted to be a PDS4 formatted file. The associated image must have the same name as the label and end in ".dat." </description> <filter> *.xml </filter> </parameter> <parameter name="MAINREADOUT"> <type>filename</type> <fileMode>input</fileMode> <internalDefault>None</internalDefault> <brief> Input CSV file containing the main image readout times </brief> <description> Use this parameter to select the filename of the main image readout times CSV file. This file contains the line numbers and associated readout times for each line. </description> <filter> *.csv </filter> </parameter> <parameter name="CHECKLINEREADOUT"> <type>filename</type> <fileMode>input</fileMode> <internalDefault>None</internalDefault> <brief> Input CSV file containing the checkline readout times </brief> <description> Use this parameter to select the filename of the checkline image readout times CSV file. This file contains the <em>checkline</em> numbers and associated readout times for each <em>checkline</em>. </description> <filter> *.csv </filter> </parameter> <parameter name="TO"> <type>cube</type> <fileMode>output</fileMode> <brief> Output ISIS cube file for the main image </brief> <description> The output cube file that will contain the EIS NAC <em>main image</em> in ISIS format. </description> <filter> *.cub </filter> </parameter> <parameter name="TO2"> <type>cube</type> <fileMode>output</fileMode> <internalDefault>None</internalDefault> <brief> Output ISIS cube file for the checkline image </brief> <description> The output cube file that will contain the EIS NAC <em>checkline image</em> ISIS format. </description> <filter> *.cub </filter> </parameter> </group> </groups> </application> Loading
isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.cpp 0 → 100644 +71 −0 Original line number Diff line number Diff line /** * @file * $Revision: 1.1.1.1 $ * $Date: 2006/10/31 23:18:08 $ * * 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 <math.h> #include <QString> #include "FileName.h" #include "Constants.h" #include "IException.h" #include "NthOrderPolynomial.h" using namespace std; namespace Isis { /** * Create an NthOrderPolynomial * * @param degree The order/degree of the polynomial * */ NthOrderPolynomial::NthOrderPolynomial(int degree) : Isis::BasisFunction("NthOrderPolynomial", 2, degree) { p_degree = degree; } /** * This is the the overriding virtual function that provides the expansion into * the nth order polynomial equation. * * See BasisFunction for more information. * * @param vars A vector of double values to use for the expansion. */ void NthOrderPolynomial::Expand(const std::vector<double> &vars) { if((int) vars.size() != Variables()) { QString mess = "Number of variables given (" + QString::number(vars.size()) + ") does not match expected (" + Variables() + ")!"; throw IException(IException::Programmer, mess, _FILEINFO_); } double t1 = vars[0]; double t2 = vars[1]; p_terms.clear(); for (int i = p_degree; i >= 1; i--) { p_terms.push_back(pow(t1, i) - pow(t2, i)); } return; } } // end namespace isis
isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.h 0 → 100644 +60 −0 Original line number Diff line number Diff line #ifndef NthOrderPolynomial_h #define NthOrderPolynomial_h /** * @file * $Revision: 1.1.1.1 $ * $Date: 2006/10/31 23:18:08 $ * * 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 <vector> #include "BasisFunction.h" namespace Isis { /** * @brief NthOrderPolynomial basis function * * This is a derived class from the BasisFunction class which creates an nth order polynomial. * * @ingroup Math * * @author 2018-01-01 Unknown * * @internal * @history 2018-01-01 Unknown - Initial Version * @history 2020-01-08 Kristin Berry - Update documentation prior to checkin to dev. */ class NthOrderPolynomial : public Isis::BasisFunction { public: NthOrderPolynomial(int degree); //! Destroys the NthOrderPolynomial object ~NthOrderPolynomial() {} void Expand(const std::vector<double> &vars); private: int p_degree; }; } #endif
isis/src/base/objs/NthOrderPolynomial/NthOrderPolynomial.truth 0 → 100644 +27 −0 Original line number Diff line number Diff line Name = NthOrderPolynomial Ncoefs = 3 Vars = 2 0.5 0.5 0.5 --- -12.5 -19 -5 -1 --- 4.5 9 -3 3 -------- Name = NthOrderPolynomial Ncoefs = 6 Vars = 2 -13.5 -63 33 -15 9 -3 3
isis/src/base/objs/NthOrderPolynomial/unitTest.cpp 0 → 100644 +56 −0 Original line number Diff line number Diff line #include "NthOrderPolynomial.h" #include <iostream> #include "Preference.h" using namespace Isis; using namespace std; int main() { Preference::Preferences(true); NthOrderPolynomial b(3); vector<double> coefs; coefs.push_back(0.5); coefs.push_back(0.5); coefs.push_back(0.5); b.SetCoefficients(coefs); cout << "Name = " << b.Name() << endl; cout << "Ncoefs = " << b.Coefficients() << endl; cout << "Vars = " << b.Variables() << endl; for(int i = 0; i < b.Coefficients(); i++) { cout << b.Coefficient(i) << endl; } cout << "---" << endl; vector<double> vars; vars.push_back(2.0); vars.push_back(3.0); cout << b.Evaluate(vars) << endl; for(int i = 0; i < b.Coefficients(); i++) { cout << b.Term(i) << endl; } cout << "---" << endl; vars[0] = 1.0; vars[1] = -2.0; cout << b.Evaluate(vars) << endl; for(int i = 0; i < b.Coefficients(); i++) { cout << b.Term(i) << endl; } NthOrderPolynomial c(6); cout << "--------" << endl; cout << "Name = " << c.Name() << endl; cout << "Ncoefs = " << c.Coefficients() << endl; cout << "Vars = " << c.Variables() << endl; coefs.push_back(1.0); coefs.push_back(1.0); coefs.push_back(1.0); c.SetCoefficients(coefs); cout << c.Evaluate(vars) << endl; for(int i = 0; i < c.Coefficients(); i++) { cout << c.Term(i) << endl; } }
isis/src/clipper/apps/eis2isis/eis2isis.xml 0 → 100644 +163 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="UTF-8"?> <application name="eis2isis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://isis.astrogeology.usgs.gov/Schemas/Application/application.xsd"> <brief> Import Clipper EIS NAC files into ISIS format </brief> <description> <p> This program will import PDS4 formatted files from the Europa Clipper Europa Imaging System (EIS) instrument into the ISIS Cube format. This includes three required components: the main EIS data image, the associated image label, and the associated main image readout times table (CSV). Two additional (optional) files are the checkline image (and associated xml label) and the checkline image readout times table (CSV). </p> </description> <history> <change name="Makayla Shepherd, Stuart Sides, Ian Humphrey" date="2017-12-19"> Original version. </change> <change name="Tyler Wilson" date="2018-04-03"> Added normalizeTimeTable which outputs check tables (and check line tables) with time values normalized in the interval [-1,1]. Added checktable/check line readout table, and normalized readout table to the output cubes (the main image and the checkline image). </change> <change name="Tyler Wilson" date="2018-04-04"> Added PvlGroup jitter with PvlKeyword Coefficients to output cube labels, and initialized the Coefficients array to (0.0,0.0,0.0) </change> <change name="Tyler Wilson" date="2018-04-12"> Added the ability to write the checkline cube as a Blob to the Pvl label of the main EIS cube. </change> <change name="Summer Stapleton-Greig" date="2019-06-13"> Updated application to be able to handle both the nacRs and the wacFc image ingestion. This change should cover the basics of the other two camera models as well. Also updated logic for the nacRs to handle cases differently: a main image may now be ingested without the associated checkline image, a main image may not be ingested without the associated times text file, and a checkline image may not be ingested without it's associated line times text file. Test have been updated to reflect these changes. </change> <change name="Stuart Sides and Summer Stapleton-Greig" date="2019-06-17"> Updated application to ingest PDS4 rather than PDS3 files as the mission will be using the PDS4 standards for their label .xml files. </change> <change name="Kristin Berry" date="2020-01-08"> Updates to documentation to add detail and bring it up to date with the current version of the software, prior to checkin to dev. </change> </history> <seeAlso> <applications> <item>pds2isis</item> </applications> </seeAlso> <category> <missionItem>Clipper</missionItem> </category> <groups> <group name="Files"> <parameter name="FROM"> <type>filename</type> <fileMode>input</fileMode> <brief> An EIS NAC main image file to be converted to an ISIS cube </brief> <description> Use this parameter to select the filename of the xml label for a a Clipper EIS NAC <em>main image</em> file to be converted to a cube. This is expected to be a PDS4 formatted file. The associated image must have the same name as the label and end in ".dat." </description> <filter> *.xml </filter> </parameter> <parameter name="FROM2"> <type>filename</type> <fileMode>input</fileMode> <internalDefault>None</internalDefault> <brief> An EIS NAC checkline image file to be converted to an ISIS cube </brief> <description> Use this parameter to select the filename of the xml label for a Clipper EIS NAC <em>checkline image</em> file to be converted to a cube. This is expceted to be a PDS4 formatted file. The associated image must have the same name as the label and end in ".dat." </description> <filter> *.xml </filter> </parameter> <parameter name="MAINREADOUT"> <type>filename</type> <fileMode>input</fileMode> <internalDefault>None</internalDefault> <brief> Input CSV file containing the main image readout times </brief> <description> Use this parameter to select the filename of the main image readout times CSV file. This file contains the line numbers and associated readout times for each line. </description> <filter> *.csv </filter> </parameter> <parameter name="CHECKLINEREADOUT"> <type>filename</type> <fileMode>input</fileMode> <internalDefault>None</internalDefault> <brief> Input CSV file containing the checkline readout times </brief> <description> Use this parameter to select the filename of the checkline image readout times CSV file. This file contains the <em>checkline</em> numbers and associated readout times for each <em>checkline</em>. </description> <filter> *.csv </filter> </parameter> <parameter name="TO"> <type>cube</type> <fileMode>output</fileMode> <brief> Output ISIS cube file for the main image </brief> <description> The output cube file that will contain the EIS NAC <em>main image</em> in ISIS format. </description> <filter> *.cub </filter> </parameter> <parameter name="TO2"> <type>cube</type> <fileMode>output</fileMode> <internalDefault>None</internalDefault> <brief> Output ISIS cube file for the checkline image </brief> <description> The output cube file that will contain the EIS NAC <em>checkline image</em> ISIS format. </description> <filter> *.cub </filter> </parameter> </group> </groups> </application>