Skip to content

Commit

Permalink
Oblique Mercator projection for VIIRS DNB images.
Browse files Browse the repository at this point in the history
  • Loading branch information
hvanruys committed Dec 2, 2021
1 parent af94f9d commit 218864d
Show file tree
Hide file tree
Showing 20 changed files with 628 additions and 231 deletions.
110 changes: 109 additions & 1 deletion core/dialogpreferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number>
<number>4</number>
</property>
<widget class="QWidget" name="page2D">
<property name="layoutDirection">
Expand Down Expand Up @@ -317,6 +317,12 @@
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="3">
<widget class="QPushButton" name="btnProjectionOverlayColor3">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand Down Expand Up @@ -344,6 +350,12 @@
</item>
<item row="0" column="3">
<widget class="QPushButton" name="btnProjectionOverlayColor1">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -357,6 +369,12 @@
</item>
<item row="1" column="1">
<widget class="QPushButton" name="btnGeoImageOverlayColor2">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -370,6 +388,12 @@
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btnGeoImageOverlayColor1">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -383,6 +407,12 @@
</item>
<item row="2" column="1">
<widget class="QPushButton" name="btnGeoImageOverlayColor3">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand Down Expand Up @@ -417,6 +447,12 @@
</item>
<item row="3" column="3">
<widget class="QPushButton" name="btnProjectionOverlayLonLatColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -430,6 +466,12 @@
</item>
<item row="1" column="3">
<widget class="QPushButton" name="btnProjectionOverlayColor2">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand Down Expand Up @@ -457,6 +499,12 @@
</item>
<item row="3" column="1">
<widget class="QPushButton" name="btnOLCIImageOverlayColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand Down Expand Up @@ -625,6 +673,12 @@
</item>
<item row="3" column="1">
<widget class="QPushButton" name="btnGlobeOverlayColor1">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -638,6 +692,12 @@
</item>
<item row="4" column="1">
<widget class="QPushButton" name="btnGlobeOverlayColor2">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -651,6 +711,12 @@
</item>
<item row="5" column="1">
<widget class="QPushButton" name="btnGlobeOverlayColor3">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
Expand All @@ -668,6 +734,12 @@
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="3">
<widget class="QPushButton" name="btnGlobeLonLatColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand All @@ -681,6 +753,12 @@
</item>
<item row="1" column="1">
<widget class="QPushButton" name="btnSatTrackColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand All @@ -694,6 +772,12 @@
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btnSatHorizonColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand Down Expand Up @@ -721,6 +805,12 @@
</item>
<item row="0" column="3">
<widget class="QPushButton" name="btnSatSegmentColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand All @@ -734,6 +824,12 @@
</item>
<item row="2" column="1">
<widget class="QPushButton" name="btnMapLCCExtentColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand Down Expand Up @@ -768,6 +864,12 @@
</item>
<item row="1" column="3">
<widget class="QPushButton" name="btnSatSegmentColorSel">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand All @@ -781,6 +883,12 @@
</item>
<item row="3" column="1">
<widget class="QPushButton" name="btnMapGVPExtentColor">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
Expand Down
3 changes: 2 additions & 1 deletion core/equirectangular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ void Equirectangular::Initialize(int imwidth, int imheight)
lat_array[i] = 90.0 - (i + 0.5) * lat_del;


initializeProjectionCoord();

//initializeProjectionCoord();

}

Expand Down
1 change: 1 addition & 0 deletions core/formephem.ui
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
<property name="font">
<font>
<pointsize>10</pointsize>
<kerning>false</kerning>
</font>
</property>
</widget>
Expand Down
1 change: 1 addition & 0 deletions core/formimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ void FormImage::setPixmapToLabel(bool settoolboxbuttons)
case IMAGE_VIIRSDNB:
displayVIIRSImageInfo(segmenttype);
imageLabel->setPixmap(QPixmap::fromImage( *(imageptrs->ptrimageViirsDNB)));
formtoolbox->setOMimagesize(imageptrs->ptrimageViirsDNB->width(), imageptrs->ptrimageViirsDNB->height());
break;
case IMAGE_OLCI:
displaySentinelImageInfo(SEG_OLCIEFR);
Expand Down
23 changes: 16 additions & 7 deletions core/formtoolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3524,13 +3524,6 @@ void FormToolbox::on_btnCreateStereo_clicked()

void FormToolbox::on_btnCreateOM_clicked()
{
// if(!opts.buttonVIIRSM)
// {
// QMessageBox msgBox;
// msgBox.setText("Only possible for VIIRS images.");
// msgBox.exec();
// return;
// }

ui->pbProgress->reset();

Expand All @@ -3542,6 +3535,14 @@ void FormToolbox::on_btnCreateOM_clicked()
return;
}
}
else if(ui->rdbVIIRSDNBin->isChecked())
{
if(!(opts.buttonVIIRSDNB || opts.buttonVIIRSDNBNOAA20) || !segs->SelectedVIIRSDNBSegments())
{
QMessageBox::information( this, "VIIRS DNB", "No selected VIIRS DNB segments !" );
return;
}
}
else if(ui->rdbMERSIin->isChecked())
{
if(!opts.buttonMERSI || !segs->SelectedMERSISegments())
Expand Down Expand Up @@ -3570,6 +3571,14 @@ void FormToolbox::on_btnCreateOM_clicked()
else if(opts.buttonVIIRSMNOAA20)
imageptrs->om->CreateMapFromVIIRS(eSegmentType::SEG_VIIRSMNOAA20, false);
}
else if(ui->rdbVIIRSDNBin->isChecked())
{
currentProjectionType = PROJ_VIIRSDNB;
if(opts.buttonVIIRSDNB)
imageptrs->om->CreateMapFromVIIRS(eSegmentType::SEG_VIIRSDNB, false);
else if(opts.buttonVIIRSDNBNOAA20)
imageptrs->om->CreateMapFromVIIRS(eSegmentType::SEG_VIIRSDNBNOAA20, false);
}
else if(ui->rdbMERSIin->isChecked())
{
currentProjectionType = PROJ_MERSI;
Expand Down
10 changes: 5 additions & 5 deletions core/formtoolbox.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7308,14 +7308,14 @@
</font>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="pageLambert">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>591</width>
<width>419</width>
<height>670</height>
</rect>
</property>
Expand Down Expand Up @@ -8869,8 +8869,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>255</height>
<width>610</width>
<height>470</height>
</rect>
</property>
<attribute name="label">
Expand All @@ -8880,7 +8880,7 @@
<item>
<widget class="QLabel" name="label_70">
<property name="text">
<string>Only possible for AVHRR(Metop), VIIRS M and MERSI images</string>
<string>Only possible for AVHRR(Metop), VIIRS M/DNB and MERSI images</string>
</property>
</widget>
</item>
Expand Down
1 change: 0 additions & 1 deletion core/generalverticalperspective.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "options.h"
#include "pixgeoconversion.h"
#include <QtConcurrent/QtConcurrent>
#include "equirectangular.h"

#include <QDebug>

Expand Down
Loading

0 comments on commit 218864d

Please sign in to comment.