Skip to content
Snippets Groups Projects
Unverified Commit 3ecfce3c authored by Shin-ya Murakami's avatar Shin-ya Murakami Committed by GitHub
Browse files

Fix detached label support for kaguyasp2ascii (#5607)

* Fixed kaguyasp2ascii with detached label data input

- Fixed condition to check whether input file is attached label or detached label.
- Fixed input file specification outside current directory for detached label case

* Updated changelog

* Updated creaters
parent af8874bd
No related branches found
No related tags found
Loading
...@@ -336,6 +336,10 @@ ...@@ -336,6 +336,10 @@
{ {
"name": "Miller-Ribelin, Elizabeth" "name": "Miller-Ribelin, Elizabeth"
}, },
{
"affiliation": "Japan Aerospace Exploration Agency, Institute of Space and Astronautical Science",
"name": "Murakami, Shin-ya",
"orcid": "0000-0002-7137-4849"
{ {
"affiliation": "United States Geological Survey, Astro Geology Science Center", "affiliation": "United States Geological Survey, Astro Geology Science Center",
"name": "Nelson, Gavin" "name": "Nelson, Gavin"
......
...@@ -35,6 +35,10 @@ release. ...@@ -35,6 +35,10 @@ release.
## [Unreleased] ## [Unreleased]
### Fixed
- Fixed a bug in kaguyasp2isis that doesn't work for data with a detached label.
## [8.3.0] - 2024-08-16 ## [8.3.0] - 2024-08-16
### Added ### Added
......
...@@ -11,6 +11,7 @@ find files of those names at the top level of this repository. **/ ...@@ -11,6 +11,7 @@ find files of those names at the top level of this repository. **/
#include <bitset> #include <bitset>
#include <cstdio> #include <cstdio>
#include <QString> #include <QString>
#include <QDir>
#include "ProcessImportPds.h" #include "ProcessImportPds.h"
...@@ -32,12 +33,20 @@ void IsisMain() { ...@@ -32,12 +33,20 @@ void IsisMain() {
// Detached labels use format keyword = "dataFile" value <unit> // Detached labels use format keyword = "dataFile" value <unit>
int keywordIndex = 1; int keywordIndex = 1;
if (FileName(inFile).baseName() == FileName(dataFile).baseName()){ // Determine label for inFile is attached label or detached label
// data files usually do not include path information. If input basename matches datafile basename, include path information if (FileName(inFile).name() == FileName(dataFile).name()){
// this allows users to specify data that is not in the current directory. // If input filename matches datafile filename without path information,
// one assumes label file for inFile is attached label, otherwise
// detached label.
dataFile = inFile; dataFile = inFile;
// Attached labels use format keyword = value <units> // Attached labels use format keyword = value <units>
keywordIndex = 0; keywordIndex = 0;
} else {
// data files specification in label usually do not include path
// information. If label is detached label, data file is located at
// the same directory as label file.
// this allows users to specify data that is not in the current directory.
dataFile = FileName(inFile).dir().path() + "/" + dataFile;
} }
ofstream os; ofstream os;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment