domain sticks when using setProjection(layer)

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
Posts: 1120
Joined: Mon Jan 19, 2009 7:16 pm

domain sticks when using setProjection(layer)

Post by joleenf »


Bob and I recently looked at an issue where I was loading data from the "M" descriptor of GOES-16 and use the projection of the layer or data source. In that case, the second sector would map into the domain of the first sector and display in the wrong place. This only happened in scripting.

I thought this was confined to use the combined M1 and M2 sectors in the M descriptor. However, it is not. There is an eclipse prep today, and this seems to happen with moving sectors within the same data source. I have an attached example script. If I build the window every time the sector will be in the correct projection, however, if I try to reuse the window, later sectors plot within the first domain.

I tried one other test. I built the window first, set Auto-Set Projection to "on" and ran again without setting the projection in the script loop. This fails to plot the sectors in the correct locations.

In the attached script, I selected two images that should plot roughly over the west coast and then in the midwest.

1.) Try as is with lines 33&34 running (buildWindow, Auto-Set Projection on)
2.) Try Commenting 34 and remove comment mark for line 52
3.) Try Commenting 33 and remove comment mark for 51
(1.99 KiB) Downloaded 271 times
User avatar
Posts: 938
Joined: Mon Nov 15, 2010 5:57 pm

Re: domain sticks when using setProjection(layer)

Post by bobc »

Hi Joleen -

I think we've worked some of this out in person and through email, but it is also good to summarize this on the forum. There looks to be a bug in McV where Auto-Set Projection must be disabled when displaying multiple images where the domain of the data changes through time. I've written this up as Inquiry 2579. I've replicated this through the GUI and through scripting. A workaround looks to be to set your projection again once all the data is displayed. If you originally have auto-set projection enabled and all of the images are plotted on top of each other, setting the projection (e.g. panel[0].setProjection('US>CONUS')) looks to snap all of the data back to its correct location. If you originally have auto-set projection off, the data originally plots in its correct location, but you will likely be at the World projection. Changing to CONUS allows you to get in closer to your data.

Thanks -
Bob Carp
Post Reply