HOME GUIDE OPERATIONS DOCS FAQ TECHNIQUES FORMATS INSTALL NEW TIPS WEB LINKS WADSWORTH

VM - System call

(5/08/04)

PURPOSE

To access the operating system from SPIDER using a system (Unix) command.

USAGE

.OPERATION: VM
<or> VM M

.SYSTEM COMMAND: ls *.OMM (e.g.)
[Enter the command you want executed. This may also be a command file.
Substitution of do-loop indices and register contents for characters within {} is allowed anywhere in the command line (not just in filenames). In addition it is now possible to substitute register contents in floating point format, see NOTE: 5 below]

NOTES

  1. Comments are not accepted in the command line as a SPIDER comment character (;) is used to string system commands together on the same line in Unix.

  2. For 'VM M' multiline input is accepted until a line has only a intial '.' (dot). To put a blank at the end of a line, place it at the beginning of the following line or it will disappear.

  3. You must specify the extension for any filenames within the system command as they are NOT appended automatically by SPIDER (as there is no way to recognize what is a filename). However, you can use the string: $DATEXT to substitute the current SPIDER data extension into the corresponding position in your command line. You can use the string: $PRJEXT to substitute the current SPIDER project extension into the corresponding position in your command line.

  4. The "VM" name for this operation is left over from the VAX/VMS system operation name.

  5. Sample of substituting register contents in floating point format:

    x11=34.56

    VM ; To write out the following: x11 is now= 34.5600
    echo x11 is now= {%F7.4%x11}

    VM ; To write out the following: x11 is now= 3.4560E+01
    echo x11 is now= {%ES11.4%x11}

    Place the FORTRAN format within '%' symbols followed by the register whose contents are to be substituted. All of this has to be enclosed within the wavy brackets.

  6. Samples of usage within SPIDER loops (on Unix).
     
          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
          -- sample loop for converting series of 1024 x 512 raw images  
          -- to SGI rgb format

    X11 = 1024 ; nsam X12 = 512 ; nrow DO LB1 I=1,1 ; loop VM ; use "imgcopy" to convert images frombin raw{***i}.$DATEXT sgi{***i}.rgb {****x11} {***X12} LB1 ; end loop

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    --sample loop for renaming/renumbering series of SPIDER images

    X33=33 DO LB2 I=1,4 ; loop VM ; system call for renumbering cp jnk{***X33}.vms jnk444{***I}.vms X33=X33+1 LB2 ; end loop

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    --sample loop for consecutively renaming/renumbering series of SPIDER -- while skipping any missing image numbers

    X11=0 ; initialize output file number counter DO LB3 I=1,4 ; loop FI N ; use "FI N" to see if file exists jnk{***I} ; filename IF(X2.LE.0)GOTO LB3 ; skip if file not found X11=X11+1 ; increment output file number counter VM ; system call for renaming/renumbering SPIDER images cp jnk{***I}.vms jnk444{***X11}.vms LB3 ; end loop xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    --Sample showing symbolic parameter substitution within a procedure

    X11=55 ; set register 11 outside of procedure ; (binding time for parameter substitution is ; before procedure is executed!) @testvm ; invoke <I>testvm</I> SPIDER procedure doc ; value given to FILENAME PATTERN solicited ; in <I>testvm</I> procedure Contents of invoked procedure <I>testvm</I>: FR ?ENTER FILENAME PATTERN?<1> VM rm <1>{***X11}.$DATEXT Result of invoked procedure: rm doc055.DAT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

SUBROUTINES

VMS

CALLER

DRIV1

© Copyright Notice /       Enquiries: spider@wadsworth.org

BACK TO SPIDER BACK TO WADSWORTH