Commit 4d3003f2 authored by Tyler Wilson's avatar Tyler Wilson Committed by Adam Paquette
Browse files

Hayabusa2 fy19 (#3138)

* Added AlphaCube group to outputlabel in the event the image is cropped.

* Fix libtiff dependency (#636) (#644)

* Upgrade libtiff to 4.0.10 (#636)

* Switch libtiff to 4.0.9 or higher to remove geotiff conflict

* Moved ISIS3 conda-build recipe from ISIS3_deps repository (#650)

* Fixed warning in Pixel unit tests

* Made a tweak to the dimensions of the alpha cube for cropped images to give it the correct dimensions.

* Changed the transform function so it could process an array of doubles instead of an array of ints.

* Smear correction was being incorrectly applied to onboard smear corrected images and screwing things up.  Fixed it.

* Added gtest capability to hyb2onc2isis

* Removing build numbers from external libraries (#660)

* Moved ISIS3 conda-build recipe from ISIS3_deps repository

* Un-pinned non-astro build numbers

* Removing build numbers from external libraries in the environment and meta.yeml files

* Final merging

* Added pixel type attribute to the output image of program shadow. Fixes #5187 (#659)

* Removed bolding of some text to decrease distraction.

* Fixed some typos.

* Reworded documentation.

* Added section for Environment and PreferemcesSetup in the Getting Started Section. (#663)

* Updated .gitmodules to use https rather than ssh (#673)

* Added build type release to conda recipe (#676)

* Modified isis/tests/CMakeLists.txt as well as hyb2onc2isis to fix unresolved symbol errors (CMakeLists.txt) and to fix some bugs in hyb2onc2isis involved with turning it into a callable function.

* Added w1 test to hyb2onc2isisTests.cpp

* Modified hyb2onccal to be a callable function.

* Updates README with Discourse (#690)

* Updates README with Discourse

* Update README.md

* Update README.md

* Changed the Pvl label output for Pvl hyb2onc2isis(QString fitsFileName, QString outputCubeFileName, CubeAttributeOutput att, QString target)

* Added Newton-Rapheson method to Hyb2OncCalUtils.h to solve the linearity equation.

* Final push of hayabusa2 changes made to the ingestion/calibration applications.

* Added I/F calibration step.  Cleaned up code base and worked on the documentation.  The documentation will need to be corrected before this is merged into dev.

* Fixed a missing </li> tag in hyb2onccal.xml

* Deleted some functions that were defined multiple times do to screwed up merge-conflict resolution.
parent 9dccfa01
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -269,3 +269,6 @@ Pvl hyb2onc2isis(QString fitsFileName, QString outputCubeFileName, CubeAttribute





+16 −37
Original line number Diff line number Diff line
@@ -121,11 +121,18 @@ static QString g_iofCorrection("IOF"); //!< Is I/F correction to be applied?

//  I/F variables

//static double g_iof(1.0);



static double g_iofScale(1.0);
static double g_solarFlux(1.0);  //!< The solar flux (used to calculate g_iof).
static double g_sensitivity(1.0);
static double g_effectiveBandwidth(1.0);

static double g_J(1.0);



namespace Isis {

@@ -148,40 +155,6 @@ static AlphaCube *alpha(0);

static Pvl g_configFile;

double linearFun(double Iobs,double x, double g[3]) {
  return Iobs - g[0]*x -g[1]*pow(x,2.0) -g[2]*pow(x,3.0);

}

double dFun(double x, double g[3]) {
  return -g[0] - 2*g[1]*x -3*g[2]*pow(x,2.0);

}


bool newton_rapheson(double Iobs,double x0, double g[3],double &result, double epsilon=1e-6 )  {

   double x[2];
   double dx = 1.0;
   int iter = 0;
   int maxIterations=500;
   x[0] = x0;
   while (dx > epsilon)  {

     x[1]=x[0] - linearFun(Iobs,x[0],g)/dFun(x[0],g);
     dx = fabs(x[1]-x[0]) ;
     x[0]=x[1];
     iter++;
     if (iter > maxIterations) {

       return false;
     }
   }
   result = x[1];
   return true;
}



/**
 * @brief linearFun:  The linear correction function (used by the newton_rapheson method)
@@ -244,7 +217,7 @@ bool newton_rapheson(double Iobs,double x0, double g[3],double &result, double e
}


/**

* @brief Apply radiometric correction to each line of a Hayabusa2 image.
* @author 2016-03-30 Kris Becker
* @param in   Raw image and flat field
@@ -313,7 +286,6 @@ void Calibrate(vector<Buffer *>& in, vector<Buffer *>& out) {
    // DARK Current
    imageOut[i] = imageOut[i] - g_darkCurrent;    


    //Smear correction
    if (!g_onBoardSmearCorrection) {

@@ -344,6 +316,7 @@ void Calibrate(vector<Buffer *>& in, vector<Buffer *>& out) {
      }
    }


  }


@@ -558,7 +531,7 @@ QString loadCalibrationVariables(const QString &config) {

  // Compute BIAS correction factor (it's a constant so do it once!)
  g_bias = g_b0+g_b1*g_CCD_T_temperature+g_b2*g_ECT_T_temperature;
  //double correction_factor = (g_bae0 + g_bae1*g_AEtemperature);

  g_bias *= (g_bae0 + g_bae1*g_AEtemperature); //bias correction factor

  // Load the Solar Flux for the specific filter
@@ -566,6 +539,12 @@ QString loadCalibrationVariables(const QString &config) {
  g_sensitivity = sensitivity[g_filter.toLower()];
  g_effectiveBandwidth = effectiveBW[g_filter.toLower()];

  g_J = g_solarFlux/(g_effectiveBandwidth*.0001);





  //Load the linearity variables
  g_L[0] = linearity["L"][0].toDouble();
  g_L[1] = linearity["L"][1].toDouble();