GBT Balance Usage
From the command line, the Balance class serves as the interface to the API.
Its use can most easily be described by an example.
To balance the prime focus receiver and the IFRack
- From python import the Balance module by typing:
from Balance import *
is this correct? didn't work during integ tests 2/9; had to use gbt.something.config.Balance
- Create a Balance object with a list of the devices to be balanced. Supported devices are "acs" (Spectrometer), "ifrack" (IF Rack), "pf" (Prime Focus Receivers) and "sp" (Spectral Processor).
b = Balance(("pf", "ifrack"))
Are inside parens supposed to be brackets??
- To perform the balance, the balance method is called.
b.balance()
An optional parameter to the balance method can be provided. This parameter must be a dictionary that contains 1 or more of the following
balancing options. Items which are not in the dictionary are assigned their default values. Non applicable options are ignored.
The default values are:
target_level = -11 Applicable when balancing the SpectralProcessor (sp) :
port = (1..41) Applicable when balancing the Spectrometer (acs)
sample_time = 2 Applicable when balancing thePrimeFocusReceivers(pf)
cal = 'off' Applicable when balancing the PrimeFocusReceivers(pf)
Supported dictionary keys/value type are:
target_level / float
sample_time / int
cal / string containing "on" or "off" -- other values will be treated as if "on" was specified
port/ tuple containing integers from 1 to 41
An example of a dictionary containing valid options and its use in a balance method call is:
b = Balance(("pf", "ifrack, acs"))
opt = { "target_level": 4,
"sample_time" : 5,
"cal" : "on",
"port" : (9,13)
}
b.balance(opt)
The prime focus receiver, the IFRack and the spectrometer are balanced with the following options:
- The IF target level for the Prime focus receiver is 4.
- The sample time used in the prime focus receiver is 5 seconds.
- The cal diodes will not shut off during balancing.
- The duty cycles for ACS ports 9 and 13 will be displayed after completion of the ACS balancing.
Directions are the same as for "Balancing from the Python Command Line" (step 1 above), but the import
step is not needed.
The config tool provides its own interface to the Balance API. The interface is through one method called bal().
The bal() method accepts the following optional parameters:
- mgrs = a list of devices to be balanced ( Supported devices are "acs", "ifrack", "pf" and "sp" )
- options = a python dictionary that contains balancing options
- sim = a simulation flag . Setting sim = 1 will cause the bal method to not actally balance the devices
All the parameters are optional. The default values for these parameters are:
- options : { "target_level" : -11,
"sample_time" : 2,
"cal" : "off",
"port" : (1..41)
}
To perform a balance from the config tool interface type :
g = gbtsetup()
g.bal()
This results in the IFRack to be balanced.
The command:
g.bal(mgrs=("pf", "ifrack", "acs"))
Results in balancing the Prime Focus Receiver, followed by the IFRack, followed by the Spectrometer.
The default parameters are used in balancing all the devices.
Alternately to specify balancing options
opt = { "sample_time" : 5,
"cal" : "on",
"port" : (9,13)
}
b.bal(mgrs=("pf", "ifrack", "acs"), options = opt)
The Prime Focus receiver will be balanced with the sample_time of 5 and the cal diodes "on" (if they are currently "on")
The IFRack will be balanced. Note that there are no balancing options for the IFRack
The Spectrometer will be balanced with the resulting duty cycles displayed for ports 9 and13
-- MelindaMello - 07 Dec 2004
|
Revision r1.2 - 10 Feb 2005 - 16:14 GMT - NicoleRadziwill
|
Content copyright © 1999-2007 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
|
| |