TABLE OF CONTENTS
::pwtk::xcd::makeFigs
SYNOPSIS
proc ::pwtk::xcd::makeFigs {fileList scriptList type {reduce 3}} {
PURPOSE
Make figures with xcrysden.
ARGUMENTS
- fileList -- list of I/O files for which to create snapshot figures
- scriptList -- list of xcrysden state scripts; these scripts will be executed for each file in $fileList
- type -- type of the structure (initial | latest | optimized)
- reduce -- whether to reduce the dimension of the structure (3 = bulk, 2 = slab, 1 = polymer, 0 = molecule)
SOURCE
variable scriptFID variable runScript variable scriptOption set emptyScript 0 if { $scriptList == {} } { # user didn't supply a script, make an empty script set emptyScript 1 set scriptList [file join [::fileutil::tempdir] dummy.xcrysden] ::pwtk::writeFile $scriptList "" } # write and run xcrysden scripts and make figures ... foreach file $fileList { set head [file rootname [file tail $file]] set figGroup {} foreach script $scriptList { set scriptHead [file rootname [file tail $script]] if { $emptyScript } { set prefix ${head}_${type} } else { set prefix ${head}_${type}_$scriptHead } set scriptName $prefix.xcrysden set printFile $prefix.png lappend figGroup $printFile set scriptFID [open $scriptName "w"] make_script_ $script $file $printFile $reduce close $scriptFID if { $runScript == 1 } { catch {exec xcrysden $scriptOption $scriptName} } elseif { $runScript == 2 } { if { ! [file exists $printFile] } { catch {exec xcrysden $scriptOption $scriptName} } } } lappend figList $figGroup } return $figList }