Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map2cam with multiband level0 image #3856

Closed
lavalaz opened this issue May 1, 2020 · 7 comments
Closed

map2cam with multiband level0 image #3856

lavalaz opened this issue May 1, 2020 · 7 comments
Assignees
Labels
bug Something isn't working Products Issues which are impacting the products group

Comments

@lavalaz
Copy link

lavalaz commented May 1, 2020

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

Description

Attached error message when using band N as the match in map2cam, where N is greater than 1

How to reproduce

  • ingest LROC WAC image
  • run spiceinit
  • run map2cam to match a map/mosaic to the unprojected WAC image
  • qview will show that output is aligned with the first band but not with the subsequent bands
  • rerun map2cam with the +2 (or more) after the WAC image so the map will align with band 2 (or later).
  • get error message

Possible Solution

Note: map projecting the WAC image to match the map is not an option for me because I need the statistical distribution of DN values of the WAC image to be strictly preserved. Yes, NN interpolation will keep the DN values fixed, but the number of pixels with a given DN value will be altered.

Additional context

image

@rbeyer
Copy link
Contributor

rbeyer commented May 1, 2020

* qview will show that output is aligned with the first band but not with the subsequent bands

So are you saying that map2cam only 'unprojects' the first band of a multiband image, and not the others? Wild.

Although this requires an extra step, you could use the ISIS explode command to take your multi-band map-projected image and convert it into a pile of individual, 1-band cubes, and then map2cam just the one you need. But if you need all of them, that's inconvenient (but could be scripted!).

@lavalaz
Copy link
Author

lavalaz commented May 1, 2020

Not exactly - the level0 cub is the one with multiple bands - and the geometry associated with each band is different. cam2map uses the geometry from the first band without giving me a way to use the geometry from other bands. Running 'explode' on the level0 cub will work but there is a geometric progression in the number of filenames I need to track in the script and expanding by a factor of 5 this early in the process means I probably need a script to write the script.

@jessemapel jessemapel changed the title cam2map with multiband level0 image map2cam with multiband level0 image May 3, 2020
@jessemapel
Copy link
Contributor

This looks like an issue where map2cam wants to set the physical band and the LROWAC sensor model wants to set the virtual band. Physical bands are the actual bands in the file and virtual bands are how many bands are you using. So, if your LROWAC image has 5 actual bands and you specify .cub+3 it will have 5 physical bands and 1 virtual band.

The band change function in the sensor model expects virtual bands, but the band change function in map2cam converts virtual bands to physical bands. I'm not sure which is correct. We need to check all of the band-dependent sensor models and see if they expect physical bands or virtual bands in their band change function.

@lavalaz
Copy link
Author

lavalaz commented May 3, 2020

Tried to use explode to get single band images. No joy - see new ticket...

@jessemapel
Copy link
Contributor

@lavalaz Can you specify which new ticket?

@jessemapel jessemapel added the bug Something isn't working label May 4, 2020
@jlaura
Copy link
Collaborator

jlaura commented May 12, 2020

#3858

@jlaura jlaura added the Products Issues which are impacting the products group label May 12, 2020
@Kelvinrr Kelvinrr self-assigned this Sep 3, 2020
@Kelvinrr
Copy link
Collaborator

Kelvinrr commented Sep 8, 2020

@lavalaz that error seems to be an issue with map2cam not correctly using virtual bands, after applying the virtual bands map2cam attempts to use physical downstream. This means the image effectively has one band, therefore, if you attempt to use a band number greater than 2, you get that error.

I'll try to verify this for a bit then PR in the change, but this fix should make it possible to process bands separately as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Products Issues which are impacting the products group
Projects
None yet
Development

No branches or pull requests

5 participants