Skip to content

Commit

Permalink
Hayabusa2 fy19 (DOI-USGS#3138)
Browse files Browse the repository at this point in the history
* Added AlphaCube group to outputlabel in the event the image is cropped.

* Fix libtiff dependency (DOI-USGS#636) (DOI-USGS#644)

* Upgrade libtiff to 4.0.10 (DOI-USGS#636)

* Switch libtiff to 4.0.9 or higher to remove geotiff conflict

* Moved ISIS3 conda-build recipe from ISIS3_deps repository (DOI-USGS#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 (DOI-USGS#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 DOI-USGS#5187 (DOI-USGS#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. (DOI-USGS#663)

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

* Added build type release to conda recipe (DOI-USGS#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 (DOI-USGS#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.
  • Loading branch information
Tyler Wilson authored and acpaquette committed Apr 6, 2021
1 parent 9dccfa0 commit 4d3003f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 37 deletions.
3 changes: 3 additions & 0 deletions isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,6 @@ Pvl hyb2onc2isis(QString fitsFileName, QString outputCubeFileName, CubeAttribute






53 changes: 16 additions & 37 deletions isis/src/hayabusa2/apps/hyb2onccal/Hyb2OncCalUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {

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


}


Expand Down Expand Up @@ -558,14 +531,20 @@ 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
g_solarFlux = solar[g_filter.toLower()];
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();
Expand Down

0 comments on commit 4d3003f

Please sign in to comment.