loadADDEImage keys not working completely?

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

loadADDEImage keys not working completely?

Post by joleenf »

Hi,

I am trying to use the 'center-latitude' and 'center-longitude' keys from the loadADDEImage command. It seems that the following keys consistently produce nan for GOES-EAST imagery (I have not check other satellites)

center-latitude
center-longitude
center-latitude-resolution
center-longitude-resolution

It seems that getting these values from other methods, such as from the class edu.wisc.ssec.mcidas.AreaDirectoryList, still works. I am currently using the McIDAS-V 1.6 nightly downloaded yesterday.

Thanks,
Joleen
User avatar
jayh
Posts: 424
Joined: Thu Jan 15, 2009 10:34 pm

Re: loadADDEImage keys not working completely?

Post by jayh »

Hi Joleen-

I used the dirlist methods from the basic scripting tutorial to check this out:

dirList = listADDEImages(server='pappy.ssec.wisc.edu', dataset='TORNADO', descriptor='GOES13-IR', position='ALL')

for imageDir in dirList:
print ' '
print 'New image directory %s %s' % (imageDir['sensor-type'], imageDir['nominal-time'])
print ' ---------------------------------------------------------------------------------------------------------'
for key,value in imageDir.iteritems():
print key,value

This above example worked in today's nightly. I also tried EASTL/CONUS from the SSEC Data Center servers and received these values:
center-latitude 27.793676
center-longitude -82.708031
center-latitude-resolution 4.899979
center-longitude-resolution 2.374949
centerLocation (27.793676, -82.708031)

What data are you trying to get the information from? Local files, EASTL dataset, etc.?

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

Re: loadADDEImage keys not working completely?

Post by joleenf »

Hi Jay,

I think my problem is that I was trying to get that information from the loadADDEImage function. Is there anywhere in the help documentation that lists exactly which keys are returned from loadADDEImage and which are returns from listADDEImages? This might be a handy chart/appendix.

I should have seen the mix up. I used a directory listing to get the center lat/lon but I was trying to use image metadata in a different script.

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

Re: loadADDEImage keys not working completely?

Post by joleenf »

Hi Jay,

I am using Jon's mcvinit.py script to run statistics in a jython shell. When using listADDEImages, I get the following error:

print band2ImageDirectory['center-location']
File "/home/joleenf/McIDAS-V-System/mcidasv.jar/edu/wisc/ssec/mcidasv/resources/python/mcvadde.py", line 295, in __getitem__
return self.values[key]


What is odd, is I can just print everything returned from listADDEImages by using "print band2ImageDirectory." The keys and values look fine, the error only occurs when I try to get a value based on a key.

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

Re: loadADDEImage keys not working completely?

Post by bobc »

Hi Joleen -

I'm replicating the missing values of the lat/lon keys returned from loadADDEImage. I spoke briefly with a programmer and these values are returned from a directory request, like listADDEImages does. loadADDEImage does a data request. At our scripting meeting tomorrow, I'll find out if these keys should work for loadADDEImage or not and I'll let you know.

As far as documentation for which keys are returned from each function, this does not currently exist. Once we work out if loadADDEImage should return the lat/lon keys that listADDEImages does (as well as other calibration keys), I'll put a list together.

For your mcvinit.py script, I don't have much experience using this but the key from listADDEImages that contains both latitude and longitude is centerLocation, not center-location. Could you give this a try?

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

Re: loadADDEImage keys not working completely?

Post by joleenf »

I found the problem, I forgot to index the directories returned:

print imageDir[0]['centerLocation'] is correct

not

print imageDir['centerLocation']

Thanks,
Joleen
Post Reply