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

PHOTOMET Won't Accept Pre-Made Backplanes #5281

Closed
astrostu opened this issue Aug 29, 2023 · 12 comments · Fixed by #5658
Closed

PHOTOMET Won't Accept Pre-Made Backplanes #5281

astrostu opened this issue Aug 29, 2023 · 12 comments · Fixed by #5658
Assignees
Labels
bug Something isn't working

Comments

@astrostu
Copy link

ISIS version(s) affected: 7.2.0

Description
I am attempting to run PHOTOMET on some MARCI images with code that worked fine before in ISIS version 4.3.x and 4.4.0. I'm using 7.2.0 now (waiting for 8.0.1 to be available with the JIGSAW fix before upgrading) and have a very weird error with PHOTOMET. It's more efficient for MARCI processing to create the backplanes first, save them, and then use them as a reference for applying a photometric model. However, with version 7.2.0, when I give it the file names, it says "PROGRAMMER ERROR Parameters [PHASE_ANGLE_FILE] is not a filename.

I have tried to use both the command-line and the GUI version with the same results. I have also renamed the files to something more simple - and ensured they exist - and get the same results. I verified in QVIEW that the backplanes look good. It would appear as though somewhere between version 4 and 7, something in PHOTOMET got broken, which is weird because I do not see any changes to it in the overall ISIS changelog.

How to reproduce
See above. I have not attempted to do this with other mission data.

@astrostu astrostu added the bug Something isn't working label Aug 29, 2023
@lwellerastro
Copy link
Contributor

Hi @astrostu, could you share some of your processing steps so that we can try and duplicate the problem here? Folks might want to see an example command line for how you are creating backplanes, and how you are running photomet using that backplane (along with other parameter settings). If you are using a pvl with parameter names and values, please include the contents of that as well.

4.0.0 changelog notes: photomet now correctly reads array valued PvlKeywords. #3608
Probably not the issue and seemingly in a version that might have worked fine for you.
A change could have happened elsewhere and is impacting photomet.

@astrostu
Copy link
Author

astrostu commented Aug 30, 2023

Just verified in v7.1.0 that it also doesn't work. I downloaded a random UV file to test it out:

marci2isis from=D17_033834_0357_MU_00N234W.IMG to=D17_033834_0357_MU_00N234W.cub flip=no
spiceinit from=D17_033834_0357_MU_00N234W.odd.cub cknadir=true
marcical from=D17_033834_0357_MU_00N234W.odd.cub to=D17_033834_0357_MU_00N234W.odd.l1.cub

For this test, I only went through the odd framelets, and then just UV1 band.
explode from=D17_033834_0357_MU_00N234W.odd.l1.cub to=D17_033834_0357_MU_00N234W.odd.l1

I kept the default names from explode at this point.
phocube from=D17_033834_0357_MU_00N234W.odd.l1.band0001.cub to=D17_033834_0357_MU_00N234W.odd.l1.band0001.pho.cub specialpixels=true phase=true emission=true incidence=true latitude=false longitude=false pixelresolution=false
explode from=D17_033834_0357_MU_00N234W.odd.l1.band0001.pho.cub to=D17_033834_0357_MU_00N234W.odd.l1.band0001.pho

I renamed the band0001, 2, and 3 to phase, emission, incidence.
photomet from=D17_033834_0357_MU_00N234W.odd.l1.band0001.cub to=D17_033834_0357_MU_00N234W.odd.l1.band0001.l3.cub phtname=hapkehen theta=0 wh=0.156995885 hg1=0.235185185 hg2=0.221193416 hh=0.378600823 b0=0.84691358 ZeroB0Standard=false normname=albedo incref=45 thresh=1e10 albedo=0.02 maxemission=90 maxincidence=90 anglesource=backplane phase_angle_file=D17_033834_0357_MU_00N234W.odd.l1.band0001.pho.phase.cub emission_angle_file=D17_033834_0357_MU_00N234W.odd.l1.band0001.pho.emission.cub incidence_angle_file=D17_033834_0357_MU_00N234W.odd.l1.band0001.pho.incidence.cub

@astrostu
Copy link
Author

I have also just verified that the above does work on an older v4.3 (I think?) install of ISIS. But, in at least v 7.1 and 7.2 it does not. I'll go ahead and check v 8.0 now just in case. But that said, I also tested it on a random Cassini image of Mimas I have, and it is also broken with the same error.

With that said: If I omit anglesource=backplane and the backplanes, PHOTOMET does work and does not throw the error. So, this appears to just be an issue with calling pre-made backplanes.

Perhaps that's why this hasn't come up yet: For most missions, it doesn't make much sense to make the backplanes ahead of time, but for MARCI it does because you can use the same backplanes for both even and odd framelet cubes but only have to calculate the backplanes once. Backplane calculation takes much longer than applying PHOTOMET, so it's a real time-saver.

@lwellerastro
Copy link
Contributor

Thanks for all of the feedback @astrostu.
I have been able to reproduce this problem (using a MEX HRSC image of Phobos) starting under isis7.1.0 (and is present under 8.0.0 LTS). Here is the full error message:

  Group = Error
    Program = photomet
    Class   = "PROGRAMMER ERROR"
    Code    = 3
    Message = "Parameter [PHASE_ANGLE_FILE] is not a filename"
    File    = IsisAml.cpp
    Line    = 644
  End_Group

