various little extensions to handle Fourier

This commit is contained in:
nemu 2008-12-22 10:26:42 +00:00
parent 2fdbe96401
commit 4a832f6fe8
5 changed files with 35 additions and 4 deletions

View File

@ -330,12 +330,13 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
HandleDifference(); HandleDifference();
} else if (x == 'f') { } else if (x == 'f') {
if (fPlotType != MSR_PLOT_NON_MUSR) { if (fPlotType != MSR_PLOT_NON_MUSR) {
HandleFourier(-1);
cout << endl << ">> will show the Fourier transform, to be implemented yet." << endl; cout << endl << ">> will show the Fourier transform, to be implemented yet." << endl;
} }
} else if (x == '+') { } else if (x == '+') {
cout << endl << ">> if Fourier is shown, will add +1° to the Fourier." << endl; cout << endl << ">> if Fourier is shown, will add " << fFourier->fPhaseIncerement << "° to the Fourier." << endl;
} else if (x == '-') { } else if (x == '-') {
cout << endl << ">> if Fourier is shown, will add -1° to the Fourier." << endl; cout << endl << ">> if Fourier is shown, will subtract " << fFourier->fPhaseIncerement << "° to the Fourier." << endl;
} else { } else {
// do all the necessary stuff **TO BE DONE** // do all the necessary stuff **TO BE DONE**
fMainCanvas->Update(); fMainCanvas->Update();
@ -2007,7 +2008,16 @@ void PMusrCanvas::SaveDataDb()
*/ */
void PMusrCanvas::HandleFourier(int tag) void PMusrCanvas::HandleFourier(int tag)
{ {
switch (tag) { if (fMsrHandler->GetMsrFourierList()->fFourierBlockPresent) {
cout << endl << ">> fourier block in msr-file present" << endl;
fFourier = fMsrHandler->GetMsrFourierList();
}
if (tag == -1) { // called via cmd key 'f'
tag = fFourier->fPlotTag;
}
switch (tag) { // called via popup menu
case FOURIER_PLOT_REAL: case FOURIER_PLOT_REAL:
cout << endl << ">> will handle Real Part Fourier ..." << endl; cout << endl << ">> will handle Real Part Fourier ..." << endl;
break; break;

View File

@ -85,6 +85,7 @@ void PStartupHandler::OnStartDocument()
fFourierDefaults.fRangeForPhaseCorrection[1] = 0.0; fFourierDefaults.fRangeForPhaseCorrection[1] = 0.0;
fFourierDefaults.fPlotRange[0] = 0.0; fFourierDefaults.fPlotRange[0] = 0.0;
fFourierDefaults.fPlotRange[1] = 0.0; fFourierDefaults.fPlotRange[1] = 0.0;
fFourierDefaults.fPhaseIncerement = 1.0;
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -126,6 +127,8 @@ void PStartupHandler::OnStartElement(const char *str, const TList *attributes)
fKey = ePlot; fKey = ePlot;
} else if (!strcmp(str, "phase")) { } else if (!strcmp(str, "phase")) {
fKey = ePhase; fKey = ePhase;
} else if (!strcmp(str, "phase_increment")) {
fKey = ePhaseIncrement;
} }
} }
@ -291,6 +294,22 @@ void PStartupHandler::OnCharacters(const char *str)
} }
break; break;
case ePhase: case ePhase:
tstr = TString(str);
if (tstr.IsFloat()) {
fFourierDefaults.fPhase = tstr.Atof();
} else {
cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase, will ignore it.";
cout << endl;
}
break;
case ePhaseIncrement:
tstr = TString(str);
if (tstr.IsFloat()) {
fFourierDefaults.fPhaseIncerement = tstr.Atof();
} else {
cout << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase increment, will ignore it.";
cout << endl;
}
break; break;
default: default:
break; break;

View File

@ -293,6 +293,7 @@ typedef struct {
double fPhase; ///< phase double fPhase; ///< phase
double fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction double fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction
double fPlotRange[2]; ///< field/frequency plot range double fPlotRange[2]; ///< field/frequency plot range
double fPhaseIncerement; ///< phase increment for manual phase optimization
} PMsrFourierStructure; } PMsrFourierStructure;
//------------------------------------------------------------- //-------------------------------------------------------------

View File

@ -65,7 +65,7 @@ class PStartupHandler : public TObject, public TQObject
private: private:
enum EKeyWords {eEmpty, eComment, eDataPath, enum EKeyWords {eEmpty, eComment, eDataPath,
eFourierSettings, eUnits, eFourierPower, eApodization, ePlot, ePhase, eFourierSettings, eUnits, eFourierPower, eApodization, ePlot, ePhase, ePhaseIncrement,
eRootSettings, eMarkerList, eMarker, eRootSettings, eMarkerList, eMarker,
eColorList, eColor}; eColorList, eColor};
EKeyWords fKey; EKeyWords fKey;

View File

@ -12,6 +12,7 @@
<apodization>none</apodization> <apodization>none</apodization>
<plot>real_and_imag</plot> <plot>real_and_imag</plot>
<phase>0.0</phase> <phase>0.0</phase>
<phase_increment>1.0</phase_increment>
</fourier_settings> </fourier_settings>
<root_settings> <root_settings>
<marker_list> <marker_list>