完成调用丰的sif python算法 → 所有数据处理功能完成
This commit is contained in:
@ -37,11 +37,16 @@ namespace mainProgram
|
||||
}
|
||||
|
||||
|
||||
public void RadCorrection(double[] calData, int i1,double[] rawData, int i2, int bandnumber)
|
||||
public void RadCorrection(double[] calData, int integrationTime_cal, double[] targetData, int integrationTime_target, int bandnumber)
|
||||
{
|
||||
for (int i = 0; i < bandnumber; i++)
|
||||
{
|
||||
rawData[i] = rawData[i] * calData[i] * (i1 * 1.0) / (i2 * 1.0);
|
||||
targetData[i] = calData[i] * targetData[i] * (integrationTime_cal * 1.0) / (integrationTime_target * 1.0);
|
||||
|
||||
if (targetData[i] < 0)//如果福亮度为负值,则设置为0
|
||||
{
|
||||
targetData[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -54,6 +59,7 @@ namespace mainProgram
|
||||
{
|
||||
public DataStatus dataStatus;
|
||||
public string SN;
|
||||
public int position;
|
||||
public int exposureTime;
|
||||
public int spectralDataLength;
|
||||
public double[] spectral;//long or double ?????????????????????????
|
||||
@ -63,10 +69,12 @@ namespace mainProgram
|
||||
{
|
||||
public int exposureTime;
|
||||
public int pixelCount;
|
||||
public int temperature;
|
||||
public float temperature;
|
||||
public float[] waveLengthInNM;
|
||||
public double[] gain;
|
||||
public double[] offset;
|
||||
public string SN;
|
||||
public int position;
|
||||
}
|
||||
|
||||
public struct NonLinearData
|
||||
@ -206,6 +214,8 @@ namespace mainProgram
|
||||
|
||||
|
||||
spectralData.SN = mSN[wavelengthCountIndex];
|
||||
spectralData.position = GetPosition(index);
|
||||
|
||||
spectralData.spectralDataLength = mWavelengthCountOfSpectrometers[wavelengthCountIndex];
|
||||
spectralData.exposureTime = int.Parse(mDataTable.Rows[index - 1 + rowOffset][2].ToString());
|
||||
|
||||
@ -242,6 +252,26 @@ namespace mainProgram
|
||||
return wavelengthCountIndex;
|
||||
}
|
||||
|
||||
public int GetPosition(int index)
|
||||
{
|
||||
index -= 1;//因为0基索引,所以减1
|
||||
int position;
|
||||
|
||||
int chushu = index / mSpectralCountOfOneSpectrometer;
|
||||
int yushu = index % mSpectralCountOfOneSpectrometer;
|
||||
|
||||
if (yushu == 0)
|
||||
{
|
||||
position = mSpectralCountOfOneSpectrometer;
|
||||
}
|
||||
else
|
||||
{
|
||||
position = yushu;
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
public void SaveCSV(string fullPath)//table数据写入csv
|
||||
{
|
||||
FileInfo fi = new FileInfo(fullPath);
|
||||
|
Reference in New Issue
Block a user