Currents¶
create_ramp_current ¶
create_ramp_current(n_pools: int, t_points: int, timestep__ms: Quantity__ms, start_currents__nA: Quantity__nA | list[Quantity__nA], end_currents__nA: Quantity__nA | list[Quantity__nA], offsets__nA: Quantity__nA | list[Quantity__nA] = 0.0 * nA) -> CURRENT__AnalogSignal
Create a matrix of ramp currents for multiple pools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_pools
|
int
|
Number of current pools to generate |
required |
t_points
|
int
|
Number of time points |
required |
timestep__ms
|
Quantity__ms
|
Time step in milliseconds as a Quantity |
required |
start_currents__nA
|
Quantity__nA | list[Quantity__nA]
|
Starting current(s) for the ramp in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
required |
end_currents__nA
|
Quantity__nA | list[Quantity__nA]
|
Ending current(s) for the ramp in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
required |
offsets__nA
|
Quantity__nA | list[Quantity__nA]
|
DC offset(s) to add to the ramp current(s) in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
0.0 * nA
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the parameters are lists and the length of the parameters does not match n_pools |
Returns:
| Type | Description |
|---|---|
INPUT_CURRENT__AnalogSignal
|
Analog signal of shape (t_points, n_pools) * pq.nA containing ramp currents |
Source code in myogen/utils/currents.py
create_step_current ¶
create_step_current(n_pools: int, t_points: int, timestep__ms: Quantity__ms, step_heights__nA: Quantity__nA | list[Quantity__nA], step_durations__ms: Quantity__ms | list[Quantity__ms], offsets__nA: Quantity__nA | list[Quantity__nA] = 0.0 * nA) -> CURRENT__AnalogSignal
Create a matrix of step currents for multiple pools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_pools
|
int
|
Number of current pools to generate |
required |
t_points
|
int
|
Number of time points |
required |
timestep__ms
|
Quantity__ms
|
Time step in milliseconds as a Quantity |
required |
step_heights__nA
|
Quantity__nA | list[Quantity__nA]
|
Step height(s) for the current(s) in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
required |
step_durations__ms
|
Quantity__ms | list[Quantity__ms]
|
Step duration(s) in milliseconds as Quantities. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
required |
offsets__nA
|
Quantity__nA | list[Quantity__nA]
|
DC offset(s) to add to the step current(s) in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
0.0 * nA
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the parameters are lists and the length of the parameters does not match n_pools |
Returns:
| Type | Description |
|---|---|
INPUT_CURRENT__AnalogSignal
|
Analog signal of shape (t_points, n_pools) * pq.nA containing step currents |
Source code in myogen/utils/currents.py
create_sinusoidal_current ¶
create_sinusoidal_current(n_pools: int, t_points: int, timestep__ms: Quantity__ms, amplitudes__nA: Quantity__nA | list[Quantity__nA], frequencies__Hz: Quantity__Hz | list[Quantity__Hz], offsets__nA: Quantity__nA | list[Quantity__nA], phases__rad: Quantity__rad | list[Quantity__rad] = 0.0 * rad) -> CURRENT__AnalogSignal
Create a matrix of sinusoidal currents for multiple pools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_pools
|
int
|
Number of current pools to generate |
required |
t_points
|
int
|
Number of time points |
required |
timestep__ms
|
Quantity__ms
|
Time step in milliseconds as a Quantity |
required |
amplitudes__nA
|
Quantity__nA | list[Quantity__nA]
|
Amplitude(s) of the sinusoidal current(s) in nanoamperes. |
required |
frequencies__Hz
|
Quantity__Hz | list[Quantity__Hz]
|
Frequency(s) of the sinusoidal current(s) in Hertz. |
required |
offsets__nA
|
Quantity__nA | list[Quantity__nA]
|
DC offset(s) to add to the sinusoidal current(s) in nanoamperes. |
required |
phases__rad
|
Quantity__rad | list[Quantity__rad]
|
Phase(s) of the sinusoidal current(s) in radians. |
0.0 * rad
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the amplitudes, frequencies, offsets, or phases are lists and the length of the parameters does not match n_pools |
Notes
If a parameter is provided as a single Quantity, it is broadcasted to all pools. If provided as a list, its length must match n_pools.
Returns:
| Type | Description |
|---|---|
INPUT_CURRENT__AnalogSignal
|
Analog signal of shape (t_points, n_pools) * pq.nA containing sinusoidal currents |
Source code in myogen/utils/currents.py
create_sawtooth_current ¶
create_sawtooth_current(n_pools: int, t_points: int, timestep__ms: Quantity__ms, amplitudes__nA: Quantity__nA | list[Quantity__nA], frequencies__Hz: Quantity__Hz | list[Quantity__Hz], offsets__nA: Quantity__nA | list[Quantity__nA] = 0.0 * nA, widths__ratio: float | list[float] = 0.5, phases__rad: Quantity__rad | list[Quantity__rad] = 0.0 * rad) -> CURRENT__AnalogSignal
Create a matrix of sawtooth currents for multiple pools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_pools
|
int
|
Number of current pools to generate |
required |
t_points
|
int
|
Number of time points |
required |
timestep__ms
|
Quantity__ms
|
Time step in milliseconds as a Quantity |
required |
amplitudes__nA
|
Quantity__nA | list[Quantity__nA]
|
Amplitude(s) of the sawtooth current(s) in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
required |
frequencies__Hz
|
Quantity__Hz | list[Quantity__Hz]
|
Frequency(s) of the sawtooth current(s) in Hertz. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
required |
offsets__nA
|
Quantity__nA | list[Quantity__nA]
|
DC offset(s) to add to the sawtooth current(s) in nanoamperes. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
0.0 * nA
|
widths__ratio
|
float | list[float]
|
Width(s) of the rising edge as proportion of period (0 to 1). Must be: - Single float: used for all pools - List of floats: must match n_pools |
0.5
|
phases__rad
|
Quantity__rad | list[Quantity__rad]
|
Phase(s) of the sawtooth current(s) in radians. Must be: - Single Quantity: used for all pools - List of Quantities: must match n_pools |
0.0 * rad
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the parameters are lists and the length of the parameters does not match n_pools |
Returns:
| Type | Description |
|---|---|
INPUT_CURRENT__AnalogSignal
|
Analog signal of shape (t_points, n_pools) * pq.nA containing sawtooth currents |
Source code in myogen/utils/currents.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
create_trapezoid_current ¶
create_trapezoid_current(n_pools: int, t_points: int, timestep__ms: Quantity__ms, amplitudes__nA: Quantity__nA | list[Quantity__nA], rise_times__ms: Quantity__ms | list[Quantity__ms] = 100.0 * ms, plateau_times__ms: Quantity__ms | list[Quantity__ms] = 200.0 * ms, fall_times__ms: Quantity__ms | list[Quantity__ms] = 100.0 * ms, offsets__nA: Quantity__nA | list[Quantity__nA] = 0.0 * nA, delays__ms: Quantity__ms | list[Quantity__ms] = 0.0 * ms) -> CURRENT__AnalogSignal
Create a matrix of trapezoidal currents for multiple pools.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_pools
|
int
|
Number of current pools to generate |
required |
t_points
|
int
|
Number of time points |
required |
timestep__ms
|
float
|
Time step in milliseconds |
required |
amplitudes__nA
|
float | list[float]
|
Amplitude(s) of the trapezoidal current(s) in nano Amperes. Must be: - Single float: used for all pools - List of floats: must match n_pools |
required |
rise_times__ms
|
float | list[float]
|
Duration(s) of the rising phase in milliseconds. Must be: - Single float: used for all pools - List of floats: must match n_pools |
100.0 * ms
|
plateau_times__ms
|
float | list[float]
|
Duration(s) of the plateau phase in milliseconds. Must be: - Single float: used for all pools - List of floats: must match n_pools |
200.0 * ms
|
fall_times__ms
|
float | list[float]
|
Duration(s) of the falling phase in milliseconds. Must be: - Single float: used for all pools - List of floats: must match n_pools |
100.0 * ms
|
offsets__nA
|
float | list[float]
|
DC offset(s) to add to the trapezoidal current(s) in nano Amperes. Must be: - Single float: used for all pools - List of floats: must match n_pools |
0.0 * nA
|
delays__ms
|
float | list[float]
|
Delay(s) before starting the trapezoid in milliseconds. Must be: - Single float: used for all pools - List of floats: must match n_pools |
0.0 * ms
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the parameters are lists and the length of the parameters does not match n_pools |
Returns:
| Type | Description |
|---|---|
INPUT_CURRENT__AnalogSignal
|
Analog signal of shape (t_points, n_pools) * pq.nA containing trapezoidal currents |
Source code in myogen/utils/currents.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 | |