-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
135 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# ![logo][] scanspec | ||
|
||
[![CI](https://github.com/dls-controls/scanspec/actions/workflows/code.yml/badge.svg)](https://github.com/dls-controls/scanspec/actions/workflows/code.yml) | ||
[![Coverage](https://codecov.io/gh/dls-controls/scanspec/branch/master/graph/badge.svg)](https://codecov.io/gh/dls-controls/scanspec) | ||
[![PyPI](https://img.shields.io/pypi/v/scanspec.svg)](https://pypi.org/project/scanspec) | ||
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) | ||
|
||
Specify step and flyscan Paths using combinations of: | ||
|
||
- Specs like Line or Spiral | ||
- Optionally Snaking | ||
- Zip, Product and Concat to compose | ||
- Masks with multiple Regions to restrict | ||
|
||
Serialize the Spec rather than the expanded Path and reconstruct it on the | ||
server. It can them be iterated over like a [cycler][], or a stack of scan Frames | ||
can be produced and expanded Paths created to consume chunk by chunk. | ||
|
||
[cycler]: https://matplotlib.org/cycler/ | ||
|
||
Source | <https://github.com/dls-controls/scanspec> | ||
--- | --- | ||
PyPI | `pip install scanspec` | ||
Documentation | <https://dls-controls.github.io/scanspec> | ||
Releases | <https://github.com/dls-controls/scanspec/releases> | ||
|
||
An example ScanSpec of a 2D snaked grid flyscan inside a circle spending 0.4s at | ||
each point looks like: | ||
|
||
```python | ||
from scanspec.specs import Line, fly | ||
from scanspec.regions import Circle | ||
|
||
grid = Line(y, 2.1, 3.8, 12) * ~Line(x, 0.5, 1.5, 10) | ||
spec = fly(grid, 0.4) & Circle(x, y, 1.0, 2.8, radius=0.5) | ||
``` | ||
|
||
![plot][] | ||
|
||
You can then either iterate through the scan positions directly for convenience: | ||
|
||
```python | ||
for point in spec.midpoints(): | ||
print(point) | ||
# ... | ||
# {'y': 3.1818181818181817, 'x': 0.8333333333333333, 'DURATION': 0.4} | ||
# {'y': 3.1818181818181817, 'x': 0.7222222222222222, 'DURATION': 0.4} | ||
``` | ||
|
||
or create a Path from the stack of Frames and consume chunks of a given length | ||
from it for performance: | ||
|
||
```python | ||
from scanspec.core import Path | ||
|
||
stack = spec.calculate() | ||
len(stack[0]) # 44 | ||
stack[0].axes() # ['y', 'x', 'DURATION'] | ||
|
||
path = Path(stack, start=5, num=30) | ||
chunk = path.consume(10) | ||
chunk.midpoints # {'x': <ndarray len=10>, 'y': <ndarray len=10>, 'DURATION': <ndarray len=10>} | ||
chunk.upper # bounds are same dimensionality as positions | ||
``` | ||
|
||
<!-- | ||
Anything below this line is used when viewing README.md and will be replaced | ||
when included in index.md | ||
--> | ||
|
||
[plot]: https://raw.githubusercontent.com/dls-controls/scanspec/master/docs/images/plot_spec.png | ||
[logo]: https://raw.githubusercontent.com/dls-controls/scanspec/master/docs/images/scanspec-logo.svg | ||
|
||
See https://dls-controls.github.io/scanspec for more detailed documentation. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
```{include} ../README.md | ||
:end-before: when included in index.md | ||
``` | ||
|
||
[plot]: images/plot_spec.png | ||
[logo]: images/scanspec-logo.svg | ||
|
||
How the documentation is structured | ||
----------------------------------- | ||
|
||
Documentation is split into four categories, also accessible from links in the | ||
side-bar. | ||
|
||
::::{grid} 2 | ||
:gutter: 4 | ||
|
||
:::{grid-item-card} {material-regular}`directions_walk;3em` | ||
:link: tutorials | ||
:link-type: doc | ||
|
||
Tutorials for installation and typical usage. New users start here. | ||
::: | ||
|
||
:::{grid-item-card} {material-regular}`directions;3em` | ||
:link: how-to | ||
:link-type: doc | ||
|
||
Practical step-by-step guides for the more experienced user. | ||
::: | ||
|
||
:::{grid-item-card} {material-regular}`info;3em` | ||
:link: explanations | ||
:link-type: doc | ||
|
||
Explanations of how it works and why it works that way. | ||
::: | ||
|
||
:::{grid-item-card} {material-regular}`menu_book;3em` | ||
:link: reference | ||
:link-type: doc | ||
|
||
Technical reference material including APIs and release notes. | ||
::: | ||
|
||
:::: | ||
|
||
```{toctree} | ||
:hidden: | ||
tutorials | ||
how-to | ||
explanations | ||
reference | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters