Useful Stuff Programs, Scripts, and More

SPCAT/SPFIT

For fitting and predictions in rotational spectroscopy, it’s hard to beat Pickett’s classic suite of programs. It’s fast, accurate, and extremely powerful. That being said, the input syntax and sheer number of parameters can often be daunting for the new user. However, the original documentation by Pickett is quite thorough, which can be found here.
In addition, if you’re looking for something slightly less dense and more annotated, Zbignew Kisiel has written a wonderful quick reference for Pickett’s suite, which can be found here.

JB95

Although it’s not quite as accurate for assignment of pure rotational spectra as suites such as Kisiel’s AABS (described below), JB95 is incredibly useful when fitting one or multiple unassigned species in a single broadband spectrum. The efficiency of JB95 for fitting and exploration of broadband spectra is due to its slider tools and linearized predictions, which allow the user to adjust A / B+C / B-C in real time, or even the relative intensities between a/b/c-type transitions.
After a fairly small learning curve, JB95 can be quite intuitive and features a number of useful extras such as quadrupole and internal rotation predictions. You can find the program and relevant documentation, courtesy of Plusquellic, here. (Editor’s hint: Learn the keyboard shortcuts, and watch your spectrum fitting speed increase by an order of magnitude)

PROSPE

PROSPE has something for everybody doing rotational spectroscopy and, thankfully, everything is well documented. Many of the programs are by Kisiel himself, and many of them are used daily here in lab. The database has programs for just about anything, but we’ve compiled a list below of some of our favorites:

AABS – Kisiel’s graphical front-end to SPCAT/SPFIT. AABS’s automated Gaussian line center determination is immensely helpful for final, publication-quality fits.
KRA / PMFIST – The dynamic duo of Kraitchman structure determination in the Pate group. KRA is perhaps the most intuitive program for Kraitchman ever written, and use of PMFIST coupled with GLE gives an easy route to high quality, scalable figures for publication. UPDATE: The new version of KRA now outputs an additional input file for use with EVAL. Very convenient!
STRFIT – It’s got a steep learning curve, but there’s no denying it’s extremely powerful program for least-squares structure fitting. Kisiel’s great documentation and description on PROSPE is better than anything that could be written here, so we direct the reader to his page regarding this program.
PIFORM – A simple but essential addition to SPFIT; takes SPFIT output files and makes them a lot more organized and easy to read.
XIAM – Holger Hartwig’s internal rotation program is easy to use and very fast. A great starting point for internal rotation problems, and has served us extremely well for most three-fold rotor problems we’ve dealt with.
QSTARK – Kisiel’s excellent and easy to use Stark effect fitting program. Ribeaud’s original STARK is great, but QSTARK can do Stark with a single quadrupole, so rejoice, fans of nitrogen and chlorine!
EVAL – Have a set of Cartesian coordinates from a Kraitchman or least-squares fit? Want internal coordinates for a table in your paper but you don’t want to do it by hand? Kisiel’s EVAL will do it for you.

Python


A new push in the Pate group is to move towards an easily maintainable and open-source platform for data analysis and system automation. Although FORTRAN has been a staple in scientific computing for decades, it can be quite difficult to interpret and write for newer generations of scientists raised in a world after FORTRAN's prime. Although modern software such as MATLAB, Mathcad, and Mathematica is powerful and easy to learn, the price tags for licenses can be high and the code is often not portable between platforms.
Python offers us a unique chance to move into a new era of scientific analysis: a highly portable and easy to learn language with a deep and open source library of numerical analysis code already available.

Below we offer a number of useful Python scripts and programs, ranging from essential data workup routines to helpful tools. This list will be constantly expanding as we write new things and previous versions will be updated as we fix things, so feel free to check back often!

The following programs require a recent Python distribution, as well as the following packages: Easygui; Scipy & Numpy; PyLab; Matplotlib.

1) Spectrum Cutter
This program will cut out a given set of lines in one-column format from an input spectrum. The default cut width is 350 kHz, but this can be changed in the source by modifying the width variable.

2) Peakpicker
Outputs a two-column list of all lines in a spectrum with intensity above the user-defined intensity threshold.

3) Spectrum Generator from SPCAT files
Generates a predicted spectrum from an input *.cat output file from SPCAT. Settings to the point separation can be made by adjusting the step variable; frequency cutoffs can be adjusted by changing start_freq and stop_freq, and the Gaussian linewidth is set to a default of 50 KHz (can be changed in line 69 by adjusting the linewidth input in the Test_Spectrum() call).

4) Autofit Output Cutter
Outputs the first 1000 lines from a sorted_omc_cat output from Autofit. Just place the script in the same folder as the sorted_omc_cat.txt file and run!

5) SPCAT Input File Generator and Spectrum Generator
Simplifies generation of SPCAT input files with an easy-to-use input GUI. Supports file generation for simple asymmetric rotors with centrifugal distortion up to sextics and with up to one quadrupolar nucleus. With the included SPCAT executable (Windows only at the moment!), you can easily generate predictive spectra for your system of interest. Implenting new options, such as symmetric tops or multiple quadrupolar nuclei (or any kind of system SPCAT is able to handle), into the source code is fairly easy.

Autofit


Introduction

