getADDE() does not find data with relative time

Errors and unexpected results
Post Reply
User avatar
hproe
Posts: 504
Joined: Sat Nov 27, 2010 3:46 pm

getADDE() does not find data with relative time

Post by hproe »

Hi -

I have Jython code that retrieves recent image slots from geosat ADDE servers. I have not used it for a while - 3 months, say. Running it now again (with a very recent nightly), it does not find any time slots. I have extracted the essential part of the code:

Code: Select all

def dummy():
 perms=('?','?')
 addeParmsMETEOSAT=dict(
    server='msg.ssec.wisc.edu',
    dataset='MSG',
    descriptor='FD',
    band=9,   
    unit='TEMP',
    coordinateSystem=LATLON,
    size='ALL',
    mag=-4,
    accounting=perms
)
 METEOSATloop=[]
 for pos in range(-1,0):
    try:
       metadata,myImages=getADDEImage(position=(pos),**addeParmsMETEOSAT)
    except:
       print pos,'not available'
    else:
       METEOSATloop.append(myImages)
       print pos,metadata.get('nominal-time')

Running this from the Jython shell as dummy() will print the message given in the except clause in the fourth-to-last line, i.e. it does not find the most recent METEOSAT slot. When running it, do not forget to give the proper project parameters to variable perms.

cheers, HP
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: getADDE() does not find data with relative time

Post by bobc »

Hi HP -

I think there are a couple problems in your script:

1. Somewhat recently, we made it so that when you specify size='ALL', you can't also specify coordinateSystem, place or location. In your script, you use size='ALL' and coordinateSystem=LATLON. Can you try pulling the coordinateSystem=LATLON from your script?
2. Mag must be specified as (x,y)... so can you try changing your mag=-4 to mag=(-4,-4)?

Both problems 1 and 2 should return different error messages from getADDEImage, but I think the second half of your script (the for loop) is just printing out the message '-1 not available' regardless of the actual error.

I'll ask our scripting group about #2, as i think it would be nice to just be able to enter in a single numerical value for mag, which would just be used as both the x and y values.

Please let me know if making modifications 1 and 2 above to your script don't help.

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

Re: getADDE() does not find data with relative time

Post by hproe »

Hi Bob -

Thank you very much. My code is running again. It is your #1 remark that did the trick (and makes sense as the code was running earlier on in the life of version 1.5). #2 is due a misprint from my side, introduced when extracting the essential part of code.

cheers, HP
Post Reply