Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.naic.edu/~phil/hardware/byuPhasedAr/rfischercode/userhelp.txt
Дата изменения: Wed Jan 27 16:45:56 2010
Дата индексирования: Sat Jun 26 01:40:55 2010
Кодировка:
Instructions for running 20-meter python control software:

The Linux workstation, "marsha" is connected to the 20-meter OCU by a
serial link connected between COM1 on marsha and J6 on the OCU. This
connection requires a null modem adapter since both serial ports are
configured as controllers, i.e., DCE. The serial protocol is 9600
baud, 8 bits, even parity, and 1 stop bit.

All of the 20-meter commands accepted by the OCU that might be
relevant to array feed tests are encapsulated in the python class,
Control20m, in the file control20m.py. The OCU only knows azimuth and
elevation coordinates. Routines for controlling the 20-meter in
R.A. and Dec are in the file, array_pointing.py.

To initialize the 20-meter control routines log onto marsha and cd to
the directory where control20m.py and array_pointing.py are kept. The
originals are in ~rfisher/Applications/TwentyMeter, but it's best to
copy these to your own directory to avoid losing the originals.

Then start python from the linux prompt.

$ python
>>>

To load just the OCU control class use the python command

>>> from control20m import *

or to load both OCU control and R.A./Dec functions use

>>> from array_pointing import *

The 'array_pointing' module imports 'control20m' so you don't need
both commands, but loading both causes no harm. If you have only
loaded 'control20m', create a handle for the Control20m class,
establish control of the telescope, and set the 20-meter
clock. (Again, these are automatically done in the 'array_pointing'
module.)

>>> ant = Control20m()
>>> ant.take_control()
>>> ant.sync_unix_time()

The Control20m class methods are listed at the end of this note. See
the 20-meter documentation for details on the parameters. You
probably won't need to use these directly (Don't use a set_() function
unless you know exactly what it does.), but a few that are handy
for positioning the telescope in az/el are

>>> ant.take_control()
>>> ant.release_control()
>>> ant.stop()
>>> ant.clear_fault()
>>> ant.set_azel(az, el, azvel=0.0, elvel=0.0) # az and el in decimal
# degrees, velocities
# in deg/sec

Most telescope control will be done with the routines in the
array_pointing module. These are not in a python class so they are
used without a prefix, unless you use the 'import as' command. Simple
commands to track an object for two minutes would be

>>> track('CasA', duration=120)
>>> track('23:23:26.7,+58:49:03', duration=120)

The track command can be terminated with ctrl-C. The telescope will
continue at its current az and el velocities for another 20 seconds
before timing out and coming to a stop unless another telescope
command is issued. When the telescope reaches the commanded track it
sends an "Arrived at..." message to the data-taking computer and
expects a "Done" reply at the end of the duration time. If the "Done"
reply is not received within 10 seconds of the end of the duration,
the track command will time out and terminate.

The telescope functions available in the array_pointing module are

>>> take_antenna_control()
>>> release_antenna()
>>> track(object, duration, cross_el_offset=0.0, el_offset=0.0)
>>> box(object, increment, box_num, duration)
>>> box_set(object, increment, num_boxes, duration, repeat_on=True)
>>> raster(object, increment, max_x, max_y, duration, repeat_on=True)

To get a description of a function and its parameters use the python
'doc' facility, e.g.,

>>> print track.__doc__

track(object, duration, cross_el_offset=0.0, el_offset=0.0)
This is the primary user function for sending the 20-meter telescope to
a radio source or J2000 R.A./Dec position on the sky and tracking it for
the number of seconds given in the second parameter. The first parameter
can be one of three name strings, 'CasA', 'CygA', or 'GOES 12', or a
J2000 coordinate pair as a hexagesimal string of the following format:
'HH:MM:SS.s,-DD:MM:SS.s'. The tracking duration begins after the
telescope has reached the commanded position. The pointing may be offset
in near-rectangular coordinates from the commanded position by the last
two parameters, which are in degrees. Positive cross_el_offset drives
the telescope to smaller azimuth, and positive el_offset drives the
telescope to lower elevation. The track is adjusted to keep the
commanded R.A./Dec in a fixed point of the antenna beam pattern for the
purpose of beam mapping.

There are other functions in the array_pointing module. Some are
mainly for internal use, but a few may be useful utilities in their
own right. These are

>>> hadec_to_azel(ha_hrs, dec_deg)
>>> j2000_to_epoch(ra_str, dec_str, mjd)
>>> get_current_mjd()
>>> get_refracted_el(el)
>>> get_corrected_azel(az, el, with_refraction=True)
>>> get_object_posn(object)
>>> get_last_str(mjd, utc_string)
>>> get_last(mjd_frac)
>>> mjd_to_time_str(mjd)

Use the 'doc' facility to learn more about these functions.


-------------------------------------------------------------------
Control20m class methods

get_status()
get_status_msg()
get_site_param()
set_site_param(lat, lon, alt, name='Green Bank')
get_time()
set_time(hrs, min, sec, day_num, year)
sync_unix_time()
set_azel(az, el, tim='', azvel=0.0, elvel=0.0, wrap='')
stop()
stow(num=1)
set_stow_position(num, az, el)
get_stow_position(num=1)
clear_fault()
get_encoder_offset()
set_encoder_offset(az_offset=89.528, el_offset=-0.1960, pol_offset=-5.6000)
get_el_droop_table()
set_el_droop(droop)
get_box_limits(num=1)
set_box_limits(num, az_width, el_height, az_center,
el_center, on_off='Off', auto_spec='Auto')
disable_box_limits()
enable_box_limits()
get_soft_limits()
set_soft_limits(wrap_zero=180.0, az_plus=90.1, az_minus=269.9,
el_plus=92.0, el_minus=-0.1,
pol_plus=46.9, pol_minus=0.100)
get_deadband()
set_deadband(az_deadband=0.0, az_hysteresis=1.5,
el_deadband=0.0, el_hysteresis=1.5)
get_tracking_velocity()
set_tracking_velocity(az_vel, el_vel)
data_backup()
get_computer_timeout()
set_computer_timeout(timeout=10.0)
get_time_tagged_status()
take_control()
release_control()
set_poln_position(pol, time=-1.0, pol_vel=0.0)
poln_stop()
get_nonorthogonality()
get_foundation_tilt()