DOI-USGS / ISIS3

Integrated Software for Imagers and Spectrometers v3. ISIS3 is a digital image processing software package to manipulate imagery collected by current and past NASA and International planetary missions.
https://isis.astrogeology.usgs.gov
Other
200 stars 168 forks source link

findFeaturesSegment.py script fixes #5565

Closed chkim-usgs closed 1 week ago

chkim-usgs commented 3 months ago

Description

The process to retrieve the from_segments in this line

from_segments = reduce(lambda d1,d2: {k: merge(d1, d2, k) for k in set(d1)|set(d2)}, output)

from a FROMLIST that contains only one cube outputs this format:

{ 'seg1': PVLGroup([...]), 'seg2': PVLGroup([...])}

so accessing each segment as a list caused a TypeError.

Added an if/else statement to account for img_list = 1 so from_segments ultimately outputs this:

{ 'seg1': [PVLGroup([...])], 'seg2': [PVLGroup([...])]}

To reduce redundant overlapping image pairs, I implemented an iteration of @Kelvinrr's generic code with the change in the way the segments are accessed.

Related Issue

Addresses https://github.com/DOI-USGS/ISIS3/issues/5489 & https://github.com/DOI-USGS/ISIS3/issues/5540

How Has This Been Validated?

Types of changes

Checklist:

Licensing

This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words:

This work is free and unencumbered software released into the public domain. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain.

lwellerastro commented 3 months ago

The updates were tested against post #5489 but did not produce a network when it should have. See comments there.

github-actions[bot] commented 3 months ago

The build and test suite have started for your pull request. View build logs for results.

github-actions[bot] commented 2 months ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

github-actions[bot] commented 2 months ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

github-actions[bot] commented 2 months ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

github-actions[bot] commented 2 months ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

github-actions[bot] commented 2 months ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

github-actions[bot] commented 2 months ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

Kelvinrr commented 2 months ago

~Lynn tested this locally and seem happy with the changes so I think this is good to go~

False alarm, Lynn still wants to test some more

lwellerastro commented 1 month ago

Despite observations made via open post #5540, I think the latest version of the script is worth releasing. It's a great improvement over prior versions and further attempts to find the most suitable use cases will be easier for a user to try with the updated script and xml (containing reference to the new workdir parameter). It's a little difficult testing because of the xml disconnect.

I think moving the segmented cub files from the working directory to /tmp (really not feasible due to NAC file sizes) or a specified workdir needs to be reverted, but that needs to be a new post. I think there is still an issue with creating a final network in some cases, but that needs another look and a new post.

Barring running the script on very large dataset with images having many, many overlaps, I think the script is doing what it should better than before and could be useful for specific use cases. It would be nice to have access to the updates in the latest release if you all agree.

github-actions[bot] commented 1 week ago

The build and test suite have started for your pull request.

To view your build log, please reference the build with source version: "PR_5565".

Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch.

chkim-usgs commented 1 week ago

@Kelvinrr Build looks good, test failures match dev's.