Thursday, March 22, 2012

IDL, MATLAB scp command imbedding

For my IDL and MATLAB scripts, calling scp is as easy as using each language's system call, with command strings built up through normal concatination.

IDL:
In IDL it's the "spawn" command. Here are some nice tutorials with examples:

http://archive.stsci.edu/iue/manual/dacguide/node8.html
http://www.astro.virginia.edu/class/oconnell/astr511/idl_5.1_html/idl1a9.htm
http://idlastro.gsfc.nasa.gov/idl_html_help/SPAWN.html


MATLAB:
This shows a very fancy script, but it's just a wrapper for the system call that allows specification of an array of scenarios for the scp command. The take-away for me was to be sure to use the full path for the scp executable.

http://www.mathworks.com/matlabcentral/fileexchange/25256-scpsftp-from-matlab/content/ssh/scpfrommatlab.m