NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > BalanceExamples (r1.1 vs. r1.2)
   Changes | Index | Contents | Search | Statistics | Go
 <<O>>  Difference Topic BalanceExamples (r1.2 - 10 Feb 2005 - NicoleRadziwill)
Changed:
<
<

* From python import the Balance module:

>
>

    • From python import the Balance module by typing:
Added:
>
>



Added:
>
>

is this correct? didn't work during integ tests 2/9; had to use gbt.something.config.Balance

Added:
>
>

  • 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).
Changed:
<
<

* Create a Balance object with a list of the devices to be balanced. Supported devices are "acs", "ifrack", "pf" and "sp".

>
>



Added:
>
>

Are inside parens supposed to be brackets??

Added:
>
>

 
Added:
>
>

Changed:
<
<

>
>

Added:
>
>

2. Balancing from the astrid "Command Console"

Directions are the same as for "Balancing from the Python Command Line" (step 1 above), but the

import
step is not needed.
Added:
>
>

3. Balancing from the Config Tool

Deleted:
<
<

2. Balancing from the Config Tool

Changed:
<
<

This results in the IFRack to be balanced.

>
>

This results in the IFRack to be balanced.

Changed:
<
<

Results in balancing the Prime Focus Receiver, followed by the IFRack, followed by the Spectrometer.

>
>

Results in balancing the Prime Focus Receiver, followed by the IFRack, followed by the Spectrometer.

Changed:
<
<

The IFRack will be balanced. Note that there are no balancing options for the IFRack

>
>

The IFRack will be balanced. Note that there are no balancing options for the IFRack

Deleted:
<
<

Project Scientist: KarenONeil

 <<O>>  Difference Topic BalanceExamples (r1.1 - 07 Dec 2004 - MelindaMello)
Added:
>
>

%META:TOPICINFO{author="MelindaMello" date="1102447860" format="1.0" version="1.1"}%

GBT Balance Usage

  Main     Usage     Examples     Enhancement Requests     Troubleshooting     Updates  


1. Balancing from the python command line

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:

from Balance import *

* Create a Balance object with a list of the devices to be balanced. Supported devices are "acs", "ifrack", "pf" and "sp".

b = Balance(("pf", "ifrack"))

*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.

2. Balancing from the Config Tool

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:

  • mgrs : ("ifrack",)

  • options : { "target_level" : -11, "sample_time" : 2, "cal" : "off", "port" : (1..41) }

  • sim : 0

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


4. Core Team

Scientific Sponsor: KarenONeil FrankGhigo
Technical Leads: MelindaMello
Project Scientist: KarenONeil

-- MelindaMello - 07 Dec 2004


Topic BalanceExamples . { View | Diffs | r1.2 | > | r1.1 | More }
Revision r1.1 - 07 Dec 2004 - 19:31 GMT - MelindaMello
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.