annotate

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

annotate

Post by joleenf »

Hi,

This may be a feature request: is there any way to set alignment (e.g. Left-Bottom) when using annotate()? It seems that the justification might be different in my script than when I use the tool interactively.

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

Re: annotate

Post by joleenf »

Bug Report

1.) line/element fails:
Screen Shot 2013-10-21 at 11.32.09 AM.png
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: annotate

Post by Rick »

Hi Joleen,

I guess we missed that part of the documentation. You can use the alignment keyword.

alignment=(horizontal,vertical)
horizontal = 'left', 'center' or 'right'
vertical= 'top', 'center' or 'bottom'

Example:
alignment=('left','top')
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: annotate

Post by Rick »

Hi Joleen,

You specified decimal values for line and element and in the case of line, a negative number. Is there a reason why you'd want to specify those types of values?

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

Re: annotate

Post by joleenf »

Hi Rick,

Apparently not the same as using the draw freely x,y option? I tried figuring out what I wanted to use by first testing with the interactive control.

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: annotate

Post by bobc »

Hi Joleen -

It appears that the alignment keyword of annotate works opposite what it does through the Drawing Control widget. Therefore, if you look at the Properties of an item drawn through the Drawing Controls and the alignment is (left, bottom), through scripting you would need to do alignment=('right','top').

I have written this up as McIDAS-V Inquiry number 1615
http://mcidas.ssec.wisc.edu/inquiry-v/?inquiry=1615

Thanks for reporting this -
Bob Carp
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: annotate

Post by joleenf »

Hi Bob,

I don't think this would fit under the same inquiry. When "Draw Freely" is used interactively, choices for placement include x/y, x/y/z, lat/lon, lat/lon/alt options. Once the glyph is written on the screen, a user can

1.) Use the Drawing Control Layer Control select Shapes tab.
2.) Double Click on a Glyph
3.) In the Glyph Properties Control select the Points tab
4.) Write Points or just write them down.

It seems that the lat/lon option is essentially what is used in scripting, but the x,y option is not. I won't be the only one to try to use those points in a script. I think that the most reliable points will be lat/lon, line/elem, but x,y could also work if the user is aware of the window size and uses that same size in a script.

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: annotate

Post by bobc »

Hi Joleen -

I wrote up inquiry 1616 to cover adding the ability to specify x/y values for location in annotate().
http://mcidas.ssec.wisc.edu/inquiry-v/?inquiry=1616

Thanks for the request -
Bob
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: annotate

Post by joleenf »

Hi Bob,

You might want to add something about looking into using line/elem in the interactive control as well. If scripting really will replicate the interactive tool, this would be an opportunity.

Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: annotate

Post by bobc »

Thanks for the suggestion. I generalized the inquiry to make the options for Location/Coordinates the same between the GUI and in scripting. This includes adding Line/Element to the Coordinates dropdown in the Drawing Control widget and adding X/Y to the options for annotate().

I will ask about specifying a z-level through annotate() to see if this is possible, or if this is another feature request to make this possible through scripting. The default z-level through scripting appears to be 0.

Thanks again -
Bob
Post Reply