remote server addition with scripting

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

remote server addition with scripting

Post by joleenf »

Is there a way to add a remote server with scripting tools? I am not able to bring up a display right now, so using the GUI is not practical.

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

Re: remote server addition with scripting

Post by bobc »

Hi Joleen -

There's currently no function for adding a remote server/dataset via scripting. You can, however, work with a remote server/dataset that you haven't added to your ADDE Data Manager with the ADDE scripting functions. For example, if I start in a fresh session, I can run loadADDEImage on msg.ssec.wisc.edu/MSG/FD as long as I pass the accounting= keyword through the function.

Does this cover what you were looking for? Or were you eventually looking to use this remote server/dataset through the GUI? I will write up an inquiry for creating a makeRemoteADDEEntry function (matching the naming of the makeLocalADDEEntry function) as I can see how it could be useful. For example, this could be an effective way to pass around a script to users that adds a bunch of remote servers/datasets (similar to importing a MCTABLE.TXT file through the ADDE Data Manger GUI).

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

Re: remote server addition with scripting

Post by joleenf »

For security reasons, I am looking for a simple way to add a remote server from a script. I don't want to store my accounting information in a script which is on a git repository. I am very likely to forget to remove it if I do.

At this point, I can make sure I always pass the accounting information through the bash command line.

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

Re: remote server addition with scripting

Post by bobc »

Hi Joleen -

You may already know this, but for others who look at this forum, if you have the server/dataset defined in your ADDE Data Manager you don't need to pass accounting information through the script at all. For example, since I have msg.ssec.wisc.edu/MSG (along with my accounting information) defined in my ADDE Data Manager, I can run the script as:

Code: Select all

# dictionary to pass through loadADDEImage
addeParms = dict(
    server = 'msg.ssec.wisc.edu',
    dataset = 'MSG',
    descriptor = 'FD',
    time = '12:00:00',
    band = 1,
    coordinateSystem = LATLON,
    location = (46, 5),
    place = CENTER,
    size = (800, 800),
    )
   
# loadADDEImage call
data = loadADDEImage(**addeParms)

# build window and display data returned from loadADDEImage
panel = buildWindow()
layer = panel[0].createLayer('Image Display', data)

Notice that I didn't specify any accounting= keyword. If you are working under the assumption that the users of the script have the server/dataset added to their ADDE Data Manager then there's no need to specify accounting information. If I were to run this script without the server/dataset in my ADDE Data Manager, there's an error that ends with "Accounting required for the server".

Does this clear anything up?

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

Re: remote server addition with scripting

Post by joleenf »

Hi Bob,

Yes, I usually use this method. Which is the reason for the original question. The problem is that on our new machine, I cannot see my McIDAS session through chicken of the vnc, which is what I have used in the past to view a McV session through an SSH tunnel. I can however, runMcV using scripts. I am working with TC to resolve this issue. The vnc connection problem is affecting how I view anything from the new machine. Unfortunately, this is also the machine where new data is coming in right now and ideally, everything will get run on that machine.

Thanks,
Joleen
Post Reply