#! /bin/bash # Last edited on 2021-01-11 07:51:09 by jstolfi # Reads the trace of a set of consecutive neurons in an elem_level simulation. # Plots the {M} or {H} modulator as a function of time. cmd="$0"; cmd="${cmd##*/}" show=$1; shift # 1 to display the plot fname="$1"; shift # Trace file name ineLo="$1"; shift # Index of first neuron. ineHi="$1"; shift # Index of last neuron. tLo="$1"; shift; # First time to plot. tHi="$1"; shift; # Last time to plot. vLo="$1"; shift # Min value to plot. vHi="$1"; shift # Max value to plot. which="$1"; shift # "I" for external, "S" for synaptic, or "J" for total. # END COMMAND LINE PARSING # ---------------------------------------------------------------------- # Prefix for temporary file names tmp="/tmp/$$" # Decide the column of the trace file to plot: if [[ "/${which}" == "/M" ]]; then pltexpr="(column(4))" varname="Recharge" elif [[ "/${which}" == "/H" ]]; then pltexpr="(column(5))" varname="Synaptic" else echo "{${cmd}}: ** invalid variable name \"${which}\"" 1>&2; exit 1 fi # Decide the title: if [[ ${ineLo} -lt ${ineHi} ]]; then title="Neurons ${ineLo} .. ${ineHi} - ${varname} modulator ${which}[t] (mV)" else title="Neuron ${ineLo} - ${varname} modulator ${which}[t] (mV)" fi hPix=1800 vPix=400 hTics=( `nmsim_choose_plot_tics.gawk -v vLo=${tLo} -v vHi=${tHi} -v nPix=${hPix}` ) vTics=( `nmsim_choose_plot_tics.gawk -v vLo=${vLo} -v vHi=${vHi} -v nPix=${vPix}` ) echo "{${cmd}}: title = ${title}" 1>&2 tfile="${tmp}_${which}.png" export GDFONTPATH="." gnuplot <