Skip to main content

attune

image

Tools for tuning optical parametric amplifiers and multidimensional spectrometers.

Documentation is available at https://attune.wright.tools/en/latest/.

Overview

attune has three primary jobs:

  1. attune parses calibration data to find optimal motor positions

    # data has scans of a motor position ("OPA1_SHS_crystal") against a signal
    # ("signal") for a set of second harmonic signal color setpoints
    # ("opa_color")
    calibration_data = wt.open(path_to_data.wt5)
    calibration_data.transform("opa_color", "motor")
    args = {
        "data": calibration_data,
        "channel": "signal",
        "arrangement": "SHS",
        "tune": "SHS_crystal",
        "instrument": "OPA1",
    }
    tuned_opa1 = attune.intensity(**args)
    
  2. attune organizes optimal motor positions. The motor positions are stored in a hierarchy of mappings. Beginning at the lowest level:

    • Tune : a map of OPA color (the "independent") to positions of a single motor (the "dependent").

      my_tune = attune.Tune(
          independent=[450, 600, 700],
          dependent=[3.225, 2.332, 1.987]
      )  # relate color to bbo angle
      
    • Arrangement : a collection of Tunes that define a concerted process (e.g. to generate idler photons, one might move several motors (bbo, g1, etc.))

      idler = attune.Arrangement("idler", dict(bbo=my_tune, g1=my_other_tune))
      
    • Instrument : a collection of Arrangements (e.g. an OPA may have signal and idler)

      my_opa = attune.Instrument({"idler": idler, "signal": signal}, name="opa1")
      

      Note: arrangements can be called as tunables if they exist in the same instrument. This can allow nested naming

      shi = attune.Arrangement(Dict(
          idler = Tune(shi_colors, idler_colors), 
          sh_crystal = Tune(shi_colors, angles)
      )) 
      
  3. attune stores motor mappings and remembers them through version tracking.

    • save a new instrument (or update an existing one)

      attune.store(my_opa)
      
    • lookup a saved instrument (by name)

      attune.catalog()  # lists all saved instruments
      my_opa = attune.load("opa1")  # fetches the most recent version of the instrument
      my_previous_opa = attune.undo(my_opa) # fetches the previous version of the instrument
      my_old_opa = attune.load("opa1", time="yesterday")  # optional kwarg specifies the version by time of usage    
      

Notes

  • attune uses default units of nanometers ("nm") for its independent variables. At this time, units cannot be changed, so alternate units must be handled externally (PRs are welcome!). WrightTools calibration data is automatically converted into "nm" units for parsing.

Metadata

Release files for attune 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attune 0.5.1
File Size Uploaded
attune-0.5.1.tar.gz 26.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for attune 0.5.1
File Interpreter ABI Platform
attune-0.5.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 58.9 kB

Release files / attune-0.5.1.tar.gz

Download URL attune-0.5.1.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d67d3db7c255143c4d1d8915396b77acae2d8b7ac316d9fbe8a56cc2fe64c10a
BLAKE2b-256 checksum
How to use checksums
78d3bd089e0ce30ea6f936f2ddcf60931aef7a96d1dded90a58e8ed96d95bf0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / attune-0.5.1-py2.py3-none-any.whl

Download URL attune-0.5.1-py2.py3-none-any.whl
Size 32.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c5bc4ed506113bd732d24f219fd7b9e9f392245ad3728c40fcfe42f040737b7a
BLAKE2b-256 checksum
How to use checksums
6120ffb513ad27de20b26fa419dd4411db01eff2501c11a83a679aa500339b81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page