map2png.py -- 2D maps of --export-map as PNG
============================================
Renders every <stem>.*.map.dat file runEDDB writes with --export-map (ICSS
shielding maps, ED / EDDB / EDLB / BDF density slices, nc-AFM and STM images,
and the current-density maps jcur / jcur-edlb / jcur-eddb). numpy + matplotlib.

Usage
  python3 map2png.py FILE.map.dat [more files] [-o OUT.png] [--range A|VMIN,VMAX]
                     [--levels L1,L2,...] [--clip R] [--cmap NAME] [--arrows N]
                     [--stream] [--dpi N]

  * one file -> one panel; several files on one command line -> one row of panels
    in one PNG (default name: the first .map.dat name with .png; -o sets it)
  * scalar maps (ICSS, densities, AFM, STM): filled colour map of the value
    column; --range fixes the colour scale (A = -A..A, or VMIN,VMAX, written
    --range=-1,5 when VMIN < 0; --vmax A is the same), --levels adds labelled contour lines (ICSS: Kleinpeter's
    iso-chemical-shielding surfaces, e.g. 5,2,1,0.5,-0.1), --clip R crops the
    lattice to |u|,|v| <= R, --cmap picks a matplotlib colour map
  * current maps (9 columns u v x y z Ju Jv Jn J_dia): background = J_dia, the
    in-plane current signed diatropic + (red) / paratropic - (blue), symmetric
    colour scale; the in-plane vector (Ju, Jv) as arrows every N-th node
    (--arrows, default 2; 0 = none) or as streamlines (--stream, line width
    follows |J|)
  * the plane and the lattice come from the file header (--map-plane,
    --map-step, --map-slab of the runEDDB run)

Examples
  runEDDB -i benzene.fchk --nics-rings 6 --export-map icss,jcur,jcur-eddb -n 8
  python3 map2png.py benzene.ICSS.map.dat                 # shielding map, ppm

  runEDDB -i benzene.fchk --export-map icss,icss-edlb,icss-eddb --map-plane x=0 \
          --map-step 0.1 --cube-margin 7 -n 16               # side view, ring in xy
  python3 map2png.py benzene.ICSS.map.dat benzene.ICSS_EDLB_G.map.dat \
          benzene.ICSS_EDDB_G.map.dat --range 5 --levels 5,2,1,0.5,-0.1 --clip 7
  python3 map2png.py benzene.JCUR.map.dat --arrows 2      # total current, arrows
  python3 map2png.py benzene.JCUR_EDDB_G.map.dat --stream # EDDB current, streamlines
  python3 map2png.py benzene.JCUR_MOS.map.dat             # the --nmr-mos set

  runEDDB -i @coronene --nics-rings 6 --export-map jcur --map-plane fit,1.0 --map-step 0.15
  python3 map2png.py coronene.JCUR.map.dat --vmax 3

Reading the current maps
  Viewed along the field axis of the run (printed in the header and oriented with
  its largest component positive), a diatropic ring current runs clockwise and is
  red; paratropic is anticlockwise and blue. Units nA T^-1 A^-2 per tesla of
  applied field. The APPROXIMATE lanes (any SCF file without an NMR job, GFN2-xTB)
  are marked in the header and in the figure title; see manual, section 7.
