Example #1
0
 def probes(self, gid):
     # Use keyword arguments to check that the wrappers have actually declared keyword arguments correctly.
     # Place single-location probes at (location 0 0.01*j) where j is the index of the probe address in
     # the returned list.
     return [
         # probe id (0, 0)
         A.cable_probe_membrane_voltage(where='(location 0 0.00)'),
         # probe id (0, 1)
         A.cable_probe_membrane_voltage_cell(),
         # probe id (0, 2)
         A.cable_probe_axial_current(where='(location 0 0.02)'),
         # probe id (0, 3)
         A.cable_probe_total_ion_current_density(where='(location 0 0.03)'),
         # probe id (0, 4)
         A.cable_probe_total_ion_current_cell(),
         # probe id (0, 5)
         A.cable_probe_total_current_cell(),
         # probe id (0, 6)
         A.cable_probe_density_state(where='(location 0 0.06)',
                                     mechanism='hh',
                                     state='m'),
         # probe id (0, 7)
         A.cable_probe_density_state_cell(mechanism='hh', state='n'),
         # probe id (0, 8)
         A.cable_probe_point_state(target=0, mechanism='expsyn', state='g'),
         # probe id (0, 9)
         A.cable_probe_point_state_cell(mechanism='exp2syn', state='B'),
         # probe id (0, 10)
         A.cable_probe_ion_current_density(where='(location 0 0.10)',
                                           ion='na'),
         # probe id (0, 11)
         A.cable_probe_ion_current_cell(ion='na'),
         # probe id (0, 12)
         A.cable_probe_ion_int_concentration(where='(location 0 0.12)',
                                             ion='na'),
         # probe id (0, 13)
         A.cable_probe_ion_int_concentration_cell(ion='na'),
         # probe id (0, 14)
         A.cable_probe_ion_ext_concentration(where='(location 0 0.14)',
                                             ion='na'),
         # probe id (0, 15)
         A.cable_probe_ion_ext_concentration_cell(ion='na'),
         # probe id (0, 15)
         A.cable_probe_stimulus_current_cell()
     ]
    # Spike detection at center of soma.
    decor.place('"center"', arbor.spike_detector(-26))

    #define CV policy and add it to decor
    #policy = arbor.cv_policy_every_segment('(all)')
    policy = arbor.cv_policy_fixed_per_branch(1, '(all)')
    #policy = arbor.cv_policy_max_extent(1.0)
    decor.discretization(policy)

    # (4) Create cell.
    dd1_cell = arbor.cable_cell(morph, labels, decor)

    # (5) Create probes for membrane voltage and calcium ion concentration.
    voltage_probe = arbor.cable_probe_membrane_voltage('"center"')
    ca_conc_probe = arbor.cable_probe_ion_int_concentration('"center"', "ca")


    # Instantiate recipe
    # Pass the probe in a list because that it what single_recipe expects.
    #recipe = single_recipe(dd1_cell, [voltage_probe]) #, ca_conc_probe])
    recipe = single_recipe(dd1_cell, [voltage_probe, ca_conc_probe])

    context = arbor.context()

    domains = arbor.partition_load_balance(recipe, context)

    sim = arbor.simulation(recipe, domains, context)

    # Instruct the simulation to record the spikes
    sim.record(arbor.spike_recording.all)