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

cathist and errors using fx output #1095

Closed
ascbot opened this issue Feb 12, 2019 · 13 comments
Closed

cathist and errors using fx output #1095

ascbot opened this issue Feb 12, 2019 · 13 comments
Labels
bug Something isn't working

Comments

@ascbot
Copy link
Contributor

ascbot commented Feb 12, 2019


Author Name: Jeff Anderson (Jeff Anderson)

Original Assignee: Jean Walldren


when fx has parens in the equation the print file and cube history are no longer valid pvls

The cathist error:
ast{513}> cathist from=LSZ_04594_1CD_XKU_82N101_V1_CPR_NOHALF.cub mode=brief
ERROR Error in PVL file on line [62].
ERROR Unable to read PVL keyword [EQUATION = ((F1 + F2) - (F3 * -2.0)) / ((F1 + F2) + (F3 * -2.0))].
ERROR Found extra data after [(F1 + F2)] in array when reading PVL.
ast{514}> cathist from=LSZ_04594_1CD_XKU_82N101_V1_CPR_NOHALF.cub
ERROR Error in PVL file on line [62].
ERROR Unable to read PVL keyword [EQUATION = ((F1 + F2) - (F3 * -2.0)) / ((F1 + F2) + (F3 * -2.0))].
ERROR Found extra data after [(F1 + F2)] in array when reading PVL

Steps to reproduce:

To reproduce:

Run fx as follows:

Object = fx
IsisVersion = "3.3.1.4208 alpha | 2011-09-20"
ProgramVersion = 2012-02-09
ProgramPath = /usgs/pkgs/isis3production2012-04-11/isis/bin
ExecutionDateTime = 2012-04-12T19:31:33
HostName = astrovm1.wr.usgs.gov
UserName = tbecker
Description = "Generalized arithmetic operations using multiple cube
files"

Group = UserParameters
F1 = LSZ_04594_1CD_XKU_82N101_V1.cub+1
F2 = LSZ_04594_1CD_XKU_82N101_V1.cub+2
F3 = LSZ_04594_1CD_XKU_82N101_V1.cub+4
TO = LSZ_04594_1CD_XKU_82N101_V1_CPR_NOHALF.cub
EQUATION = ((F1 + F2) - (F3 * -2.0)) / ((F1 + F2) + (F3 * -2.0))
MODE = CUBES
End_Group

Additional information:

Also, when I bring up the fx gui, it cannot recover the parameter settings from the .par file

@ascbot ascbot added this to the 3.4.4 (2013-06-25 Jun) milestone Feb 12, 2019
@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: John Shinaman (John Shinaman)
Original Date: 2012-04-16T17:34:12Z


I am experiencing similar problems using fx with parens in the equation parameter ("((f1+f2)-(f3*-2.0))/((f1+f2)+(f3*-2.0))") and then running errors on the result. It is especially frustrating because I am dealing with more than 1000 files, and without the the use of errors I have to check the output manually - a real time burner!

Jac

@ascbot ascbot added the bug Something isn't working label Feb 12, 2019
@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Jean Walldren (Jean Walldren)
Original Date: 2012-10-08T17:44:04Z


When cathist reads the Pvl, it treats anything enclosed in ( ) as an array, so it gets confused with the EQUATION value's use of parentheses.

For now, here's a work around: use [ ] instead of ( ).

I don't know if that will be the best permanent solution, I am looking into other possible fixes.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Jean Walldren (Jean Walldren)
Original Date: 2012-10-10T19:47:38Z


IMPACT
Users will be able to enter the parameter "EQUATION" with parentheses or square brackets. This is expected to fix problems with printing the history of cubes that have been passed through fx with programs such as cathist and errors. Also, this should fix problems when the user loads the parameters from the "last" run of the fx program.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Tammy Becker (Tammy Becker)
Original Date: 2012-10-15T19:37:57Z


