ImageOverlay

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

ImageOverlay

Post by joleenf »

Hi,

I am using the following for an ImageOverlay in the captureImage formatting:

ImageOverlay(
image="resize_cimss.png",
place="UR, -10, 30",
anchor="UR"
)

1.) Could you verify the documentation: "Example: place="UL,20,20" Adds the image to the upper left brought down 20 pixels from the top and brought in 20 pixels from the left." I think this is the opposite: Brought in by 20 pixels from left and down from top 20 pixels. The documentation might be easier to follow if the values for indentation are different numbers such as "UL, 30, 20."

2.) While the captureImage ISL command shows that I am supplying the image file resize_cimss.png, I am actually getting a McV logo on my final image.

resize_cimss.png
resize_cimss.png (9.53 KiB) Viewed 2324 times


DR_ABI-L2-CMIPF-M3C06_G16_s20152321953336_e20152322004120_c20152322004165_700X700.png


Code: Select all

<image file="/Users/joleen/data//DR_ABI-L2-CMIPF-M3C06_G16_s20152321953336_e20152322004120_c20152322004165_700X700.png" quality="1.0" view="#0"><overlay image="resized_NOAA_Logo.png" place="UL, 10, 30" anchor="UL" /><overlay image="resize_cimss.png" place="UR, -10, 30" anchor="UR" /><colorbar display="sharable_1456160629338_0_09827085148333892_11" width="630" height="15" orientation="bottom" tickmarks="0" interval="0.25" place="UM,0,10" anchor="UM" suffixfrequency="last" showunit="False" color="white" linecolor="white" fontface="Arial" fontsize="18" /></image>


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

Re: ImageOverlay

Post by bobc »

Hi Joleen -

Thanks for pointing out the documentation example. I think that it was a bit misleading, especially since both x and y values were 20. I changed the doc example to:

Example: place="UL,40,20"
Adds the image to the upper left brought in 40 pixels from the left and brought down 20 pixels from the top.

This doc update will be included in the User's Guide with the next stable release of McIDAS-V.

As for the McIDAS-V logo, can you try passing the full directory path to your image file through the 'image' keyword? It looks like this McIDAS-V logo is used when what was passed through the image keyword isn't found. Since this isn't what users would expect, I wrote up Inquiry 2274 to address the following circumstances with the image keyword of ImageOverlay:
  1. The user didn't specify 'image' in their script. In this case, I think captureImage should error letting the user know that the 'image' keyword is is required.
  2. The user specified an 'image' keyword, but it pointed to a nonexistent file or one that McIDAS-V couldn't find. In this case, I think that the captureImage command should error letting the user know that the file wasn't found, and note that the full path to the image file should be used.

Please let me know if using the full path to your image file doesn't work or if you have any additional comments/suggestions.

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

Re: ImageOverlay

Post by joleenf »

Hi Bob,

If I put the logos in my ~/Applications/McIDAS-V-System directory, the command I outlined above does work.

At first, I thought adding the full path did not work for me, but it turns out, I had a typo in the pathname...so I should always use the os.path.isfile method, which will return true or false. Perhaps I could at least issue a warning when the file is not found or skip adding the logo due to the error along with a message.

import os
os.path.isfile("/Users/joleen/data/resized_NOAA_Logo.png")


Joleen
Post Reply