Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge of dev into hayabusa2_fy19 #692

Merged
merged 23 commits into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a59a951
Added AlphaCube group to outputlabel in the event the image is cropped.
twilson271828 Dec 14, 2018
c00f88e
Fix libtiff dependency (#636) (#644)
seignovert Dec 17, 2018
645a838
Moved ISIS3 conda-build recipe from ISIS3_deps repository (#650)
jessemapel Dec 17, 2018
08edafe
Fixed warning in Pixel unit tests
jessemapel Dec 17, 2018
ca9e666
Made a tweak to the dimensions of the alpha cube for cropped images t…
twilson271828 Dec 17, 2018
c3f4513
Changed the transform function so it could process an array of double…
twilson271828 Dec 17, 2018
d9439fa
Smear correction was being incorrectly applied to onboard smear corre…
twilson271828 Dec 17, 2018
90baaa7
Merge pull request #652 from jessemapel/warnings
krlberry Dec 18, 2018
23978de
Added gtest capability to hyb2onc2isis
twilson271828 Dec 18, 2018
8fa370e
Removing build numbers from external libraries (#660)
SgStapleton Dec 19, 2018
a92a0c4
Added pixel type attribute to the output image of program shadow. Fix…
kaitlyndlee Dec 19, 2018
997f8c7
Added section for Environment and PreferemcesSetup in the Getting Sta…
kaitlyndlee Dec 19, 2018
520ccca
Updated .gitmodules to use https rather than ssh (#673)
SgStapleton Dec 19, 2018
d7ab32c
Added build type release to conda recipe (#676)
SgStapleton Dec 20, 2018
0128bdb
Merge branch 'dev' into hayabusa2_fy19: Needed updated environment.y…
Jan 2, 2019
401b2cf
Modified isis/tests/CMakeLists.txt as well as hyb2onc2isis to fix unr…
twilson271828 Jan 30, 2019
78e8bce
Added w1 test to hyb2onc2isisTests.cpp
twilson271828 Jan 30, 2019
e6db077
Modified hyb2onccal to be a callable function.
twilson271828 Feb 1, 2019
4a76370
Updates README with Discourse (#690)
jlaura Feb 6, 2019
32ed751
Changed the Pvl label output for Pvl hyb2onc2isis(QString fitsFileNam…
twilson271828 Feb 7, 2019
edeb6bf
Added Newton-Rapheson method to Hyb2OncCalUtils.h to solve the linear…
twilson271828 Feb 7, 2019
3e27125
Merge branch 'dev' into hayabusa2_fy19
twilson271828 Feb 7, 2019
773ccbc
Merge branch 'hayabusa2_fy19' into hayabusa2_fy19
Feb 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ISIS3

[![Join the chat at https://gitter.im/USGS-Astrogeology/isis3_cmake](https://badges.gitter.im/USGS-Astrogeology/isis3_cmake.svg)](https://gitter.im/USGS-Astrogeology/isis3_cmake?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the discourse at https://astrodiscuss.usgs.gov](https://img.shields.io/discourse/https/astrodiscuss.usgs.gov/topics.svg?style=flat)](https://astrodiscuss.usgs.gov/)

## Table of Contents

Expand Down
9 changes: 2 additions & 7 deletions isis/src/hayabusa2/apps/hyb2onc2isis/hyb2onc2isis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,10 @@ Pvl hyb2onc2isis(QString fitsFileName, QString outputCubeFileName, CubeAttribute
importFits.StartProcess();
importFits.Finalize();


return outputLabel;

return finalLabel;


}





}

66 changes: 46 additions & 20 deletions isis/src/hayabusa2/apps/hyb2onccal/Hyb2OncCalUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ static double g_d1(0);
static double g_darkCurrent(0);

//Linearity correction variables
static double g_L0(0);
static double g_L1(0);
static double g_L2(0);

static double g_L[3] = {0.0,0.0,0.0};

// TODO: we do not have the readout time (transfer period) for Hayabusa2 ONC.
//Smear calculation variables
Expand Down Expand Up @@ -151,6 +150,40 @@ 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 Apply radiometric correction to each line of an AMICA image.
Expand Down Expand Up @@ -212,13 +245,14 @@ void Calibrate(vector<Buffer *>& in, vector<Buffer *>& out) {
}
}


#if 0
double dn = imageOut[i];
double linearCorrection;
linearCorrection = g_L0+g_L1*pow(imageOut[i],2.0)+g_L2*pow(imageOut[i],3.0);
imageOut[i]*=linearCorrection;
double result = 1.0;
double x0 = 1.0;
newton_rapheson(imageOut[i],x0, g_L,result );
imageOut[i] = result;

#endif
//qDebug() << dn << ","<< result;


// DARK Current
Expand Down Expand Up @@ -247,13 +281,6 @@ void Calibrate(vector<Buffer *>& in, vector<Buffer *>& out) {
//In the SIS this adjustment is made just after the bias, but
//in the Calibration paper it happens just before the flat field correction.

#if 0
double linearCorrection;
linearCorrection = g_L0+g_L1*pow(imageOut[i],2.0)+g_L2*pow(imageOut[i],3.0);
qDebug() << "linearCorrection=" << linearCorrection;
imageOut[i]*=linearCorrection;
#endif


// FLATFIELD correction
// Check for any special pixels in the flat field (unlikely)
Expand Down Expand Up @@ -594,9 +621,10 @@ QString loadCalibrationVariables(const QString &config) {
g_solarFlux = solar[g_filter.toLower()];

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



// radiance = g_v_standard * g_iofScale
Expand All @@ -608,8 +636,6 @@ QString loadCalibrationVariables(const QString &config) {





}

#endif
Expand Down