The program works as expected under 7.0.0. I didn't bother going back further than that version. Test data can be found under my user work area Isis3Tests/Photomet/AngleSourceFile. See proc.scr for command. The directory contains input and output for the successful run under isis7.0.0.

I don't see anything obvious in the changelog that would suddenly break this functionality, but clearly something snuck in. Hopefully knowing which version the break first occurred will make it easier to identify the problem.

@astrostu, at the risk of telling you something you already know, unless you are using the renamed phocube backplanes for reasons beyond ease of identification, you could save yourself some space by referencing the phocube output file band when specifying the angle source files, e.g.

phocube ... anglesource=backplane phase_angle_file=phocube.cub+1 emission_angle_file=phocube.cub+2 incidence_angle_file=phocube.cub+3

@astrostu
Copy link
Author

astrostu commented Aug 30, 2023

@lwellerastro Thanks, and yes, I do know about that, but I had to do it that way for a workaround of a bug that has been fixed since I developed the work-around: #4810. It's often easier to stick with a workaround that doesn't cost anything (disk, very minor CPU, etc.) than to update it after a bug fix. But, next time I get under the hood of this code, I will probably update it to reflect that bugfix.

Copy link

github-actions bot commented Mar 1, 2024

Thank you for your contribution!

Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'

If no additional action is taken, this issue will be automatically closed in 180 days.

If you want to participate in our support prioritization meetings or be notified when support sprints are happening, you can sign up the support sprint notification emails here.

Read more about our support processs here

@github-actions github-actions bot added the inactive Issue that has been inactive for at least 6 months label Mar 1, 2024
@astrostu
Copy link
Author

astrostu commented Mar 1, 2024

This is still a pretty clear bug that breaks previous functionality. Still exists in 8.x

@github-actions github-actions bot removed the inactive Issue that has been inactive for at least 6 months label Mar 2, 2024
Copy link

Thank you for your contribution!

Unfortunately, this issue hasn't received much attention lately, so it is labeled as 'stale.'

If no additional action is taken, this issue will be automatically closed in 180 days.

If you want to participate in our support prioritization meetings or be notified when support sprints are happening, you can sign up the support sprint notification emails here.

Read more about our support processs here

@github-actions github-actions bot added the inactive Issue that has been inactive for at least 6 months label Aug 29, 2024
@astrostu
Copy link
Author

This is still a bug as far as I can tell that breaks previous functionality and can significantly lengthen the processing of some images. I've subscribed to the sprint email list so I'll try to bring this up.

@github-actions github-actions bot removed the inactive Issue that has been inactive for at least 6 months label Aug 30, 2024
@blandoplanet
Copy link

I am WAY out of depth here... could this be related to the change from GetFileName to GetCubeName? That was the most recent commit for Photomet and the timing would be about right (the commit was made in 2022, so ISIS versions before 7.0.0 should be fine). I noticed that the 'Angle source = backplane' block still calls GetFileName. I honestly don't know if that's right or wrong.

I'll emphasize that I don't speak C++, don't understand the ISIS code base, was digging into photomet for an unrelated reason, and had happened to trip on this bug earlier in the day. So, consider the source...

@abhinav-s-jindal
Copy link

This is still an existing issue and I just wanted to boost it up!

@volcanopele
Copy link

I'm getting the same error on ISIS 8.0.3. I have a Juno SRU image with calculated photometric backplanes and I am running into this issue:

(isis) perry@Pele SRU % photomet from=SRU_1_2023364T083553_57_V01.point.cub+1 to=SRU_1_2023364T083553_57_V01.photom.cub frompvl=/Users/perry/Dropbox/Io/io.pvl anglesource=BACKPLANE PHASE_ANGLE_FILE=/Users/perry/Dropbox/Io/Juno/PJ57/SRU/SRU_1_2023364T083553_57_V01.phase.cub INCIDENCE_ANGLE_FILE=/Users/perry/Dropbox/Io/Juno/PJ57/SRU/SRU_1_2023364T083553_57_V01.incidence.cub EMISSION_ANGLE_FILE=/Users/perry/Dropbox/Io/Juno/PJ57/SRU/SRU_1_2023364T083553_57_V01.emission.cub normname=mixed incref=0 incmat=45 albedo=1200 thresh=100 maxemission=85 maxincidence=88

Group = NormalizationModelParametersUsed
NORMNAME = MIXED
INCREF = 0.0
INCMAT = 45.0
THRESH = 100.0
ALBEDO = 1200.0
End_Group

Group = AtmosphericModelParametersUsed
End_Group

Group = PhotometricModelParametersUsed
PHTNAME = LUNARLAMBERTEMPIRICAL
PhaseList = "0.,10.,20.,30.,40.,50.,60.,70.,80.,90.,100.,110.,120.,130-
.,140.,150.,160.,170.,180."
PhaseCurveList = "1.000,1.008,0.985,0.941,0.886,0.829,0.774,0.720,0.666,0.6-
08,0.544,0.470,0.389,0.309,0.233,0.166,0.104,0.043,0.000"
LList = "0.830,0.662,0.544,0.457,0.373,0.290,0.206,0.129,0.062,0.0-
09,-0.029,-0.053,-0.061,-0.061,-0.055,-0.049,-0.037,-0.013-
,0.010"
End_Group
**PROGRAMMER ERROR** Parameter [PHASE_ANGLE_FILE] is not a filename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

6 participants