// $Id: x_replay.g,v 16.1 2000/03/02 14:43:39 ajay Exp $ //genesis - replaygraph.g // Reads in firing data of pyr, int_a and int_b neurons from // files in {datadir} include constants setclock 0 {dt} create xform /replay [0,0,300,125] create xlabel /replay/label -label "Replay Control" -bg cyan create xbutton /replay/RUN -wgeom 50% -script step_tmax create xdialog /replay/NSTEP -xgeom 0:RUN -ygeom 0:label -value 100 \ -wgeom 50% -script "nstep " create xbutton /replay/RESET -wgeom 33% -script reset create xbutton /replay/STOP -xgeom 0:RESET -ygeom 0:NSTEP \ -wgeom 33% -script stop create xbutton /replay/QUIT -xgeom 0:STOP -ygeom 0:NSTEP \ -wgeom 34% -script quit create xdialog /replay/simfile -label "datafile (omit ext)" \ -value data1 xshow /replay function step_tmax step {tmax} -time end function nstep(widget) str widget echo doing {getfield {widget} value} steps step {getfield {widget} value} end create diskio /din \ -filename {datadir}/{getfield /replay/simfile value}.cdf \ -accessmode r call /din RESET function replay int numpyr, numinta, numintb int ny_pyr_start, ny_pyr_end int ny_inta_start, ny_inta_end int ny_intb_start, ny_intb_end int i,j echo nx = {getfield /din nx} echo ny = {getfield /din ny} //****************************************************** // This assumes that the order of saving messages in the // output data file is: // 1. pyr[] // 2. int_a[] // 3. int_b[] //******************************************************** numpyr = {npyr_to_save} numinta = {ninta_to_save} numintb = {nintb_to_save} ny_pyr_start = 0 ny_pyr_end = numpyr ny_inta_start = ny_pyr_end ny_inta_end = ny_inta_start + numinta ny_intb_start = ny_inta_end ny_intb_end = ny_intb_start + numintb echo ny_pyr_start = {ny_pyr_start} echo ny_pyr_end = {ny_pyr_end} echo ny_inta_start = {ny_inta_start} echo ny_inta_end = {ny_inta_end} echo ny_intb_start = {ny_intb_start} echo ny_intb_end = {ny_intb_end} create xform /xpyr [312,0,600,600] create xgraph /xpyr/graph -xgeom 0 -ygeom 5% -wgeom 100% -hgeom 100% \ -XUnits time(s) -YUnits cell_# \ -xmax {tmax} -ymax {numpyr} \ -title "Pyramidal cell firing" xshow /xpyr for (i=0; i<1; i=i+1) for (j=ny_pyr_start; j