Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

sampleprojectionoffset negated and 1 pixel shifted #19

Open
thareUSGS opened this issue May 21, 2020 · 1 comment
Open

sampleprojectionoffset negated and 1 pixel shifted #19

thareUSGS opened this issue May 21, 2020 · 1 comment

Comments

@thareUSGS
Copy link
Member

thareUSGS commented May 21, 2020

sampleprojectionoffset = PUnits((-0.5 + (-1 * ULX.value / mapscale_x)), 'PIXELS')

I am pretty sure this output sampleprojectionoffset is being computed incorrectly here, but It would be good to get another set of eyes on it. The fix appears to be simply removing the negation as shown in the code below (which also helps with the 0.5 shift to be subtracted in the correct direction).

    sampleprojectionoffset = PUnits((-0.5 + (ULX.value / mapscale_x)), 'PIXELS')
elif isinstance(ULX, (int, float)):
    sampleprojectionoffset = PUnits((-0.5 + (ULX / mapscale_x)), 'PIXELS')

UPDATE - ignore this change

@thareUSGS
Copy link
Member Author

thareUSGS commented May 21, 2020

Ahh - I think I found the issue. There should be no need to negate the mapscale_x . That is not impacted by East/West longitude system. Since this was only impacting images which were West, we didn't run into the problem.

For testing check out. Callisto_Voyager_GalileoSSI_global_mosaic_1km.lbl
https://astrogeology.usgs.gov/search/map/Callisto/Voyager-Galileo/Callisto_Voyager_GalileoSSI_global_mosaic_1km

So the leave the code above alone and I think update below (but still need help to test).

mapscale_x = mapscale
mapscale_y = (-1 * mapscale)

if positivelongdir == "EAST":
    easternmostlong = isis3lbl['IsisCube']['Mapping']['MaximumLongitude']
    westernmostlong = isis3lbl['IsisCube']['Mapping']['MinimumLongitude']
elif positivelongdir == "WEST":
    easternmostlong = isis3lbl['IsisCube']['Mapping']['MinimumLongitude']
    westernmostlong = isis3lbl['IsisCube']['Mapping']['MaximumLongitude']

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant