Skip to content

Commit

Permalink
GOES-17 added.
Browse files Browse the repository at this point in the history
Not necessary to indicate RGB for Pseudo True Color for GOES-16/-17.
When installing this version it is not necessary to delete
'GeoSatellites.ini'. The table for 'GeoSatellite Config' is read only.
The 'Add' and 'Delete'buttons are disabled.
  • Loading branch information
hvanruys committed Dec 28, 2018
1 parent 75103bf commit e571ef1
Show file tree
Hide file tree
Showing 15 changed files with 407 additions and 265 deletions.
10 changes: 6 additions & 4 deletions core/avhrrsatellite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ void AVHRRSatellite::AddSegmentsToList(QFileInfoList fileinfolist)
for (int i = 0; i < fileinfolist.size(); ++i)
{
fileInfo = fileinfolist.at(i);
qDebug() << "---->" << fileInfo.baseName();

counter++;

if (fileInfo.fileName().mid( 0, 8) == "AVHR_xxx" && fileInfo.fileName().mid( 67, 4) == ".bz2" && fileInfo.isFile()) // EPS-10
Expand Down Expand Up @@ -496,7 +498,7 @@ void AVHRRSatellite::getFilenameParameters(int geosatindex, QString filename, Q
filenbr = filename.mid(opts.geosatellites.at(geosatindex).indexfilenbr, opts.geosatellites.at(geosatindex).lengthfilenbr).toInt();
strdate = filename.mid(opts.geosatellites.at(geosatindex).indexdate, opts.geosatellites.at(geosatindex).lengthdate);

if( opts.geosatellites.at(geosatindex).shortname == "GOES_16" ) //convert YYYYDDDHHmm to YYYYMMDDHHmm
if( opts.geosatellites.at(geosatindex).shortname == "GOES_16" || opts.geosatellites.at(geosatindex).shortname == "GOES_17" ) //convert YYYYDDDHHmm to YYYYMMDDHHmm
{
QDate fdate = QDate(strdate.mid(0, 4).toInt(), 1, 1).addDays(strdate.mid(4, 3).toInt() - 1);
strdate = fdate.toString("yyyyMMdd") + strdate.mid(7, 4);
Expand Down Expand Up @@ -781,8 +783,8 @@ void AVHRRSatellite::ReadDirectories(QDate seldate, int hoursbefore)


fileinfolist = map.values();
for(int i = 0; i < fileinfolist.count(); i++)
qDebug() << "map values = " << fileinfolist.at(i).absoluteFilePath();
// for(int i = 0; i < fileinfolist.count(); i++)
// qDebug() << "map values = " << fileinfolist.at(i).absoluteFilePath();

emit signalResetProgressbar(fileinfolist.size(), (*its));

Expand Down Expand Up @@ -1142,7 +1144,7 @@ void AVHRRSatellite::InsertToMap(QFileInfoList fileinfolist, QMap<QString, QFile
}
//0123456789012345678901234567890123456789
//S3A_SL_1_RBT____20170212T114405_20170212T114705_20170212T135851_0179_014_180_1800_SVL_O_NR_002.zip
else if (fileinfo.fileName().mid( 0, 6) == "S3A_SL_1_RBT")
else if (fileinfo.fileName().mid( 0, 12) == "S3A_SL_1_RBT")
{
*sentinel3Tle = true;
QDate d(fileinfo.fileName().mid( 16, 4).toInt(), fileinfo.fileName().mid( 20, 2).toInt(), fileinfo.fileName().mid( 22, 2).toInt());
Expand Down
24 changes: 17 additions & 7 deletions core/datahubaccessmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,24 @@ void DatahubAccessManager::DownloadXML(QDate selectdate, eDatahub hub)

url = QUrl(strurl);
// HTTP Basic authentication header value: base64(username:password)
QString concatenated;
if(this->hub == HUBESA)
concatenated = opts.esauser + ":" + opts.esapassword;
else
concatenated = opts.eumetsatuser + ":" + opts.eumetsatpassword;
// QString concatenated;
// if(this->hub == HUBESA)
// concatenated = opts.esauser + ":" + opts.esapassword;
// else
// concatenated = opts.eumetsatuser + ":" + opts.eumetsatpassword;

QByteArray data = concatenated.toLocal8Bit().toBase64();
QString headerData = "Basic " + data;
// QByteArray data = concatenated.toLocal8Bit().toBase64();
// QString headerData = "Basic " + data;

QString concatenated;
concatenated = "hvanruys:china123";
// if(this->hub == HUBESA)
// concatenated = opts.esauser + ":" + opts.esapassword;
// else
// concatenated = opts.eumetsatuser + ":" + opts.eumetsatpassword;

QByteArray data = concatenated.toLocal8Bit().toBase64();
QString headerData = "Basic " + data;

QNetworkRequest request(url);
request.setRawHeader("Authorization", headerData.toLocal8Bit());
Expand Down
12 changes: 12 additions & 0 deletions core/dialogpreferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,9 @@
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Deleting the file 'GeoSatellites.ini' will recreate the file at startup with default values.</string>
</property>
Expand All @@ -1701,6 +1704,9 @@
<layout class="QHBoxLayout" name="horizontalLayout_26">
<item>
<widget class="QLabel" name="label_22">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>When adding or deleting geosatellites restart the program</string>
</property>
Expand All @@ -1721,13 +1727,19 @@
</item>
<item>
<widget class="QPushButton" name="btnAddGeoConfig">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnDeleteGeoConfig">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Delete</string>
</property>
Expand Down
8 changes: 5 additions & 3 deletions core/formgeostationary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FormGeostationary::FormGeostationary(QWidget *parent, SatelliteList *satlist, AV
segs = seglist;
sats = satlist;

qDebug() << "in constructor FormGeostationary";
qDebug() << "in constructor FormGeostationary opts.geosatellites.count() = " << opts.geosatellites.count();

for(int i = 0; i < opts.geosatellites.count(); i++)
{
Expand Down Expand Up @@ -280,7 +280,7 @@ void FormGeostationary::PopulateTreeGeo(int geoindex)
for(int i = 0; i < nbr_spectrum; i++)
{
strlist << QString("%1").arg(cnt_spectrum.at(i));
qDebug() << "cnt_spectrum " << i << " " << strlist;
//qDebug() << "cnt_spectrum " << i << " " << strlist;
}

newitem = new QTreeWidgetItem( widget, strlist, 0 );
Expand Down Expand Up @@ -818,8 +818,10 @@ void FormGeostationary::CreateGeoImagenetCDF(SegmentListGeostationary *sl, QStri

//OR_ABI-L1b-RadF-M4C01_G16_s20161811455312_e20161811500122_c20161811500175.nc
//01234567890123456789012345678901234567890123456789
if(whichgeo == eGeoSatellite::GOES_16 && (type == "VIS_IR" || type == "VIS_IR Color"))
if((whichgeo == eGeoSatellite::GOES_16) && (type == "VIS_IR" || type == "VIS_IR Color"))
filepattern = QString("OR_ABI-L1b-RadF-M????_G16_s") + filetiming + QString("*.nc");
else if((whichgeo == eGeoSatellite::GOES_17) && (type == "VIS_IR" || type == "VIS_IR Color"))
filepattern = QString("OR_ABI-L1b-RadF-M????_G17_s") + filetiming + QString("*.nc");
else
return;

Expand Down
18 changes: 9 additions & 9 deletions core/formimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ void FormImage::recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool>
memcpy(pixelsBlue + i * 550 * 5500, imageptrs->ptrBlue[i], 550 * 5500 * sizeof(quint16));
}
}
else if(sl->getKindofImage() == "VIS_IR Color" && sl->getGeoSatellite() == eGeoSatellite::GOES_16)
else if(sl->getKindofImage() == "VIS_IR Color" && (sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17))
{
pixelsRed = new quint16[npix];
pixelsGreen = new quint16[npix];
Expand Down Expand Up @@ -2064,7 +2064,7 @@ void FormImage::recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool>
pixelsRed = new quint16[npix];
memcpy(pixelsRed, imageptrs->ptrRed[0], npix * sizeof(quint16));
}
else if(sl->getKindofImage() == "VIS_IR" && (sl->getGeoSatellite() == eGeoSatellite::GOES_16 ))
else if(sl->getKindofImage() == "VIS_IR" && (sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17 ))
{
pixelsRed = new quint16[npix];
memcpy(pixelsRed, imageptrs->ptrRed[0], npix * sizeof(quint16));
Expand Down Expand Up @@ -2108,7 +2108,7 @@ void FormImage::recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool>
imageptrs->CLAHE(pixelsGreen, 5500, 5500, 0, 1023, 10, 10, 256, opts.clahecliplimit);
imageptrs->CLAHE(pixelsBlue, 5500, 5500, 0, 1023, 10, 10, 256, opts.clahecliplimit);
}
else if(sl->getKindofImage() == "VIS_IR Color" && sl->getGeoSatellite() == eGeoSatellite::GOES_16 )
else if(sl->getKindofImage() == "VIS_IR Color" && (sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17) )
{
ret = imageptrs->CLAHE(pixelsRed, 5424, 5424, 0, 1023, 16, 16, 256, opts.clahecliplimit);
qDebug() << QString("pixelsRed ret = %1").arg(ret);
Expand Down Expand Up @@ -2152,7 +2152,7 @@ void FormImage::recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool>
}
else if(sl->getGeoSatellite() == eGeoSatellite::FY2E || sl->getGeoSatellite() == eGeoSatellite::FY2G)
imageptrs->CLAHE(pixelsRed, 2288, 2288, 0, 255, 16, 16, 256, opts.clahecliplimit);
else if(sl->getGeoSatellite() == eGeoSatellite::GOES_16)
else if(sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17)
imageptrs->CLAHE(pixelsRed, 5424, 5424, 0, 1023, 16, 16, 256, opts.clahecliplimit);
else if(sl->getGeoSatellite() == eGeoSatellite::H8)
imageptrs->CLAHE(pixelsRed, 5500, 5500, 0, 1023, 10, 10, 256, opts.clahecliplimit);
Expand Down Expand Up @@ -2207,7 +2207,7 @@ void FormImage::recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool>
}
}
}
else if(sl->getKindofImage() == "VIS_IR Color" && sl->getGeoSatellite() == eGeoSatellite::GOES_16)
else if(sl->getKindofImage() == "VIS_IR Color" && (sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17))
{

for (int line = 0; line < 5424; line++)
Expand Down Expand Up @@ -2398,9 +2398,9 @@ void FormImage::recalculateCLAHE(QVector<QString> spectrumvector, QVector<bool>
}
}
}
else if(sl->getGeoSatellite() == eGeoSatellite::GOES_16)
else if(sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17)
{
qDebug() << "recalculate CLAHE ; VIS_IR and GOES_16 move to ptrImageGeostationary";
qDebug() << "recalculate CLAHE ; VIS_IR and GOES_16/_17 move to ptrImageGeostationary";

for (int line = 0; line < 5424; line++)
{
Expand Down Expand Up @@ -2536,7 +2536,7 @@ void FormImage::recalculateCLAHE1(QVector<QString> spectrumvector, QVector<bool>

}

if(sl->getGeoSatellite() == eGeoSatellite::GOES_16)
if(sl->getGeoSatellite() == eGeoSatellite::GOES_16 || sl->getGeoSatellite() == eGeoSatellite::GOES_17)
{
if(sl->getKindofImage() == "VIS_IR Color")
{
Expand Down Expand Up @@ -3527,7 +3527,7 @@ void FormImage::setupGeoOverlay(int geoindex)

if(lon_deg < 90.0 || lon_deg > -90.0)
{
if(opts.geosatellites.at(geoindex).shortname == "GOES_16")
if(opts.geosatellites.at(geoindex).shortname == "GOES_16" || opts.geosatellites.at(geoindex).shortname == "GOES_17")
{
pixconv.earth_to_fgf_(&sat, &lon_deg, &lat_deg, &scale_x, &offset_x, &scale_y, &offset_y, &sub_lon, &fgf_x, &fgf_y);
if(fgf_x >= 0 && fgf_x < opts.geosatellites.at(geoindex).imagewidth && fgf_y >= 0 && fgf_y < opts.geosatellites.at(geoindex).imageheight)
Expand Down
164 changes: 86 additions & 78 deletions core/formtoolbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ void FormToolbox::on_btnGeoColor_clicked()
ui->pbProgress->setMaximum(100);
else if(geoindex == (int)eGeoSatellite::H8)
ui->pbProgress->setMaximum(10+10+10);
else if(geoindex == (int)eGeoSatellite::GOES_16)
else if(geoindex == (int)eGeoSatellite::GOES_16 || geoindex == (int)eGeoSatellite::GOES_17)
ui->pbProgress->setMaximum(100);

onButtonColorHRV("VIS_IR Color");
Expand Down Expand Up @@ -2474,87 +2474,95 @@ void FormToolbox::onButtonColorHRV(QString type)
inversevector[ui->comboGeo16->currentIndex()-1] = ui->chkInverseGeo16->isChecked();
}
}
else if(geoindex == (int)eGeoSatellite::GOES_16 )
else if(geoindex == (int)eGeoSatellite::GOES_16 || geoindex == (int)eGeoSatellite::GOES_17 )
{
if(ui->comboGeo1->currentIndex() > 0)
{
spectrumvector[ui->comboGeo1->currentIndex()-1] = "C01";
inversevector[ui->comboGeo1->currentIndex()-1] = ui->chkInverseGeo1->isChecked();
}
if(ui->comboGeo2->currentIndex() > 0)
{
spectrumvector[ui->comboGeo2->currentIndex()-1] = "C02";
inversevector[ui->comboGeo2->currentIndex()-1] = ui->chkInverseGeo2->isChecked();
}
if(ui->comboGeo3->currentIndex() > 0)
{
spectrumvector[ui->comboGeo3->currentIndex()-1] = "C03";
inversevector[ui->comboGeo3->currentIndex()-1] = ui->chkInverseGeo3->isChecked();
}
if(ui->comboGeo4->currentIndex() > 0)
{
spectrumvector[ui->comboGeo4->currentIndex()-1] = "C04";
inversevector[ui->comboGeo4->currentIndex()-1] = ui->chkInverseGeo4->isChecked();
}
if(ui->comboGeo5->currentIndex() > 0)
{
spectrumvector[ui->comboGeo5->currentIndex()-1] = "C05";
inversevector[ui->comboGeo5->currentIndex()-1] = ui->chkInverseGeo5->isChecked();
}
if(ui->comboGeo6->currentIndex() > 0)
if(ui->rdbPseudoColor->isChecked())
{
spectrumvector[ui->comboGeo6->currentIndex()-1] = "C06";
inversevector[ui->comboGeo6->currentIndex()-1] = ui->chkInverseGeo6->isChecked();
spectrumvector.clear();
spectrumvector << "C02" << "C03" << "C01";
}
if(ui->comboGeo7->currentIndex() > 0)
{
spectrumvector[ui->comboGeo7->currentIndex()-1] = "C07";
inversevector[ui->comboGeo7->currentIndex()-1] = ui->chkInverseGeo7->isChecked();
}
if(ui->comboGeo8->currentIndex() > 0)
{
spectrumvector[ui->comboGeo8->currentIndex()-1] = "C08";
inversevector[ui->comboGeo8->currentIndex()-1] = ui->chkInverseGeo8->isChecked();
}
if(ui->comboGeo9->currentIndex() > 0)
{
spectrumvector[ui->comboGeo9->currentIndex()-1] = "C09";
inversevector[ui->comboGeo9->currentIndex()-1] = ui->chkInverseGeo9->isChecked();
}
if(ui->comboGeo10->currentIndex() > 0)
{
spectrumvector[ui->comboGeo10->currentIndex()-1] = "C10";
inversevector[ui->comboGeo10->currentIndex()-1] = ui->chkInverseGeo10->isChecked();
}
if(ui->comboGeo11->currentIndex() > 0)
{
spectrumvector[ui->comboGeo11->currentIndex()-1] = "C11";
inversevector[ui->comboGeo11->currentIndex()-1] = ui->chkInverseGeo11->isChecked();
}
if(ui->comboGeo12->currentIndex() > 0)
{
spectrumvector[ui->comboGeo12->currentIndex()-1] = "C12";
inversevector[ui->comboGeo12->currentIndex()-1] = ui->chkInverseGeo12->isChecked();
}
if(ui->comboGeo13->currentIndex() > 0)
{
spectrumvector[ui->comboGeo13->currentIndex()-1] = "C13";
inversevector[ui->comboGeo13->currentIndex()-1] = ui->chkInverseGeo13->isChecked();
}
if(ui->comboGeo14->currentIndex() > 0)
{
spectrumvector[ui->comboGeo14->currentIndex()-1] = "C14";
inversevector[ui->comboGeo14->currentIndex()-1] = ui->chkInverseGeo14->isChecked();
}
if(ui->comboGeo15->currentIndex() > 0)
{
spectrumvector[ui->comboGeo15->currentIndex()-1] = "C15";
inversevector[ui->comboGeo15->currentIndex()-1] = ui->chkInverseGeo15->isChecked();
}
if(ui->comboGeo16->currentIndex() > 0)
else
{
spectrumvector[ui->comboGeo16->currentIndex()-1] = "C16";
inversevector[ui->comboGeo16->currentIndex()-1] = ui->chkInverseGeo16->isChecked();
if(ui->comboGeo1->currentIndex() > 0)
{
spectrumvector[ui->comboGeo1->currentIndex()-1] = "C01";
inversevector[ui->comboGeo1->currentIndex()-1] = ui->chkInverseGeo1->isChecked();
}
if(ui->comboGeo2->currentIndex() > 0)
{
spectrumvector[ui->comboGeo2->currentIndex()-1] = "C02";
inversevector[ui->comboGeo2->currentIndex()-1] = ui->chkInverseGeo2->isChecked();
}
if(ui->comboGeo3->currentIndex() > 0)
{
spectrumvector[ui->comboGeo3->currentIndex()-1] = "C03";
inversevector[ui->comboGeo3->currentIndex()-1] = ui->chkInverseGeo3->isChecked();
}
if(ui->comboGeo4->currentIndex() > 0)
{
spectrumvector[ui->comboGeo4->currentIndex()-1] = "C04";
inversevector[ui->comboGeo4->currentIndex()-1] = ui->chkInverseGeo4->isChecked();
}
if(ui->comboGeo5->currentIndex() > 0)
{
spectrumvector[ui->comboGeo5->currentIndex()-1] = "C05";
inversevector[ui->comboGeo5->currentIndex()-1] = ui->chkInverseGeo5->isChecked();
}
if(ui->comboGeo6->currentIndex() > 0)
{
spectrumvector[ui->comboGeo6->currentIndex()-1] = "C06";
inversevector[ui->comboGeo6->currentIndex()-1] = ui->chkInverseGeo6->isChecked();
}
if(ui->comboGeo7->currentIndex() > 0)
{
spectrumvector[ui->comboGeo7->currentIndex()-1] = "C07";
inversevector[ui->comboGeo7->currentIndex()-1] = ui->chkInverseGeo7->isChecked();
}
if(ui->comboGeo8->currentIndex() > 0)
{
spectrumvector[ui->comboGeo8->currentIndex()-1] = "C08";
inversevector[ui->comboGeo8->currentIndex()-1] = ui->chkInverseGeo8->isChecked();
}
if(ui->comboGeo9->currentIndex() > 0)
{
spectrumvector[ui->comboGeo9->currentIndex()-1] = "C09";
inversevector[ui->comboGeo9->currentIndex()-1] = ui->chkInverseGeo9->isChecked();
}
if(ui->comboGeo10->currentIndex() > 0)
{
spectrumvector[ui->comboGeo10->currentIndex()-1] = "C10";
inversevector[ui->comboGeo10->currentIndex()-1] = ui->chkInverseGeo10->isChecked();
}
if(ui->comboGeo11->currentIndex() > 0)
{
spectrumvector[ui->comboGeo11->currentIndex()-1] = "C11";
inversevector[ui->comboGeo11->currentIndex()-1] = ui->chkInverseGeo11->isChecked();
}
if(ui->comboGeo12->currentIndex() > 0)
{
spectrumvector[ui->comboGeo12->currentIndex()-1] = "C12";
inversevector[ui->comboGeo12->currentIndex()-1] = ui->chkInverseGeo12->isChecked();
}
if(ui->comboGeo13->currentIndex() > 0)
{
spectrumvector[ui->comboGeo13->currentIndex()-1] = "C13";
inversevector[ui->comboGeo13->currentIndex()-1] = ui->chkInverseGeo13->isChecked();
}
if(ui->comboGeo14->currentIndex() > 0)
{
spectrumvector[ui->comboGeo14->currentIndex()-1] = "C14";
inversevector[ui->comboGeo14->currentIndex()-1] = ui->chkInverseGeo14->isChecked();
}
if(ui->comboGeo15->currentIndex() > 0)
{
spectrumvector[ui->comboGeo15->currentIndex()-1] = "C15";
inversevector[ui->comboGeo15->currentIndex()-1] = ui->chkInverseGeo15->isChecked();
}
if(ui->comboGeo16->currentIndex() > 0)
{
spectrumvector[ui->comboGeo16->currentIndex()-1] = "C16";
inversevector[ui->comboGeo16->currentIndex()-1] = ui->chkInverseGeo16->isChecked();
}
}
}

Expand Down
Loading

0 comments on commit e571ef1

Please sign in to comment.