Saved Viewpoint does not always work

Errors and unexpected results
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Saved Viewpoint does not always work

Post by joleenf »

Hi,

It seems that the saved viewpoints do not always work. It is not consistent, but the viewpoint sometimes saves incorrectly so that a saved view over North America will fail to return the North American view and may be somewhere over South America. I can't figure out why this pattern is inconsistent. Sometimes the save seems to work correctly. Once a view is corrupted incorrect, it seems to stay that way. I have decided to start using a more verbose way of returning to the same view, especially if the display is rotated.

Part A (setting the correct view)
1.) Find correct zoom, projection
2.) Rotate Display
3.) Find out the projection matrix

Part B (returning to previous view
1.) Repeat the zoom, projection
2.) set the projection matrix

If Part B, Step 1 is skipped, the projection matrix does not return to the same view in part A.


Code: Select all

panel = buildWindow(height=720,width=1280)
panel[0].setProjection(projection)
panel[0].setCenter(39,-103.9)
panel[0].setScaleFactor(5.0)
panel[0].setWireframe(False)
# hack to turn display to desired view
nav=panel[0].getNavigatedDisplay()

projectionMatrix=[1.81443441765996, 0.017172076959476982, -0.016770754467774145, \
                 -0.839954704088919, 0.02088701834226162, 1.1734219920086542,\
                 0.5538042341673042, 0.19453075679676154, 0.04020542843618284, \
                 -1.3845616448693578, 0.4691434876591039, 0.0, 0.0, 0.0, 0.0, 1.0]
nav.setProjectionMatrix(projectionMatrix)


I imagine that this might be difficult to reproduce as a bug report because failed viewpoints still happen sporadically within my session. Therefore, I will have to rely on other users to back me up. Also, you could come look at some of the failed viewpoints on my machine, but then you will have to take my word for it that I actually saved a view over Colorado and I now see Brazil. Or, I saved view of the AHI full disk region and the viewpoint returns the US.

Thanks,
Joleen
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

Re: Saved Viewpoint does not always work

Post by hproe »

Hi Joleen -

I remember a couple of instances (before 1.6beta1), where a saved view started to fail. However, I was never sure whether it was due to some inadvertent maipulation on my side. One thing that is sure (and a missing feature), you cannot save a global display. Also, my viewpoint list always tends the overflow at the bottom. There should be a way to see the complete list in this case as well.

cheers, HP
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Saved Viewpoint does not always work

Post by joleenf »

HP,

I thought the same, I must have done something incorrect. I hate to say with absolute certainty that it is not user error, but I don't believe it is user error because I have been able to repeat the problem. It is a sporadic repeat, so it still may be some other action taken prior to saving the viewpoint. I wonder if there would be any way to capture this problem in any log.

Thanks for your response,
Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: Saved Viewpoint does not always work

Post by Rick »

Hi Joleen,

If I understand what you are trying to do, you are hoping that you can save a projection matrix and restore it at a later date and get the same display. Is that correct? If so, it does not look like your method will work. After running a few tests, I found that matrix is applied to the current projection. There are no lat/lon bounds involved, just rotation values.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Saved Viewpoint does not always work

Post by joleenf »

Rick,

That is correct. Every time I use the projection matrix, I must repeat the setProjection, setCenter, and any other view settings done before the projection matrix was recorded.

My question got a bit convoluted. I was wondering if this "sporatic" behavior that I occasionally see in saving viewpoints might have a similar problem. For instance, I noticed I could easily save a viewpoint of Colorado where I had set the projection to Colorado and then zoomed. I could not save that same projection/zoom with a rotation. Every time I did, the resulting saved viewpoint shifted to a top view over South America. I experienced this same problem when I was trying to get a special zoom/rotation over east Asia.

Thanks,
Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: Saved Viewpoint does not always work

Post by Rick »

When you save your projectionMatrix (whether it is from AHI or Colorado), are you trying to use that projectionMatrix on the default World projection? If so, you are getting the expected results.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Saved Viewpoint does not always work

Post by joleenf »

Rick,

I am using the US>States>Colorado projection, which is the same projection type as World. I have not tested on other projection types. When I use the projection matrix to rotate the display after I set the projection and scale, I get consistent results. When I set the projection, scale, rotate my display then save the viewpoint, I do not get consistent results.

The following process has failed more than a few times

1.) Set projection to US>States>Colorado
2.) Zoom In
3.) Rotate the display
4.) Adjust center or zoom to get optimal view (I am looking at GOES-14 SRSO Data from May 20-21, 2014)
5.) Save the viewpoint with Projections>Save Current Viewpoint

This process does not involve setting anything with the projection matrix method outlined above, but when I restore the viewpoint, it is incorrect. I migrated to using the projection matrix when the accepted/documented method for setting customized viewpoints failed more than twice.

Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: Saved Viewpoint does not always work

Post by Rick »

Hi Joleen,

Thanks for the clarification.

If you currently have a working view point, please post projections.xml. The file should be in your McIDAS-V directory. Once the projection has become corrupt, again post projections.xml.

Rick
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Saved Viewpoint does not always work

Post by joleenf »

Hi Rick,

Here is the current projections.xml file that I have. After posting this file, I will make a back-up of this file, and then start from an empty viewpoints list, and try to reproduce the problem with a clean slate.

An example of a "good" projection, one that saved as expected is "CO_SRSO." An example of a projection that did not save as expected are "CO_Tilted" and "CO_Script"

Thanks,
Joleen

projections.xml
(82 Bytes) Downloaded 338 times

viewpoints.xml
(91.52 KiB) Downloaded 337 times
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: Saved Viewpoint does not always work

Post by joleenf »

Hi Rick,


I do not reproduce the error with a clean viewpoint.xml file. The old file is corrupt? Is it possible to tell which part of the file is causing the problem?

Joleen

viewpoints.xml
(2.8 KiB) Downloaded 356 times
Post Reply