/pscf

an implementation of P. K. Hopke's potential source contribution function (PSCF)

Primary LanguageR

This implementation of PSCF (Potential Source Contribution Function) is based on an interpretation of Pekney et al. (2006). It is written mostly in R with S4 object classes to provide multimethods for mapping functionality, though these details are largely hidden from users. This set of scripts has been used to generate PSCF and trajectory maps for a number of studies. The author of this program has recently discovered that there is also a program called TrajStat, distributed through the NOAA ARL website, which provides the similar (possibly more advanced) functionality for PSCF analysis of airmass backtrajectories.

Based on meteorological backtrajectories generated by HYSPLIT, this collection of scripts can be used to generate PSCF maps, density maps, and colored backtrajectory maps for groupings of the user's choosing. Concentrationed-Weighted Trajectory analysis (CWT) and Residence Time Analysis (RTA) can also be implemented using the functions provided here.

Utility scripts to download meteorological files and run HYSPLIT in batch-mode are included.

Instructions and demonstration of included functions are included as 'Instructions.pdf' and 'PSCFdemo.pdf', respectively. Since the creation of the instructions document, an R-only implementation of 'runHYSPLIT.py' has been added ('runHYSPLIT.r') -- if HYSPLIT is being run on a Windows virtual machine (e.g., through VirtualBox or Parallels), Python would not have to be additionally installed to run HYSPLIT as was previously required. For this configuration, R is the only additional program required on the guest OS (R is assumed to be installed for generating PMF [Positive Matrix Factorization] solutions in batch-mode [distributed as a separate program]).

The 'getmetfiles.py' script can generate a list of metfiles required by the range of times specified in the input file (nominally, 'userinputs/input.txt', generated by 'generateInputs.r') and obtain them using wget or curl. For users of HYSPLIT on a Windows virtual machine, this script can be run on the Mac/Linux host and the meteorological files can be downloaded to a shared folder [appearing as a mapped network drive on the Windows side].

DOI

TODO:

  • use rasterImage() in place of image().
  • originally migrated from SVN. keywords removed, but add git attributes.