Esempio n. 1
0
import sys
import pyqtgraph as pg
from neuroanalysis.ui.fitting import FitExplorer
from aisynphys.database import default_db as db
from aisynphys.avg_response_fit import get_pair_avg_fits
from aisynphys.ui.avg_response_fit import AvgResponseFitUi

app = pg.mkQApp()
pg.dbg()

session = db.session()

expt_id, pre_cell_id, post_cell_id = sys.argv[1:4]
pair = db.experiment_from_ext_id(expt_id, session=session).pairs[pre_cell_id,
                                                                 post_cell_id]

ui = AvgResponseFitUi()

fits = get_pair_avg_fits(pair, session=session, ui=ui)

ui.widget.show()

fe = FitExplorer(fits['vc', -55]['fit_result'])
fe.show()

if sys.flags.interactive == 0:
    app.exec_()
Esempio n. 2
0
    parser.add_argument('pre_cell_id', type=str, nargs='?', default=None)
    parser.add_argument('post_cell_id', type=str, nargs='?', default=None)

    args = parser.parse_args(sys.argv[1:])

    if args.dbg:
        pg.dbg()

    default_session = db.session()
    notes_session = notes_db.db.session()
    # timestamps = [r.acq_timestamp for r in db.query(db.Experiment.acq_timestamp).all()]
    timestamps = []
    
    mw = MainWindow(default_session, notes_session)
    if args.timestamps is not None:
        timestamps = args.timestamps
    elif args.expt_id is not None:
        timestamps = [args.expt_id]
    
    q = default_session.query(db.Experiment).filter(db.Experiment.acq_timestamp.in_(timestamps))
    expts = q.all()
    mw.set_expts(expts)

    if None not in (args.expt_id, args.pre_cell_id, args.post_cell_id):
        expt = db.experiment_from_ext_id(args.expt_id)
        pair = expt.pairs[args.pre_cell_id, args.post_cell_id]
        mw.experiment_browser.select_pair(pair.id)

    if sys.flags.interactive == 0:
        app.exec_()
                        decay_tau=fit_par.fit_decay_tau,
                        xoffset=fit_par.fit_latency,
                        yoffset=fit_par.fit_yoffset,
                        rise_power=2,
                    )
                    c = plt.plot(ts.time_values, fit, pen=(0, 255, 0, 100))
                    c.setZValue(10)
                    c.setPos(*shift)


if __name__ == '__main__':
    import sys

    app = pg.mkQApp()
    pg.dbg()

    win = DynamicsWindow()
    win.show()

    if len(sys.argv) > 1:
        expt_id, pre_cell, post_cell = sys.argv[1:]
        expt = db.experiment_from_ext_id(expt_id)
        win.browser.populate([expt])
        pair = expt.pairs[pre_cell, post_cell]
        win.browser.select_pair(pair.id)
    else:
        win.browser.populate()

    if sys.flags.interactive == 0:
        app.exec_()