getADDE() -> loadADDE()

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

getADDE() -> loadADDE()

Post by hproe »

Hi -

I only realise now that getADDE() has been depreciated (since when?). I have noted one important difference: loadADDE does not return the metadata meta data ny more, but only the image data (which is fine by me). Are there other differences I should know about? I assume I better upgrade my many sripts accordingly.

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

Re: getADDE() -> loadADDE()

Post by joleenf »

Hi HP,

getADDEImage will still work, but future development will only apply to loadADDEImage. loadADDEImage returns the metadata within the data object. loadADDEImage works similar to getADDEImage, except one object containing metadata is returned rather than a data object and metadata. The official change occurred in McV 1.5.

Code: Select all

b2=loadADDEImage(**parms)

print b2['nominal-time']

panel=buildWindow()
myIRLayer=panel[0].createLayer('Image Display', b2)


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

Re: getADDE() -> loadADDE()

Post by bobc »

Hi HP -

It looks like Joleen beat me to this, but here's a bit more information. The transition from getADDEImage to loadADDEImage occurred with the release of version 1.5. There are a couple reasons for this change:

  1. Naming consistency with other functions like loadGrid and the future loadVIIRSImage functions
  2. The other functions in 1 above only return one object. So for consistency, loadADDEImage only returns one object

You are correct that getADDEImage returned two objects and loadADDEImage only returns one object. getADDEImage returned one metadata object, and one object containing both the data and metadata (that we are referring to as a mega object). loadADDEImage now only returns this mega object. You can use the mega object in the same way you could the metadata object from getADDEImage. For example, you can pull the image size from the mega object returned from loadADDEImage to use for the dimensions of a window (as demonstrated in this script):

Code: Select all

myDict = dict(
    server = 'adde.ssec.wisc.edu',
    dataset = 'RTIMAGES',
    descriptor = 'GE-IR',
    size = (800,1300),
    )
data = loadADDEImage(**myDict)

# get window size from data
bwHeight = data['lines']
bwWidth = data['elements']

print 'Building window with height of '+str(bwHeight)+' pixels and width of '+str(bwWidth)+' pixels.'
panel = buildWindow(height=bwHeight, width=bwWidth)
layer = panel[0].createLayer('Image Display',data)

While your scripts using getADDEImage should continue to work, we recommend updating to loadADDEImage since any future development will occur there.

Thanks -
Bob Carp
Post Reply