{"id":17113100,"url":"https://github.com/emmt/alpao.jl","last_synced_at":"2026-02-13T07:40:50.054Z","repository":{"id":71510219,"uuid":"105530633","full_name":"emmt/Alpao.jl","owner":"emmt","description":"A Julia Interface to Alpao SDK","archived":false,"fork":false,"pushed_at":"2021-07-09T14:52:11.000Z","size":39,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T02:50:34.664Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-02T12:17:05.000Z","updated_at":"2022-12-13T00:33:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"6821d9e2-f039-40b1-bf60-08db86a4f084","html_url":"https://github.com/emmt/Alpao.jl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/emmt/Alpao.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FAlpao.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FAlpao.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FAlpao.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FAlpao.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/Alpao.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FAlpao.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29398908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:03:07.724Z","updated_at":"2026-02-13T07:40:50.016Z","avatar_url":"https://github.com/emmt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Julia Interface to Alpao SDK\n\nThis module provides a [Julia](http://julialang.org/) interface to\n[ALPAO](https://www.alpao.com/adaptive-optics/) deformable mirrors.\n\n\n## Installation\n\nTo be able to use this module, you must have installed\n[ALPAO](https://www.alpao.com/adaptive-optics/) Software Development Kit (SDK)\nand have one of their deformable mirror connected to your computer.\n\nThe easiest way to install `Alpao` is via Julia registry\n[`EmmtRegistry`](https://github.com/emmt/EmmtRegistry):\n\n```julia\nusing Pkg\npkg\"registry add https://github.com/emmt/EmmtRegistry\"\npkg\"add Alpao\"\n```\n\nIf Alpao SDK dynamic library is not automatically found or if you want to use a\nspecific file, you can set he environment variable `ALPAO_SDK_DLL` to the path\nof Alpao SDK dynamic library before calling `Pkg.build(\"Alpao\")`.  For example:\n\n```julia\nENV[\"ALPAO_SDK_DLL\"] = \"/opt/alpao/lib64/libasdk.so\"\nusing Pkg\npkg\"build Alpao\"\n```\n\nSetting the environment variable is only needed before (re)building the\npackage.\n\nLater, it is sufficient to do:\n\n```julia\nPkg.update(\"Alpao\")\n```\n\nto pull the latest version.\n\n\n## Usage\n\nFirst import `Alpao` module:\n\n```julia\nimport Alpao\n```\n\nor\n\n```julia\nusing Alpao\n```\n\n(the two are equivalent since this module does not export any symbols).  Then\ncreate an instance, say `dm`, of `Alpao.DeformableMirror`:\n\n```julia\ndm = Alpao.DeformableMirror(name)\n```\n\nwhere `name` identify Alpao's deformable mirror to manage.  This name must\nmatch that of its configuration file (see [Configuration](#configuration)\nbelow).\n\nThe deformable mirror instance `dm` can be used to set the shape of the\ndeformable mirror:\n\n```julia\nsend(dm, cmd)\n```\n\nwhere `cmd` is a vector of actuator values.  The number of actuators is given\nby `length(dm)` and the type of the actuator values is given by `eltype(dm)`.\nIt is also possible to repeatedly send patterns to the deformable mirror with:\n\n```julia\nsend(dm, pat, rep)\n```\n\nThere is a variant `send!` which uses no temporary array and, on return, leaves\nthe actual command values in `cmd` (or `pat`).\n\nTo reset the deformable mirror values, call:\n\n```julia\nreset(dm)\n```\n\nand to stop asynchronous commands sent to the deformable mirror, call:\n\n```julia\nstop(dm)\n```\n\nParameters of the mirror can be queried by:\n\n```julia\ndm[key]\n```\n\nwhere `key` is the name of the keyword corresponding to the parameter.  To set\na parameter to a value, say `val`, simply do:\n\n```julia\ndm[key] = val\n```\n\nThe list of parameter keywords is given below (note that some parameter are\nread or write only):\n\n| Keyword         | Get | Set | Value | Description                             |\n|:----------------|:---:|:---:|:-----:|:----------------------------------------|\n| \"AckTimeout\"    |  x  |  x  |  \u003e 0  | For Ethernet / USB interface only,      |\n|                 |     |     |       | set the time-out (ms); can be set in    |\n|                 |     |     |       | synchronous mode only (see SyncMode).   |\n| \"DacReset\"      |     |  x  |  1    | Reset all digital to analog converters  |\n|                 |     |     |       | of drive electronics.                   |\n| \"ItfState\"      |  x  |     |  0:1  | Return 1 if PCI interface is busy or 0  |\n|                 |     |     |       | otherwise.                              |\n| \"LogDump\"       |     |  x  |  1    | Dump the log stack on the standard      |\n|                 |     |     |       | output.                                 |\n| \"LogPrintLevel\" |  x  |  x  |  0:4  | Changes the output level of the logger  |\n|                 |     |     |       | to the standard output.                 |\n| \"NbOfActuator\"  |  x  |     |  ≥ 1  | Get the numbers of actuator for that    |\n|                 |     |     |       | mirror.                                 |\n| \"SyncMode\"      |     |  x  |  0:1  | 0: Synchronous mode, will return when   |\n|                 |     |     |       |    send is done.                        |\n|                 |     |     |       | 1: Asynchronous mode, return            |\n|                 |     |     |       |    immediately after safety checks.     |\n| \"TriggerMode\"   |     |  x  |  0:1  | Set mode of the (optional) electronics  |\n|                 |     |     |       | trigger output. 0: long pulse width or  |\n|                 |     |     |       | 1: short pulse width on each command.   |\n| \"TriggerIn\"     |     |  x  |  0:2  | Set mode of the (optional) input        |\n|                 |     |     |       | trigger. 0: disabled, 1: trig on rising |\n|                 |     |     |       | edge or 2: trig on falling edge.        |\n| \"UseException\"  |  x  |  x  |  0:1  | Enables or disables the throwing of an  |\n|                 |     |     |       | exception on error.                     |\n| \"VersionInfo\"   |  x  |     |  \u003e 0  | Alpao SDK core version, e.g. 3040500612 |\n|                 |     |     |       | is SDK v3.04.05.0612 where 0612 is      |\n|                 |     |     |       | build number.                           |\n\nTo retrieve the version of the SDK as an instance of `VersionNumber`, just call:\n\n```julia\nVersionNumber(dm)\n```\n\nThe last error in the SDK can be retrieved with:\n\n```julia\nAlpao.lasterror()\n```\n\nwhich pops the last error from the stack and returns an error code and the\ncorresponding message as a tuple: `(code, mesg)`.\n\n\n## Configuration\n\nAll mirrors from ALPAO are referenced by a unique serial number, you can find\nit on the back of the mirror, for example `S/N: BAL002` indicates that `BAL002`\nis the serial number.\n\nFor each mirror you will find two configuration files (where `BXXYYY` is the\nserial number):\n\n* `BXXYYY.acfg` which is an ASCII files describing the interface.\n\n* `BXXYYY` which is a binary file.\n\nThe configuration files should be in one of these folders: `.`, `..`,\n`$ACECFG`, `$ACEROOT`, `./config`, `../config`, `$ACECFG/config` or\n`$ACEROOT/config`.  These folders are searched in that order and `$ACECFG` and\n`$ACEROOT` are the respective values of the environment variables `ACECFG`,\n`ACEROOT`.\n\n\n## Type Correspondences\n\nC-types are defined in `asdkType.h` and function prototypes in `asdkWrapper.h`\nof the Alpao SDK.\n\nAll functions but 2 return status with type `COMPL_STAT` which is an\nenumeration (hence a `Cint`) with 2 possible values: 0 for success and -1 for\nfailure.  The other functions are `asdkInit` which returns a pointer to a\nstructure (considered as anonymous, hence a `Ptr{Void}` here) and\n`asdkPrintLastError` which returns nothing.\n\nThe other C types used in the API are `Int` and `UInt` which are 32-bit\nintegers, `CString` and `CStrConst` which are C-strings, `Scalar` which is C\n`double` and `Size_T` which is `size_t`.\n\nThe following table summarizes the types:\n\n| Alpao API   | C Type        | Julia Type               |\n|:------------|:--------------|:-------------------------|\n| `Char`      | `char`        | `Cchar`                  |\n| `UChar`     | `uint8_t`     | `UInt8`                  |\n| `Short`     | `int16_t`     | `Int16`                  |\n| `UShort`    | `uint16_t`    | `UInt16`                 |\n| `Int`       | `int32_t`     | `Int32`                  |\n| `UInt`      | `uint32_t`    | `UInt32`                 |\n| `Long`      | `int64_t`     | `Int64`                  |\n| `ULong`     | `uint64_t`    | `UInt64`                 |\n| `Size_T`    | `size_t`      | `Csize_t`                |\n| `Scalar`    | `double`      | `Cdouble`                |\n| `asdkDM*`   | `struct DM*`  | `Ptr{Void}`              |\n| `CString`   | `char*`       | `Cstring` / `Ptr{UInt8}` |\n| `CStrConst` | `char const*` | `Cstring` / `Ptr{UInt8}` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Falpao.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Falpao.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Falpao.jl/lists"}