Skip to content

Commit

Permalink
Lro lidar infrastructure updated to fix ambiguity with global variabl…
Browse files Browse the repository at this point in the history
…e proj and merge of dev into branch (#3145)

* Updated the cmake version to 3.10

* Adding configurations for gtest

* Tweaking things for gtest

* Got gtest working and made a small example test

* Updated the cmake version to be 3.10 or greater

* Added test file discovery support and seperated the main into another file

* Added more tests for FileName

* Updated with the new testing guidelines and added new tests.

* Added gmock

* PixelTest (#536)

* initial Pixel test

* Add more test cases for Pixel

* testing parameterization in Pixel test

* testing function parameterization

* parameterize static vs object methods

* basic PixelTests implementation

* clean up and more static tests

* update PixelTests with float/dbl expects

* Refactored stats to a functions

* Modified to have cubeit remove mosaic pixel tracking info from labels. Fixes #5533

* Update cubeit.xml

Fixed a typo

* Fixes conda channels in Jenkinsfile & adds a MacOS node (#633)

* Merged dev and cleaned up header conflicts

* Update for #619.

* Fix libtiff dependency (#636) (#644)

* Upgrade libtiff to 4.0.10 (#636)

* Switch libtiff to 4.0.9 or higher to remove geotiff conflict

* Moved ISIS3 conda-build recipe from ISIS3_deps repository (#650)

* Fixed warning in Pixel unit tests

* Removing build numbers from external libraries (#660)

* Moved ISIS3 conda-build recipe from ISIS3_deps repository

* Un-pinned non-astro build numbers

* Removing build numbers from external libraries in the environment and meta.yeml files

* Final merging

* Added pixel type attribute to the output image of program shadow. Fixes #5187 (#659)

* Removed bolding of some text to decrease distraction.

* Fixed some typos.

* Reworded documentation.

* Added section for Environment and PreferemcesSetup in the Getting Started Section. (#663)

* Updated .gitmodules to use https rather than ssh (#673)

* Added build type release to conda recipe (#676)

* Updates README with Discourse (#690)

* Updates README with Discourse

* Update README.md

* Update README.md

* Added fix to Spice Server to accept clients with version nums >=3.5.*.* (#780)

* Fixed error when trying to export a compressed image using pds2hideal. Fixes #5525. (#2059)

* Added capability to export a compressed image with tables missing RECORD_BYTES keyword. Added test for compressed image.

* Changed names of test output cubes.

* Adding explanatory comments to the meta.yaml file (#2358)

* Adding explanatory comments to the recipes/meta.yaml

* Replacing accidentally erased line

* Added option to sort the output for consistent order in testing and added a test case

* Cleaned up commented out lines in LidarData.h and .cpp

* Added additional documentation for LidarData, LidarControlPoint, and lrolola2isis

* Multisegment DSK support for Bullet engine (#2791)

* Merged multisegment DSKs for Bullet

* basic tests

* removed original tests

* Minor updates to download sizes and some text. (#2790)

* Removed debug lines from LidarData.cpp and old comments from the lrolola2isis twoImage test

* Added an additional comment about the Test format to LidarData.cpp

* Phocube will export RA and declination planes even if the point is not on the planet. Fixes #4446 (#657)

* Made it so that RA and Dec are added last.

* Updated code to be up to standards.

* Added RA and dec test.

* Updated history comment.

* Renamed test.

* Fixed typo in documentation

* Refactored code so that RA and dec are placed in the correct bands instead of moving them to the last two bands.

* Updated documentation, test now checks cube label.

* Fixed SummingMode keyword being set in tgocassis2isis  (#2847)

* Adding Expanded keyword to cassis label and modifying SummingMode keyword

* Updating the window count value

* Adding capacity to handle imports without Expanded tag

* Setting tgocassismos to have tracking turned-on (#2856)

* Adding parameter "tracking=true" to tgocassismos call to automos

* Adding documentation

* Fixing indentation in documentation

* Updates to tgocassisrdrgen and ProcessExportPds4 to add content to exported CaSSIS Label. (#2858)

* Add 32-bit ISIS Special Pixel Constants to ProcessExportPds4

* Add ability to set title and version id in exported PDS4 produce in tgocassisrdrgen and ProcessExportPds4 API

* Fix bug that occurs when exporting mosaics with Archive groups and fixed min/max lat/lon to east/west bounding box positive east flip bug

* Added docs.

* Update schema to most recent versions and comment-out schema that isn't used (temporarily) in tgocassisrdrgen.

* Adds Issue Templates to Issues (#664)

* Adds issue templates

* Verbage update

* Updates issue template for questions (#3131)

Removed a newline in the header that I believe was causing the automatic template detection to fail.

* Added gtest for ID and split TestUtilities into a cpp and h file to fix duplicate symbol error when building. (#2824)

Code reviewed and tested

* tgocassisrdrgen exported label re-order.  (#3135)

* Add 32-bit ISIS Special Pixel Constants to ProcessExportPds4

* Add ability to set title and version id in exported PDS4 produce in tgocassisrdrgen and ProcessExportPds4 API

* Fix bug that occurs when exporting mosaics with Archive groups and fixed min/max lat/lon to east/west bounding box positive east flip bug

* Added docs.

* Update schema to most recent versions and comment-out schema that isn't used (temporarily) in tgocassisrdrgen.

* Added reorder function to ProcessExportPds4 to reorder xml files generated in the wrong order for PDS4 and added cassis-specific schema

* Update label generated by tgocassisrdrgen from additional feedback (#3137)

* Add 32-bit ISIS Special Pixel Constants to ProcessExportPds4

* Add ability to set title and version id in exported PDS4 produce in tgocassisrdrgen and ProcessExportPds4 API

* Fix bug that occurs when exporting mosaics with Archive groups and fixed min/max lat/lon to east/west bounding box positive east flip bug

* Added docs.

* Update schema to most recent versions and comment-out schema that isn't used (temporarily) in tgocassisrdrgen.

* Added reorder function to ProcessExportPds4 to reorder xml files generated in the wrong order for PDS4 and added cassis-specific schema

* Add StopTime to tgocassismos's Mosaic PVL group, as it is required for PDS4 export. Also, fix time formatting and east_azimuth units

* Remove comment

* Changed global variable proj back to projection to avoid build ambiguity errors with the std::proj
  • Loading branch information
dcookastro authored and kledmundson committed Mar 6, 2019
1 parent b130ce7 commit 7b24c75
Show file tree
Hide file tree
Showing 14 changed files with 345 additions and 51 deletions.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🐛 Bug Report
about: Report errors and problems

---

**ISIS version(s) affected**: x.y.z

**Description**
<!-- A clear and concise description of the problem. -->

**How to reproduce**
<!-- Code and/or config needed to reproduce the problem. -->

**Possible Solution**
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->

**Additional context**
<!-- Optional: any other context about the problem: log messages, screenshots, etc. -->
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/2_Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: 🚀 Feature Request
about: RFC and ideas for new features and improvements

---

**Description**
<!-- A clear and concise description of the new feature. -->

**Example**
<!-- A simple example of the new feature in action (include code, links to necessary data, etc.)
If the new feature changes an existing feature, include a simple before/after comparison. -->

11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/3_Support_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: ⛔ Support Question
about: See https://astrodiscuss.usgs.gov for questions about using ISIS3 and other Astrogeology Science Center software.

---

We use GitHub issues only to discuss about ISIS3 bugs and new features. For
questions about using ISIS3 or other ASC software, please use
any of the support alternatives: https://astrodiscuss.usgs.gov or https://gitter.im/USGS-Astrogeology/IAA

Thanks!
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/4_Documentation_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: ⛔ Documentation Issue
about: Report issues or problems with documentation.

---

**Description**
<!-- A clear and concise description of the problem. -->

**Suggested Edit**
<!--- Optional: only if you have suggestions on a fix for the documentation -->

Thanks!
6 changes: 3 additions & 3 deletions isis/src/base/apps/phocube/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void phocube(Buffer &out) {
}
if (latitude) {
if (noCamera) {
out[index] = proj->UniversalLatitude();
out[index] = projection->UniversalLatitude();
}
else {
out[index] = cam->UniversalLatitude();
Expand All @@ -419,7 +419,7 @@ void phocube(Buffer &out) {
}
if (longitude) {
if (noCamera) {
out[index] = proj->UniversalLongitude();
out[index] = projection->UniversalLongitude();
}
else {
out[index] = cam->UniversalLongitude();
Expand All @@ -428,7 +428,7 @@ void phocube(Buffer &out) {
}
if (pixelResolution) {
if (noCamera) {
out[index] = proj->Resolution();
out[index] = projection->Resolution();
}
else {
out[index] = cam->PixelResolution();
Expand Down
5 changes: 5 additions & 0 deletions isis/src/base/apps/phocube/phocube.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ xsi:noNamespaceSchemaLocation=
<change name="Kaitlyn Lee" date="2019-02-15">
Allowed RA and DEC to be exported regardless if the pixel is off body. Fixes #4446.
</change>
<change name="Debbie A. Cook" date="2019-03-06">
Changed global variable name proj to projection, as Jesse Maple had done for the
Piecewise branch, due to a conflict with the std complex library and includes used in
piecewise branch. References #5343.
</change>
</history>

<category>
Expand Down
115 changes: 111 additions & 4 deletions isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ namespace Isis {
QString timeValue = stopTime.text();
PvlToXmlTranslationManager::resetElementValue(stopTime, timeValue + "Z");
}

}

QDomElement obsSysNode = obsAreaNode.firstChildElement("Observing_System");
Expand Down Expand Up @@ -277,26 +276,116 @@ namespace Isis {
// move target to just below Observing_System.
QDomElement targetIdNode = obsAreaNode.firstChildElement("Target_Identification");
obsAreaNode.insertAfter(targetIdNode, obsAreaNode.firstChildElement("Observing_System"));

}
else if (inputLabel->findObject("IsisCube").hasGroup("Mapping")) {

translationFileName = "$base/translations/pds4ExportTargetFromMapping.trn";
PvlToXmlTranslationManager targXlator(*inputLabel, translationFileName.expanded());
targXlator.Auto(*m_domDoc);

}
else {
throw IException(IException::Unknown, "Unable to find a target in input cube.", _FILEINFO_);
}
}


/**
* This method reorders the existing m_domDoc to follow PDS4 standards and fixes time formatting
* if needed.
*/
void ProcessExportPds4::reorder() {
QDomElement obsAreaNode = m_domDoc->documentElement().firstChildElement("Observation_Area");
if ( !obsAreaNode.isNull() ) {

// fix times
QDomElement timeNode = obsAreaNode.firstChildElement("Time_Coordinates");
if (!timeNode.isNull()) {
QDomElement startTime = timeNode.firstChildElement("start_date_time");
if (startTime.text() == "") {
startTime.setAttribute("xsi:nil", "true");
}
else {
QString timeValue = startTime.text();
PvlToXmlTranslationManager::resetElementValue(startTime, timeValue + "Z");
}
QDomElement stopTime = timeNode.firstChildElement("stop_date_time");
if (stopTime.text() == "") {
stopTime.setAttribute("xsi:nil", "true");
}
else {
QString timeValue = stopTime.text();
PvlToXmlTranslationManager::resetElementValue(stopTime, timeValue + "Z");
}

QStringList xmlPath;
xmlPath << "Product_Observational"
<< "Observation_Area"
<< "Discipline_Area"
<< "geom:Geometry"
<< "geom:Geometry_Orbiter"
<< "geom:geometry_reference_time_utc";

QDomElement baseElement = m_domDoc->documentElement();
QDomElement geomRefTime = getElement(xmlPath, baseElement);
if (geomRefTime.text() == "") {
geomRefTime.setAttribute("xsi:nil", "true");
}
else {
QString timeValue = geomRefTime.text();
PvlToXmlTranslationManager::resetElementValue(geomRefTime, timeValue + "Z");
}
xmlPath.clear();
xmlPath << "Product_Observational"
<< "Observation_Area"
<< "Discipline_Area"
<< "geom:Geometry"
<< "geom:Image_Display_Geometry"
<< "geom:Object_Orientation_North_East"
<< "geom:east_azimuth";
QDomElement eastAzimuth = getElement(xmlPath, baseElement);
if (eastAzimuth.text() != "") {
PvlToXmlTranslationManager::resetElementValue(eastAzimuth, eastAzimuth.text(), "deg");
}
}

QDomElement investigationAreaNode = obsAreaNode.firstChildElement("Investigation_Area");
obsAreaNode.insertAfter(investigationAreaNode, obsAreaNode.firstChildElement("Time_Coordinates"));

QDomElement obsSystemNode = obsAreaNode.firstChildElement("Observing_System");
obsAreaNode.insertAfter(obsSystemNode, obsAreaNode.firstChildElement("Investigation_Area"));

QDomElement targetIdNode = obsAreaNode.firstChildElement("Target_Identification");
obsAreaNode.insertAfter(targetIdNode, obsAreaNode.firstChildElement("Observing_System"));

QDomElement missionAreaNode = obsAreaNode.firstChildElement("Mission_Area");
obsAreaNode.insertAfter(missionAreaNode, obsAreaNode.firstChildElement("Target_Identification"));

QDomElement disciplineAreaNode = obsAreaNode.firstChildElement("Discipline_Area");
obsAreaNode.insertAfter(disciplineAreaNode, obsAreaNode.firstChildElement("Mission_Area"));
}

QDomElement identificationAreaNode = m_domDoc->documentElement().firstChildElement("Identification_Area");
if ( !identificationAreaNode.isNull() ) {
QDomElement aliasListNode = identificationAreaNode.firstChildElement("Alias_List");
identificationAreaNode.insertAfter(aliasListNode, identificationAreaNode.firstChildElement("product_class"));
}

QDomElement fileAreaObservationalNode = m_domDoc->documentElement().firstChildElement("File_Area_Observational");
QDomElement array2DImageNode = fileAreaObservationalNode.firstChildElement("Array_2D_Image");
if ( !array2DImageNode.isNull() ) {
QDomElement descriptionNode = array2DImageNode.firstChildElement("description");
array2DImageNode.insertAfter(descriptionNode, array2DImageNode.firstChildElement("axis_index_order"));
}
}

/**
* Allows mission specific programs to set logical_identifier
* required for PDS4 labels. This value is added to the xml file
* by the identificationArea() method.
*
* The input value will be converted to all-lowercase if not already
* in line with PDS4 requirements.
*
* The input string should be colon separated string with 6
* identifiers:
*
Expand All @@ -318,7 +407,25 @@ namespace Isis {
* compliant labels.
*/
void ProcessExportPds4::setLogicalId(QString lid) {
m_lid = lid;
m_lid = lid.toLower();
}


/**
* Allows mission specific programs to set version_id
* required for PDS4 labels. This value is added to the xml file
* by the identificationArea() method.
*
* The input string should be colon separated string with 6
* identifiers:
*
* @author 2019-03-01 Kristin Berry
*
* @param versiondId The version_id value required for PDS4
* compliant labels.
*/
void ProcessExportPds4::setVersionId(QString versionId) {
m_versionId = versionId;
}


Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/ProcessExportPds4/ProcessExportPds4.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace Isis {

static void translateUnits(QDomDocument &label,
QString transMapFile = "$base/translations/pds4ExportUnits.pvl");

void reorder();
void addSchema(QString sch, QString xsd, QString xmlns, QString xmlnsURI) ;
protected:
void identificationArea();
Expand Down
23 changes: 18 additions & 5 deletions isis/src/tgo/apps/tgocassismos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "ProgramLauncher.h"
#include "TProjection.h"
#include "UserInterface.h"

#include "iTime.h"

using namespace std;
using namespace Isis;
Expand Down Expand Up @@ -170,6 +170,8 @@ void IsisMain() {
QString instrumentId;
QString spacecraftName;
QString observationId;
QString stopTime;
QString exposureDuration;

for (int i = 0; i < (int)cubeList.size(); i++) {
// himos used original label here.
Expand All @@ -184,17 +186,27 @@ void IsisMain() {
observationId = archiveGroup["ObservationId"][0];
startTime = instGroup["StartTime"][0];
startClock = instGroup["SpacecraftClockStartCount"][0];
stopTime = instGroup["StartTime"][0];
exposureDuration = instGroup["ExposureDuration"][0];
}
else {
QString testStartTime = instGroup["StartTime"][0];
if (testStartTime < startTime) {
startTime = testStartTime;
iTime testStartTime = iTime(instGroup["StartTime"][0]);
iTime testStopTime = iTime(instGroup["StartTime"][0]);
if (testStartTime < iTime(startTime)) {
startTime = testStartTime.UTC();
startClock = instGroup["SpacecraftClockStartCount"][0];
}
if (testStopTime > iTime(stopTime)) {
stopTime = testStopTime.UTC();
}
}
}

// Get the blob of original labels from first image in list
iTime stopTimeValue = iTime(stopTime);
stopTimeValue = stopTimeValue + exposureDuration.toDouble();
stopTime = stopTimeValue.UTC();

// Get the blob of original labels from first image in list
// Pvl *org = cubeList[0]->label();

//close all cubes
Expand Down Expand Up @@ -230,6 +242,7 @@ void IsisMain() {
mos += PvlKeyword("InstrumentId", instrumentId);
mos += PvlKeyword("ObservationId ", observationId);
mos += PvlKeyword("StartTime ", startTime);
mos += PvlKeyword("StopTime ", stopTime);
mos += PvlKeyword("SpacecraftClockStartCount ", startClock);
mos += PvlKeyword("IncidenceAngle ", toString(incidenceAngle), "degrees");
mos += PvlKeyword("EmissionAngle ", toString(emissionAngle), "degrees");
Expand Down
4 changes: 4 additions & 0 deletions isis/src/tgo/apps/tgocassismos/tgocassismos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
Added the "tracking=true" parameter to tgocassismos' call to automos resulting in automatic
tracking cube creation.
</change>
<change name="Kristin Berry" date="2019-03-01">
Added the StopTime keyword to the output Mosaic PVL group, as stop_date_time is required for
PDS4 export.
</change>
</history>

<groups>
Expand Down
6 changes: 5 additions & 1 deletion isis/src/tgo/apps/tgocassisrdrgen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ void IsisMain() {
"xmlns",
"http://psa.esa.int/psa/em16/cas/v1");*/

process.addSchema("CASSIS_1010.sch",
"CASSIS_1010.xsd",
"xmlns:cassis",
"local");
// Add geometry schema for mosaics
if (label->findObject("IsisCube").hasGroup("Mosaic")) {
process.addSchema("PDS4_GEOM_1B00_1610.sch",
Expand All @@ -117,7 +121,6 @@ void IsisMain() {
"https://pds.jpl.nasa.gov/datastandards/schema/released/geom/v1");
}


/*
* Add additional pds label data here
*/
Expand All @@ -135,6 +138,7 @@ void IsisMain() {
cubeLab.Auto(pdsLabel);

ProcessExportPds4::translateUnits(pdsLabel);
process.reorder();

QString outFile = ui.GetFileName("TO");

Expand Down
Loading

0 comments on commit 7b24c75

Please sign in to comment.