1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include "fringetestcreater.h"
#include "../../structures/timefrequencydata.h"
#include "../../structures/timefrequencymetadata.h"
#include "../../imaging/uvimager.h"
void FringeTestCreater::AddStaticFringe(class TimeFrequencyData &ftData,
TimeFrequencyMetaDataCPtr metaData,
long double strength) {
Image2DCPtr real = ftData.GetRealPart(),
imaginary = ftData.GetImaginaryPart();
Image2DPtr newReal =
Image2D::CreateUnsetImagePtr(real->Width(), real->Height()),
newImaginary =
Image2D::CreateUnsetImagePtr(real->Width(), real->Height());
for (size_t channelIndex = 0; channelIndex < ftData.ImageHeight();
++channelIndex) {
for (size_t t = 0; t < ftData.ImageWidth(); ++t) {
num_t fringeRotation =
2.0 * M_PIn * UVImager::GetFringeCount(0, t, channelIndex, metaData);
newReal->SetValue(
t, channelIndex,
strength * cosn(fringeRotation) + real->Value(t, channelIndex));
newImaginary->SetValue(
t, channelIndex,
strength * sinn(fringeRotation) + imaginary->Value(t, channelIndex));
}
}
ftData.Set(ftData.Polarizations()[0], newReal, newImaginary);
}
|