User Test1:
Successful, output correct; cathist now works (parans are replaced with brackets; that's okay); errors on print.prt works now..

Not successful: par file is corrupted

Command:
/work/projects/lro/minirf/tbecker/NorthPole/CPR/0to180/
fx f1=LSZ_04588_1CD_XKU_72N117_V1.cub+1
f2=LSZ_04588_1CD_XKU_72N117_V1.cub+2
f3=LSZ_04588_1CD_XKU_72N117_V1.cub+4
to=LSZ_04588_1CD_XKU_72N117_V1_CPR_M0569.cub
equation='((f1 + f2) - (f3 * -2.0)) / ((f1 + f2) + (f3 *-2.0))'

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Tammy Becker (Tammy Becker)
Original Date: 2012-10-15T19:41:55Z


User Test2:
Successful after modification to negative values of existing equation that had worked under previous isis versions; needed to replace the single '-' with '--'....this should be in a backwards compatability note upon release. Only double quotes needed around the entire equation, not extra parans.

Output correct, cathist worked, 'errors' worked....par file corrupted.

Location and Command:
/work/projects/cassini/tbecker/VIMS/TLBwork/TiPhoTest/

fx f1=CM_1585183559_1_ir_mwinavg.cub+1
f2=CM_1585183559_1_ir_mwinavg.cub+10
f3=CM_1585183559_1_ir_mwinavg.cub+11
to=CM_1585183559_1_ir_mwinavg_m3_B1_m0569.cub
equation="f1*(--0.018sec(f3pi/180)^3+0.380sec(f3pi/180)^2+4.4234*(sec(f3pi/180)-1)+2.1837)+(--0.2157(sec(f3*pi/180)-1)-0.3554)"

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Kris Becker (Kris Becker)
Original Date: 2012-10-16T16:02:37Z


I strongly oppose the need for a "--" as a negation operator. This is very confusing and not applied consistently as demonstrated in the above equations. Why does it seem to be required only when following a left paren and not other operators (e.g., * in note 3063)?

The double minus is commonly used in C/C++ (and other languages) as a decrement operator which amounts to "subtract 1 from the operand and reassign to the operand".

Can someone please explain the rationale for this?

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Lynn Weller (Lynn Weller)
Original Date: 2012-10-16T16:40:44Z


I agree with Kris - using two dashes for a negative sign is going to be extremely confusing to most users (like me!). It's not intuitive at all and has a standard meaning not just in programming languages, but it is also frequently used when setting options for unix system tools.

Is there another way to do this?

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Tammy Becker (Tammy Becker)
Original Date: 2012-10-16T18:53:28Z


Based on scope of issues changed to feedback

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Tammy Becker (Tammy Becker)
Original Date: 2012-10-20T00:34:11Z


Set status back to assigned. A new post has been added to deal with the negative number syntax. This post will remain focused on the original issue fixing interactions with cathist, errors and the 'last.par' parameter file.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Jean Walldren (Jean Walldren)
Original Date: 2012-10-23T22:48:46Z


This bug has been found to be a larger issue with how PVLs are handled. I have reset the estimated hours to >20.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Tammy Becker (Tammy Becker)
Original Date: 2012-12-01T00:20:25Z


Notes based on discussion w/ Jeannie and Stuart:

Recommended resolution will take an estimated 80 hours with a 2-developer team (40 hours each).

The recommended resolution is a 'PVL refactor' to handle vectors properly and make the class more 'PDS-PVL compliant'. The problem is the class does not correctly handle multi-dimensional arrays. The current PVL-sequence class can then be removed.

A work-around solution will take nearly the same amount of hours.

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Tammy Becker (Tammy Becker)
Original Date: 2012-12-07T18:41:01Z


The plan is to push this to Q3 for now

@ascbot
Copy link
Contributor Author

ascbot commented Feb 12, 2019


Original Redmine Comment
Author Name: Anonymous (Anonymous)
Original Date: 2013-03-19T21:36:47Z


/work/projects/lro/minirf/tbecker/NorthPole/CPR/0t180/

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
None yet
Development

No branches or pull requests

1 participant