Holography Synthesizer Agent

The Holography Synthesizer Agent is provided with OCS to help demonstrate and debug issues with the holography synthesizers. The synthesizers provide a signal at a desired frequency for holography measurements. This agent will connect the computer to the two Local Oscillators (LO’s) via USB port, initialize the LO’s, set the frequency of each and pass the frequency to the OCS feed.

usage: python3 agent.py [-h] [--config_file CONFIG_FILE]

Agent Options

--config_file

Dependencies

Note

These dependencies are not automatically installed when you install socs. You can manually install them, or follow the instructions below.

Also note that since this agent is tightly coupled with the Holography FPGA Agent, the instructions below will pull dependencies related to that agent as well.

You can install these by first checking you are running Python 3.8:

$ python --version
Python 3.8.13

Then by either installing via pip:

$ python -m pip install 'holog_daq @ git+https://github.com/McMahonCosmologyGroup/holog_daq.git@main'

Or by cloning the socs repository and using the provided requirements file:

$ git clone https://github.com/simonsobs/socs.git
$ python -m pip install -r socs/requirements/holography.txt

Configuration File Examples

Below are configuration examples for the ocs config file.

OCS Site Config

To configure the Holography FPGA Agent we need to add a FPGAAgent block to our ocs configuration file. Here is an example configuration block using all of the available arguments:

{'agent-class': 'SynthAgent',
 'instance-id': 'synth_lo',
 'arguments': ['--config_file','holog_config.yaml']}

Holography Config File

roach: '192.168.4.20'
ghz_to_mhz: 1000
N_MULT: 8
F_OFFSET: 10
baseline: 'bd'
path_to_roach_init: "~/Desktop/holog_daq/scripts/upload_fpga_py2.py"
python2_env: "/opt/anaconda2/bin/python2 "

Description

The SynthAgent contains functions which control the two synthesizers for holography measurements. Before the synthesizers can output a frequency, the user needs to initialize both using the init_synth() function. This will connect to the 2 synthesizers via 2 USB ports and prepares them to read in the user-desired frequency as the signal output.

Once the synthesizers are initialized, the user can take set the frequency output using the set_frequencies() function. This will set the frequency output of BOTH synthesizers. The user-specified frequency should be in GHz.

Agent API

class socs.agents.holo_synth.agent.SynthAgent(agent, config_file)[source]

Agent for connecting to the Synths for holography.

Parameters:

config_file (str) – ocs-site-configs/uchicago/field/holog_config.yaml

init_synth()[source]

Task - A task to initialize the synthesizers.

Examples

Example for calling in a client:

from ocs.ocs_client import OCSClient
client = OCSClient("synth_lo")
client.init_synth()

Notes

This task is called to turn on the synthesizers.

set_frequencies(freq1=0, offset=0)[source]

Task - A task to set the frequencies of the synthesizers.

Parameters:
  • freq1 (float) – Frequency of holography measuremnt [GHz].

  • offset (float) – Frequency offset of holography measurement [MHz].

Examples

Example for calling in a client:

from ocs.ocs_client import OCSClient
client = OCSClient("synth_lo")
client.set_frequencies(freq1=210, offset=10)

Notes

An example of the session data:

>>> response.session['data']
{"timestamp": 1601924482.722671,
 "block_name": "synth_lo",
 "data": {"F1": 11 ,
          "F2": 11.1}}}
set_synth_status(lo_id=0, status=1)[source]

Task - A task to set the status of the synthesizers.

Parameters:
  • lo_id (int) – Local Oscillator ID (either 0 or 1).

  • status (int) – Status of local oscillator (0 is off, 1 is on).

Examples

Example for calling in a client:

from ocs.ocs_client import OCSClient
agent = OCSClient("synth_lo")
agent.set_synth_status(lo_id=0, status=1)

Notes

An example of the session data:

>>> response.session['data']
{"timestamp": 1601924482.722671,
 "block_name": "synth_lo",
 "data": {"F1_status": 1}}