Autofit is our automated rotational spectrum fitting program, which takes a initial set of parameters and a peakpicked spectrum, and checks every A/B/C triplet combinatorically allowed given some OMC error threshold. All of this is done by using a Python wrapper over Pickett’s SPCAT and SPFIT. Initial work on this program was done here at UVa, but the exclusive acknowledgement for the version presented here goes to Dr. Steve Shipman, of New College of Florida, and Ian Finneran, now at Caltech. Read below for a more detailed breakdown of the program:

   1) Input a set of “guess” rotational constants (incl. distortion, dipole moments); constraints on the SPCAT prediction; and a two-column broadband spectrum peakpick (frequency of line centers vs intensity).
   2) Choose three transitions with a sufficient linear dependence to fit (program automatically calculates correlation matrix)
   3) Choose an arbitrary number of additional transitions to “check” triplet generated by fitting the three transitions chosen in step 2, and choose an OMC threshold between the initial guess predictions and peakpick frequencies.
   4) Program will then check every possible triplet of peakpicked lines within the given threshold.
   5) Program scores the fits by OMC and outputs a sorted list of triplets in order of increasing OMC.

The entirety of the prediction and fitting subroutines are done by generating input files for Pickett’s SPCAT and SPFIT, and running Pickett’s suite for each triplet. This program is fully parallelizable, so the Autofit routine will generate N instances of SPFIT for N cores.
At the moment, Autofit can check around 250 triplets a second on 8 logical cores of an Intel Core i7-3770S at stock settings; a standard run for us is generally around 5 million triplets, which at the rate of 250 Hz is about 6 hours. A run on a sufficiently dense spectrum (>10 million triplets) is usually done overnight.

Installation & First Run

There are a likely a number of (equally) easy approaches to getting Autofit to run in Windows, but the essential components are as follows:

Autofit (Python source)
Python distribution for Windows
Easygui
Numpy

As a shell, we like to use Cygwin instead of the Command Prompt for running Autofit. Cygwin is a bash emulator for Windows, and works remarkably well. With a little work, it’s also possible to use Windows PowerShell in lieu of Cygwin, as well.

To install and run on Windows, follow these easy steps:
   1) Install Python distribution
   2) Install Easygui
   3) Install Cygwin; there are a lot of options in this install (since Cygwin comes with a ton of optional packages; if you want a rich, Unix-like experience, feel free to add packages as you please), but for a minimal and functional installation just keep hitting “Next” and keeping everything default.
   4) Put autofit program in a folder along with SPFIT.exe and SPCAT.exe (available in the “Programs We Like” tab)
   5) In Cygwin, navigate to autofit folder, and type “python prog_A_vX.py” and execute. If everything works, you should get the autofit GUI pop up and ask you for a project name.

LINUX UPDATE (11/27/12):

A Linux version of Autofit is now available! It has been tested on Ubuntu 12.10, x86_64 distribution. You can retrieve a tarball of the source with compiled SPCAT/SPFIT binaries here! Note: The SPCAT/SPFIT binaries are 32-bit, so they might require you to have all the necessary ia32 libraries to run them. 32-bit Linux should run everything fine, though this has not been tested.

Additional notes

-    Autofit can also accept input files to automate the setup process, which are generated automatically when you start a run. An example input file can be found at the beginning of the Autofit source.
-    Autofit only fits A/B/C triplets. Any value for the distortion constants is treated as fixed.
-    In theory, Autofit should find hits for spectra complicated by hyperfine or internal rotation, but naturally the program works best with simple rigid rotor spectra.
-    Due to the nature of the algorithm, Autofit can produce unphysical results.
-    A new run requires a new and unique project name; if you mess up your input on a project and need to start over, you need to delete the project folder it creates and then rerun.
-    Make sure to set all values in the input file that are zero to zero; blank entries will cause the program to fail.
-    Careful not to double click the GUI while inputting constants or choosing transitions to check. This will make the program skip to the next step and likely screw up your project.
-    When Autofit completes a run, it outputs the sorted list of triplets as “sorted_omc_cat.txt”; this file can often be upwards of 2 gigabytes, so be careful opening it in Notepad or an equivalent reader. For these large output files, we recommend using the Autofit reader script available on the Scripts tab.
- The OMC scores in the sorted output are in MHz.

Future Work

   1) Improving performance: Since the program is limited to fitting only A/B/C triplets, the use of SPCAT/SPFIT is somewhat overkill. Though there’s no doubt that Pickett’s program is quite fast and accurate, the loading of updated SPCAT predictions for a given triplet is likely a bottleneck for the program. Adding additional choices to limit SPCAT predictions by, for example, setting constraints on K should help alleviate some of this slowdown, but these have yet to be implemented. Ultimately, creating a simple rigid rotor prediction and fitting program in Python for use in Autofit might be the best solution long term.
   2) Autofit is fully parallelizable, but as stated earlier, it relies on generating N instances of SPFIT for N cores. Moving to a suite fully in Python should make this a more efficient process.
   3) A future endeavor will be to create a new version that takes advantage of NVIDIA’s excellent CUDA architecture for parallelization. The new GeForce GTX 690 has 3072 CUDA cores over two GPUs, and a memory speed of nearly 6 Gbps, which should lead to orders of magnitude improvement in run speeds for Autofit.
2011 Nova all rights reserved. Luiszuno.com