Skip to content

Commit

Permalink
change LOFF/COFF/LFAC/CFAC depending on the imagewidth
Browse files Browse the repository at this point in the history
  • Loading branch information
hvanruys committed Dec 10, 2023
1 parent b333ad8 commit 23a076d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 24 deletions.
4 changes: 4 additions & 0 deletions core/formgeostationary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,10 @@ void FormGeostationary::CreateGeoImagenetCDFMTG(SegmentListGeostationary *sl, QS
//W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY---NC4E_C_EUMT_20170920113515_GTT_DEV_20170920113008_20170920113015_N_JLS_T_0070_0001.nc
//W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-TRAIL---NC4E_C_EUMT_20170920114422_GTT_DEV_20170920113008_20170920113922_N_JLS_T_0070_0041.nc

sl->COFF = opts.geosatellites.at(geoindex).coffhrv;
sl->LOFF = opts.geosatellites.at(geoindex).loffhrv;
sl->CFAC = opts.geosatellites.at(geoindex).cfachrv;
sl->LFAC = opts.geosatellites.at(geoindex).lfachrv;

if(type == "VIS_IR" || type == "VIS_IR Color")
{
Expand Down
15 changes: 6 additions & 9 deletions core/formimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1710,13 +1710,10 @@ void FormImage::OverlayGeostationary(QPainter *paint, SegmentListGeostationary *

if(sl->getGeoSatellite() == eGeoSatellite::MTG_I1)
{
if(m_image->width() == 5568)
{
coff = coff/2.0;
loff = coff;
cfac = cfac/2.0;
lfac = cfac;
}
coff = m_image->width() == 11136 ? opts.geosatellites.at(geoindex).coffhrv : opts.geosatellites.at(geoindex).coff;
loff = m_image->width() == 11136 ? opts.geosatellites.at(geoindex).loffhrv : opts.geosatellites.at(geoindex).loff;
cfac = m_image->width() == 11136 ? opts.geosatellites.at(geoindex).cfachrv : opts.geosatellites.at(geoindex).cfac;
lfac = m_image->width() == 11136 ? opts.geosatellites.at(geoindex).lfachrv : opts.geosatellites.at(geoindex).lfac;
}

double sub_lon = sl->geosatlon;
Expand Down Expand Up @@ -1852,9 +1849,9 @@ void FormImage::OverlayGeostationary(QPainter *paint, SegmentListGeostationary *
if(m_image->width() == 3712)
factor = 3.0;
else if(m_image->width() == 5568)
factor = 2.0;
else if(m_image->width() == 11136)
factor = 1.0;
else if(m_image->width() == 11136)
factor = 0.5;
else if(m_image->width() == 2288) // FY
factor = 1.0;
else if(m_image->width() == 9152) // FY - VIS
Expand Down
9 changes: 5 additions & 4 deletions core/globe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,12 +1562,13 @@ void Globe::Render3DGeoSegmentNew(int geoindex)
{
Equirectangular equirect;

int height = imageptrs->ptrimageGeostationary->height();
int width = imageptrs->ptrimageGeostationary->width();
// int height = imageptrs->ptrimageGeostationary->height();
// int width = imageptrs->ptrimageGeostationary->width();

height = imageptrs->pmOut->height();
width = imageptrs->pmOut->width();
// height = imageptrs->pmOut->height();
// width = imageptrs->pmOut->width();

// qDebug() << imageptrs->pmOut->height();

equirect.Initialize(imageptrs->pmOut->width(), imageptrs->pmOut->height());

Expand Down
2 changes: 1 addition & 1 deletion core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <QMutex>

#define APPVERSION "2.0.2"
#define APPVERSION "2.0.3"


using namespace std;
Expand Down
16 changes: 8 additions & 8 deletions core/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1620,14 +1620,14 @@ void Options::CreateGeoSatelliteIni()

geosatellites[11].prologfile = false;
geosatellites[11].epilogfile = false;
geosatellites[11].coff = 5568;
geosatellites[11].loff = 5568;
geosatellites[11].cfac = 1172050000. * 2;
geosatellites[11].lfac = 1172050000. * 2;
geosatellites[11].coffhrv = 0;
geosatellites[11].loffhrv = 0;
geosatellites[11].cfachrv = 0.;
geosatellites[11].lfachrv = 0.;
geosatellites[11].coff = 2784;
geosatellites[11].loff = 2784;
geosatellites[11].cfac = 1172050000.;
geosatellites[11].lfac = 1172050000.;
geosatellites[11].coffhrv = 5568;
geosatellites[11].loffhrv = 5568;
geosatellites[11].cfachrv = 1172050000. * 2;
geosatellites[11].lfachrv = 1172050000. * 2;


geosatellites[11].spectrumlist << "vis_04" << "vis_05" << "vis_06" << "vis_08" << "vis_09" << "nir_13" << "nir_16"
Expand Down
9 changes: 7 additions & 2 deletions core/segmentlistgeostationary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2254,8 +2254,8 @@ void SegmentListGeostationary::concurrentReadFilelist(SegmentListGeostationary *

size_t npixperseg = npix*nlin;

qDebug() << QString("[%1] concurrentReadFilelist() planned end = %2 npix = %3 nlin = %4 filesequence = %5")
.arg(sm->kindofimage).arg(planned_end_segment).arg(sm->number_of_columns).arg(sm->number_of_lines).arg(filesequence);
//qDebug() << QString("[%1] concurrentReadFilelist() planned end = %2 npix = %3 nlin = %4 filesequence = %5")
// .arg(sm->kindofimage).arg(planned_end_segment).arg(sm->number_of_columns).arg(sm->number_of_lines).arg(filesequence);
qDebug() << QString("[%1] concurrentReadFilelist() file = %1 channelindex = %2 filesequence = %3")
.arg(llFile).arg(channelindex).arg(filesequence);

Expand Down Expand Up @@ -2800,6 +2800,11 @@ void SegmentListGeostationary::ComposeSegmentImagenetCDFMTGInThreadConcurrent()

imageptrs->InitializeImageGeostationary(imageptrs->mtg_total_number_of_columns[0], imageptrs->mtg_total_number_of_rows[0]);

this->COFF = imageptrs->mtg_total_number_of_columns[0] == 11136 ? opts.geosatellites.at(geoindex).coffhrv : opts.geosatellites.at(geoindex).coff;
this->LOFF = imageptrs->mtg_total_number_of_columns[0] == 11136 ? opts.geosatellites.at(geoindex).loffhrv : opts.geosatellites.at(geoindex).loff;
this->CFAC = imageptrs->mtg_total_number_of_columns[0] == 11136 ? opts.geosatellites.at(geoindex).cfachrv : opts.geosatellites.at(geoindex).cfac;
this->LFAC = imageptrs->mtg_total_number_of_columns[0] == 11136 ? opts.geosatellites.at(geoindex).lfachrv : opts.geosatellites.at(geoindex).lfac;

emit this->progressCounter(progcounter += 10);

this->SetupContrastStretch( 0, 0, 1023, 255);
Expand Down
5 changes: 5 additions & 0 deletions core/segmentlistgeostationary.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class SegmentListGeostationary : public QObject
double CFAC;
double LFAC;

// double COFFHRV;
// double LOFFHRV;
// double CFACHRV;
// double LFACHRV;

int LowerEastColumnActual;
int LowerSouthLineActual;
int LowerWestColumnActual;
Expand Down

0 comments on commit 23a076d

Please sign in to comment.