6/8
6/9
Understanding Antenna Commands
Adding commands to BICEP1
6/10
Try adding a command aimed for the MCE
6/11
Try an Mce command
6/12
Continue following "slew" command
6/15
SPT group meeting
6/16
MCE Commands
6/17
MCE commands
MCE command with just an int
6/18
Mce Commands
commint to CVS so I can use bicep account
Try running real MCE
MCE command is propagating to MASD!
National Instruments Driver
Add new MCE command
6/22
ssh commands
6/23
Lakeshore Driver
McMaster Carr order
6/15
shell commands from gcp
6/26
Get gcp working again
6/29
IDL for SPT: email from Ryan
6/30
idl investigation

6/8

Message Flow:

AntennaControl
Service MsgQ()
  processTaskMsg()

processMsg(AntennaControlMsg* msg)
  switch(msg->type)
  case AntennacontrolMsg::NetCmd:
    sendRtcNetCmd(msg)

sendRtcNetCmd(msg)
  NetCommHandler* str = connectedHandlers_[iant];
  str->packRtcNetCmd(rtc cmd, opcode);

NetCommHandler::packRtcNetCmd(rtc, opcode)
  netCmdHandler_.packNetCmd(rtc, opcode)

NetCmdHandler::packNetCmd(rtc, opcode)
  nss_->startPut(...)
  ...
  nss_->endPut(...)


Control.cc
CONTROL_TASK_FWD_FN(forwardAntennaControlMsg)

ProcessMsg(ControlMsg* msg)
  case ControlMsg::ANTENNA_CONTROL_MSG
    forwardAntennaControlMsg(msg);

forwardAntennaControlMsg(ControlMsg* msg)
  antennaControl_->sendTaskMsg(msg->getAntennaControlMsg() )

ControlMsg.h
getAntennaControlMsg() // returns a pointer to antennControlMsg
  genericMsgType_ = TASK_SPECIFIC;
  type = ANTENNA_CONTROL_MSG;
  return & body.antennaControlMsg;

this gets called in:
  - AntennaNetCmdForwarderNormal.cc:27
  - Control.cc:312
  - Control.cc:325
  - Control.cc:719
  - ControlMsg.h:102
  - Scanner.cc:875

6/9

Understanding Antenna Commands

AntennaNetCmdForwarderNormal.cc

forwardNetCmd(NetCmd* netCmd)

Commands seem to be defined in control/code/unix/libunix_src/bicep/rtcnetcoms.h

RtcNetCmd {

NetMask receivers; NetCmd cmd; }

typedef union {

NetFridgeCmd fridge; ... } NetCmd;

?? does ANTENNA_CONTROL_MSG ever get used?

Try to run -> error:

090609 16:59:26 /home/kstory/gcp/control/conf/bicep/control.init 47: Error: '/data/bicep2daq/log' is not a writable directory.
090609 16:59:26 The control program is being shut down because a thread exited.

comment this out, it works now.

Can't type into bicepViewer. solution: turn off NumLock key.

Adding commands to BICEP1

http://bicep.caltech.edu/~bicep/control_software/adding_commands/set_power_example.html

control/code/unix/control_src/bicep/ SpecificNetCmd

SpecificNetMsg

1) control/code/unix/libunix_src/bicep/rtcnetcoms.c

Name of command, arguments 2) control/code/unix/libunix_src/bicep/rtcnetcoms.h Name of command 3) control/code/unix/control_src/bicep/specificscript.c Take tcl command and queue the equivalent RtcNetCmd 4) util/bicep/ArrayNetCmdForwarder.cc Forward RtcNetCmd to the antenna (and mce) forwardNetCmd(NetCmd* netCmd) switch(opdcode) case NET_HALT_CMD: forwardAntennaNetCmd(netCmd); 5) util/bicep/AntennaNetCmdForwarder.cc Forward RtcNetCmd to the receiver task forwardNetCmd(NetCmd* netCmd) 6) antenna/control/bicep/AntNetCmdForwarder.cc Turn RtcNetCmd into the equivalent AntennaRxMsg, and send it to the receiver task forwardRxNetCmd(NetCmd* netCmd) 7) antenna/control/bicep/AntennaRxMsg.h Define AntennaRxMsg and new commands 8) antenna/control/bicep/AntennaRx.cc Parse AntennaRxMsg

6/10

Try adding a command aimed for the MCE

1) control/code/unix/libunix_src/bicep/ rtcnetcoms.c
  add to cmd_objects[] = {
    ...
    "mce_test"
  add NetObjMember mce_test_cmd_members[] = {
    "test_str",
    "test_int", ... }

2) rtcnetcoms.h
  add NET_MCE_TEST_CMD to enum NetCmdId
  add struct NetMceTestCmd
  add mce_test to struct NetCmd

3) code/unix/control_src/specific/ specificscript.c
  ??

4) util/bicep/ ArrayNetCmdForwarder.cc
  case NET_MCE_TEST_CMD:
    forwardMceNetCmd(netCmd)

5) util/bicep/ MceNetCmdForwarder.cc
  add case NET_MCE_TEST_CMD to forwardNetCmd()

6) masd/bicep/ MasdNetCmdForwarder.cc
  add case NET_MCE_TEST_CMD to forwardRxNetCmd()

7) masd/bicep/ MceRxMsg.h
  add MCE_TEST to enum MsgType
  add struct mce_test

6/11

Try an Mce command

error:
bicepViewer> mce_test "my message here" 9
Symbol 'mce_test' is unknown
bicepViewer>

grep for this. This error msg comes from:
control/code/unix/libscript_src/scope.c:135
in function find_ScriptSymbol()
This function is called from
  - control/code/unix/libscript_src/statement.c:456
  - control/code/unix/libscript_src/statement.c:1394
  - control/code/unix/libscript_src/datatype.c:2878
  - control/code/unix/libscript_src/expr.c:316
  - control/code/unix/libscript_src/variable.c:358
  - control/code/unix/libscript_src/variable.c:376
  - control/code/unix/libscript_src/procedure.c:127

  - control/code/unix/libscript_src/scope.c:160
    used in find_DataType(...) -> NO
  - control/code/unix/control_src/common/genericscript.c:4477 -> NO
  - control/code/unix/control_src/common/generictypes.c:308 -> NO
  - control/code/unix/libunix_src/common/script.h:1189 -> ?
  - control/code/unix/libscript_src/datatype.c:319 -> maybe
  - control/code/unix/libscript_src/script.h:1189 -> defined here

libunix_src/common/script.h
libscript_src/script.h appear to be the same.

** Follow through "slew" command
specificscript.c: add_SpecificScriptCommands()

control/code/unix/control_src/bicep/specificscript.c
add_SpecificScriptCommands()

6/12

Continue following "slew" command

find_ScriptSymbol() in libscript_src/
Where is this getting called from?
libscript_src/statement.c
  - parse_Statement() -> YES
  - parse_ImportStmt() -> NO
libscript_src/expr.c
  - parse_dollar_expr -> NO
libscript_src/variable.c
  - parse_TypeSpec() -> NO
libscript_src/procedure.c
  - add_LoopStateFunction() -> NO

"slew" calls statement.c::parse_Statement()
Commands are in a HashTable, and are found with
find_HashSymbol(hash, name)
node = sc->script.scopes->head;
HashTable* hash = (HashTable* )node->data

How are symbols added to the hash table?
scope.c::add_ScriptSymbol()
called from
  - control_src/common/generictypes.c
      add_ScanDataType()
      add_ScriptDataType()
  - libscript_src/statement.c
      parse_VariableStmt()
  - libscript_src/procedure.c -> maybe
      add_BuiltinFunction()
      add_LoopStateFunction()
      add_UserFunction()
      add_BuiltinCommand()
      add_UserCommand()
      parse_ArgumentList()
      parse_Modifiers()
  - libscript_src/script.c -> NO
      new_Script()
  - libscript_src/datatype.c -> I don't think si
      add_SignalDataType()
      ...
  - libscript_src/variable.c
      add_BuiltinVariable()

Come in from the other direction: where is cmd_objects used?
  - rtcnetcoms.c
      defined,
      rtc_cmd_table = { "cmd", cmd_objects,...}
  - libunix_src/common/control.c
      another definition
      cc_cmd_table = ...

Where is rtc_cmd_table used?
  - control_src/common/genericcontrol.c
      new_RtController()
        rtc->sock = new_SockChan(cp,NULL, +size(rtc_cmd_table),...) -> sets size
      PIPE_RCVD_FN(rtc_pipe_rcvd_fn)
        obj_to_net(&rtc_cmd_table, ...)
      connect_controller()
        obj_to_net(&rtc_cmd_table, ...)

  - util/common/NetCmdHandler.cc
      NetCmdHandler constructor
        nrs_->setBuffer(...size(&rtc_cmd_table)) -> sets size
      packNetCmd(rtc, opcode)
        nss_->putObj(&rtc_cmd_table)
      readNetCmd()
        nrs_->getObj(&rtc_cmd_table,...)

Blech!! I'll try again on Monday.

6/15

SPT group meeting

Web page:
https://spt.uchicago.edu/trac/wiki/PreF2FMeetingJun09

Pipelines

Pre Processing:
IDL pipeline.
  - Find bad scans
  - Filter out pulse tube cooling line
  - Time Constant deconvolution
output fit-files

Map Making:
Two pipelines: IDL and C
IDL: currently "scanmap.pro"
C: Should mirror IDL

Simulation:
  - Used as a development tool
  - Currently only make simulated maps, not timestreams.

McGill Pipeline:

Polarization Simulation:

2. Finalize Data Structures for Standard Data Products
Standard Data Products
  - scan fits files
  - output SPT maps
  - output sims
  - simulation input maps
  - catalogs for point sources and clusters

3. Plan for Achiving Data Products and Ensuring Reproducible Results

4. Autotools
Tools for winter-overs
Intermediate

Questions
  - What are the auto-generated intermediate data files

Things for me to work on
  - Polarization Simulation -> Probably not now.
  - Autotools / data monitoring
  Critical Analysis Inputs
  - Pointing, Astronometry checks
  - Beams. Standardize output.
  - Atmosphere Filter studies

6/16

MCE Commands

Calibration command:
rtcnetcoms.c
NET_CALIB_CMD
struct {
  bool enable
} NetCalibCmd

specificscript.c
CMD_FN(sc_calibrator_cmd)
add_SpecificScriptCommands(...)
  if (!add_BuiltinCommand(sc, "calibrator(SwitchState state)",
                          sc_calibrator_cmd))
CMD_FN(sc_calibrator_cmd) {
  get_Arguments(args, &vstate

rtc_offline()
defined in control_src/common/controlscript

Look up defaultMceSet -> ok

STRING_VARIABLE
defined in libunix_src/common/script.h

closer...

6/17

MCE commands

Current error:
"The last argument of the 'mceTest' command is garbled"

This comes from control/code/unix/libscript_src/expr.c
int parse_procedure_arguments(...)

defined in script.h
struct Variable {
  ScriptObj header;
  TypeSpec* type;
  unsigned flags;
}

struct TypeSpec {
  ScriptObj header;
  char* name
  DataType* dt
  int is_list
}

where does parse_procedure_arguments() get called from?
expr.c::parse_function_call -> NOT CALLED
libunix_src/common/script.h -> NO
libscript_src/statement.c:: parse_CallStmt() -> YES

in specificscript.c, need to fix add_BuiltinCommand(sc, "mceTest(stuff)},...)

Idea: get command with just a doule working first, then try for a string.

MCE command with just an int

Change the following:
1) rtcnetcoms.c
2) rtcnetcoms.h
  NetMceTestCmd mce_test
  NET_MCE_TEST_CMD
3) speceficscript.c
  add_BuiltinCommand(sc, "mceTest(Integer test_int)",sc_mceTest_cmd)
  CMD_FN(sc_mceTest_cmd)
4) MceRxMsg.h
5) MasdNetCmdForwarder.cc

Q1: does arg in add_BuiltinCommand have to match name in rtcnetcoms?
A1: NO (I think)

"setBias([Generic type, Integer freq, Double voltage, Double percent, Integer value, Generic device])"
// setBias type=dc, size=-1.0

Next error:
"Missing integer 'Integer' value"
passed:
expr.c::parse_procedure_arguments: db0
expr.c::parse_procedure_arguments: Variable = intVal, db1
expr.c::parse_procedure_arguments: Variable = intVal

in expr.c
parse_argument(sc, TypeSpec* target, InputStream* stream, Expr* e)
parse_list_expr()
look for parse_fn(), called from expr.c::parse_argument

6/18

spt meeting is over, finally

Mce Commands

parse_fn():
libunix_scr/common/script.h -> NO
libscript_src/datatype.c -> Maybe
libscript_src/script.h -> NO

It appears to be working!

bicepControl

libscript_src/statement.c: parse_CallStmt()
libscript_src/exp.c: parse_procedure_arguments(mceTest)
expr.c::parse_procedure_arguments: db0
expr.c::parse_procedure_arguments: Variable = intVal, db1
expr.c::parse_procedure_arguments: Variable = intVal, 0
expr.c::parse_procedure_arguments: db2 - parse_argument
expr.c::parse_argument: db1 - top
expr.c::parse_argument: db2
expr.c::parse_procedure_arguments: db2.5 - after parse_argument
expr.c::parse_procedure_arguments: db3
expr.c::parse_procedure_arguments: db8 - terminator character
Sending MCE command:
test_int   = 42

The command chain
1) libscript_src/statement.c: parse_CallStmt()
2) libscript_src/expr.c: parsee_procedure_arguments()
  - Modifier arguments
  - read arguments from args into Variable data type
  - call parse_arguments
  - parse optional arguments db4-db7
  - terminator character
3) control_src/bicep/specificscript.c
4) util/ArrayNetCmdForwarder.cc
5) MceNetCmdForwarder.cc
6) masd/bicep/MasdNetCmdForwarder.cc
7) masd/bicep/MceRxMsg.h: packMceTestMsg()
  - type = MCE_TEST
8) MceRx.cc
  - processMsg() -> forwardDataMsg

6/19

commint to CVS so I can use bicep account

control/code/unix/control_src/bicep/specificscript.c -> OK
control/code/unix/control_src/common/genericcontrol.c -> OK
control/code/unix/control_src/common/genericcontrol.h -> OK
control/code/unix/libscript_src/datatype.c -> OK
control/code/unix/libscript_src/expr.c -> OK
control/code/unix/libscript_src/statement.c -> OK
control/code/unix/libunix_src/bicep/rtcnetcoms.c -> OK
control/code/unix/libunix_src/bicep/rtcnetcoms.h -> OK
control/conf/bicep/control.init

masd/bicep/MasdNetCmdForwarder.cc -> OK
masd/bicep/MceRx.cc -> OK
masd/bicep/MceRxMsg.h -> OK

mediator/bicep/bin_Mediator.cc -> OK

util/bicep/ArrayNetCmdForwarder.cc -> OK
util/bicep/MceNetCmdForwarder.cc -> OK

Try running real MCE

gtkterm does not seem to work from my kstory account on bicep31.

using bicep account, I find
FR = 150
RL = 50
NR = 33

on bicep31:
kstory uname
run bicepControl, bicepAntenna, bicepMediator

on bicep32:
bicep uname
run bicepMasd first, then start mce:
  ./mce_pipe_acq 1000 1 100 33

This doesn't seem to be doing anything. ??
Also, the Frame merging page is not printing anything out, even from the Antenna. This is probably because Walt changed the register maps.

MCE command is propagating to MASD!

Output in Masd:
MceNetCmdForwarder:: NET_MCE_TEST_CMD
MasdNetCmdForwarder: Got a MCE command
MceRxMsg::packMceTestMsg()
MasdNetCmdForwarder: Got a MCE command
MceRxMsg::packMceTestMsg()

It is working: I now have a command propagating to the CommandTask in
the masd. It can then call a command from here.

National Instruments Driver

Google search for
"National Instruments GPIB driver linux 64-bit" -> first hit
http://joule.ni.com/nidu/cds/view/p/id/1000/lang/en
NI_488.2 Version 2.5 Driver for Linux 64-bit

Download the instillation file.
unpack: tar -xzvf ni...tar.gz
Install:

root]# sh ./INSTALL
*****************************************************************************
  NI-488.2 Distribution
     version 2.5.4b1 for Linux
*****************************************************************************

National Instruments products support the following Linux distributions:
   Mandriva Linux Official
   openSUSE
   Red Hat Enterprise Linux Desktop + Workstation
Refer to README.txt for the latest information at the time of release.
Refer to www.ni.com/linux for the most recent information about Linux
support at National Instruments.

*****************************************************************************
  NATIONAL INSTRUMENTS CONFIDENTIAL
  THE SOFTWARE YOU ARE ABOUT TO INSTALL IS NOT A RELEASED VERSION
  REFER TO README.txt FOR A LIST OF KNOWN ISSUES
*****************************************************************************

Error:
Install gcc:
$ yum install gcc
Install g++
$ yum install gcc-c++.x86_64

Try again. New error:

************************************ ERROR *************************************
* Kernel source does not appear to be installed for the 2.6.18-128.1.10.el5 kernel.
*    Installation of the kernel-source package for kernel 2.6.18-128.1.10.el5 is
*                   required to continue this installation.
************************************ ERROR *************************************
??
root]# cat /etc/grub.conf | grep kernel
#          all kernel and initrd paths are relative to /, eg.
#          kernel /boot/vmlinuz-version ro root=/dev/md0
        kernel /boot/vmlinuz-2.6.18-128.1.10.el5 ro root=/dev/md0 rhgb quiet
        kernel /boot/vmlinuz-2.6.18-53.el5 ro root=/dev/md0 rhgb quiet
root]# more /proc/version
Linux version 2.6.18-128.1.10.el5 (mockbuild@ls20-bc2-14.build.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1
.2-44)) #1 SMP Wed Apr 29 13:53:08 EDT 2009

So I am running Red Hat 4.1. The driver wants 5.0 or 5.1

Options:
  - Look into getting Red Hat 5.0 or 5.1
  - Other drivers:
  NI-488.2 - Beta 64 Bit
  NI-VISA
  GPIB-ENET Firmware

Talk to Leo:
For some reason the kernal was not up to date:

root]# cat /etc/grub.conf |grep kernel
#          all kernel and initrd paths are relative to /, eg.
#          kernel /boot/vmlinuz-version ro root=/dev/md0
        kernel /boot/vmlinuz-2.6.18-128.1.14.el5 ro root=/dev/md0 rhgb quiet

Fixed!

Utilities:
gpibexplorer - utility to brows, add, and delete GPIB interfaces.
gpibtsw - GPIB trouble shooting wizard
gpibintctrl - GPIB Interactive Control utility
firmwareupdate - GPIB Firmware Update utility
ethernetconfig - GPIB ethernet device conviguration utility
You ca get to everything from the gpibexplorer

Add new MCE command

1) gcp/control/code/unix/libunix_src/bicep/rtcnetcoms.h
  - add NET_MCE_GENERIC_CMD to the enum NetCmdId
  - typedef struct{
      char message[MCE_MAX_CMD+1];
      } NetMceGenericCommand;
  - add NetMceGenericCmd mce_generic; to union NetCmd
2) rtcnetcoms.c
  - NetObjMember mce_generic_cmd_members[] = {
      {"message", offsetof(NetMceGenericCommand, message), NET_ASCII, MCE_MAX_CMD},
    };
  - add {"mce_generic", ...} to cmd_objects[]
3) control_src/bicep/specificscript.c
  - declare static CMD_FN(sc_mceGeneric_cmd)
  - add command to add_SpecificScriptCommands(...)
  - add static CMD_FN(sc_mceGeneric_cmd)
4) util/bicep/ArrayNetCmdForwarder.cc
  - forwardNetCmd()
      case NET_MCE_GENERIC_CMD:
        forwardMceNetCmd(netCmd)
5) util/bicep/MceNetCmdForwarder.cc
  - in forwardNetCmd()
      case NET_MCE_GENERIC_CMD:
        forwardRxNetCmd(netCmd)
6) masd/bicep/MasdNetCmdForwarder.cc
  - in forwardRxNetCmd()
      caseNET_MCE_GENERIC_CMD:
        rxMsg->getCommandMsg()->packMceGenericMsg()
7) masd/bicep/CommandMsg.h
  - in MsgType
      add MCE_GENERIC
  - packMceGenericMsg(char* message)
      genericMsgType = TASK_SPECIFIC
      type = MCE_GENERIC
8) masd/bicep/CommandTask.h
  - static COMMAND_DONE_HANDLER(runGenericCommand);
  - void runGenericCommand(CommandMsg* msg);
9) masd/bicep/CommandTask.cc
  - runGenericCommand(CommandMsg* msg)
      this is the function that actually does something!
  - in processMsg()
      case MCE_GENERIC

6/22

see Above.

String command is working!
Next, figure out why the command appears to be arriving twice.

MceNetCmdForwarder:: NET_MCE_GENERIC_CMD
MasdNetCmdForwarder: Got a MCE_GENERIC command
Masd/CommandMsg::packMceMsg(hello, world!)
MasdNetCmdForwarder: Got a MCE_GENERIC command
Masd/CommandMsg::packMceMsg(hello, world!)
CommandTask: case MCE_GENERC
*** hello, world!
CommandTask: case MCE_GENERC
*** hello, world!
currently,
MceNetCmdForwarder::forwardNetCmd( NET_MCE_GENERIC_CMD )
MasdNetCmdForwarder::forwardRxNetCmd - MCE_GENERIC command
Masd/CommandMsg::packMceGenericMsg(hello, World!)
MasdMaster::forwardMasterMsg
MceNetCmdForwarder::forwardNetCmd( NET_RESET_CMD )
MasdNetCmdForwarder::forwardRxNetCmd - MCE_GENERIC command
Masd/CommandMsg::packMceGenericMsg(hello, World!)
MasdMaster::forwardMasterMsg
MasdMaster::processMsg - case RX_MSG
MasdMaster::forwardRxMsg
MceRx::processMsg()
CommandTask: case MCE_GENERC
*** hello, World!
MasdMaster::processMsg - case RX_MSG
MasdMaster::forwardRxMsg
MceRx::processMsg()
CommandTask: case MCE_GENERC
*** hello, World!

I was missing a break statement in MceNetCmdForwarder!!
Mystery Solved!

ssh commands

Next, get an ssh command to work.
try system() or popen()

To Do:
  - check out register maps, fix merging.page

6/23

bicep31 got hacked.

Lakeshore Driver

_
Lakeshore Manual:_
http://www.lakeshore.com/pdf_files/instruments/218_Manual.pdf

Utilities:
gpibexplorer - utility to brows, add, and delete GPIB interfaces.
gpibtsw - GPIB trouble shooting wizard
gpibintctrl - GPIB Interactive Control utility
firmwareupdate - GPIB Firmware Update utility
ethernetconfig - GPIB ethernet device conviguration utility
You ca get to everything from the gpibexplorer

Chapter 6 on computer interface

Mode 318 IEEE-488 interface capabilities
• SH1: Source handshake capability.
• RL1: Complete remote/local capability.
• DC1: Full device clear capability.
• DT0: No device trigger capability.
• C0: No system controller capability.
• T5: Basic TALKER, serial poll capability, talk only, unaddressed to talk if addressed to listen.
• L4: Basic LISTENER, unaddressed to listen if addressed to talk.
• SR1: Service request capability.
• AH1: Acceptor handshake capability.
• PP0: No parallel poll capability.
• E1: Open collector electronics.

Set the Interface to Baud 9600
Select Address 12
Terminator setting: Cr Lf
Power down and back up

Three types of commands:

1) Bus Control 2) Common 3) Interface and Device Specific

McMaster Carr order

Please order:

1/4 inch screws:
1 of 92196A551 @ $10.40 per Pack, 18-8 Stainless Steel Socket Head Cap Screw 1/4"-20 Thread, 2-1/4" Length
5/16-24 socket head 1/2 inch long

1/4 inch washers:
1 of 90945A761 @ $10.44 per Pack, 18-8 Stainless Steel NAS 620 Flat Washer 1/4" Sz, .468" OD, .060"-.067" Thk, Dash No. C416
1 of 90313A107 @ $7.45 per Pack, 18-8 SS Large-Diameter Flat Washer 1/4" Screw Size, 1" OD, .040"-.060" Thick
1 of 92146A029 @ $4.44 per Pack, 18-8 Stainless Steel Spring Lock Washer 1/4" Screw Size, .487" OD, .062" min Thick

5/16 washers:
1 of 98017A690 @ $7.55 per Pack, 18-8 Stainless Steel AN 960 Flat Washer 5/16" Sz, .562" OD, .057"-.069" Thk, Dash No. C516
1 of 92146A030 @ $6.56 per Pack, 18-8 Stainless Steel Spring Lock Washer 5/16" Screw Size, .583" OD, .078" min Thick

3/8 washers: done

1/2 washers: done

Hex wrench: 3/8

Regular files
Needle files

m8 (0.8inch long, 20mm long)

6/15

shell commands from gcp

Look at util/common/CoProc.h, .cc

c++ function fork()
fork_ret = fork();
if (fork_ret == 0) {
  // Child process
}

example of popen:
http://www.linuxquestions.org/questions/programming-9/cc-popen-launch-process-in-specific-directory-620305/

popen() is used in the gcp:
control/code/unix/misc_scr/logfile.c







debug masd/bicep/CommandTask::runGenericCommand()

6/26

Get gcp working again

Problem 1: kstory can't write to /data/bicep2_daq/acq/
I am part of group staff, not sure what the problem is.

Problem 2: no pipes for masd to write to.
add them:

/data/cryo$ mkfifo mas_data_pipe.run
/data/cryo$ mkfifo mas_data_pipe

It works!!

spt data analysis; work through Ryan's email.
Can't find function make_data_struct:

IDL> data=make_data_struct('01-Jun-2009:00:00:00','01-Jun-2009:00:04:00')
% Variable is undefined: MAKE_DATA_STRUCT.
% Execution halted at: $MAIN$
this runs from directory /data/sptdat/fits/calibraror

6/29

to do
1) solid works model of 50k plate -> DONE
2) Wind IL edits -> DONE
3) IDL stuff
4) other Solid Works models

IDL for SPT: email from Ryan

=== IDL STUFF ===
Lists of functions:
http://physics.nyu.edu/grierlab/idl_html_help/idl_alph.html
http://idlastro.gsfc.nasa.gov/contents.html (the so-called "astro-lib"
library, which we have on spt, is astronomy specific)

Quite annoyingly, you have to use the 'print' command to get an answer
to a simple calculation.
> print,3+3
(at least you don't have to type ; at the end of all commands, like
you do in matlab...)

It's a very good idea to get in the habit of turning all numbers into
"decimal-point-containing" numbers (or at least understand the rules
IDL uses for arithmetic).  For example,
> print,3/4
  0

> print, 3./4.
  0.750000

$ allows you to "wrap-around" a command within some code, if you like
the way that looks better.
a = [1, 2, 3, 4, 5, $
      6, 7, 8, 9, 10]

The WHERE command is very useful.  It's like FIND in matlab.  It
returns the indices of the elements in an array which satisfy some
criterion.

> a = [1, 2, 3, 4, 5]
> wh = where(a gt 3)
> print,a[wh]
   4    5

Here's a script plotting some random numbers.
n=100
seed = systime(/sec)
x = randomn(seed,n)
y = randomn(seed,n)
plot,x,y, ps=2, xtitle='Apples', ytitle='Bananas', title='Duh',
charsize=1.6, xr=[-2,2], yr=[-2,2], /xst, /yst
wh_big_x = where(x gt 1.)
wh_big_y = where(y gt 1.)
oplot,x[wh_big_x],y[wh_big_x],ps=4,color=!red, symsize=2
oplot,x[wh_big_y],y[wh_big_y],ps=4,color=!blue, symsize=2
legend,['BIG X','BIG Y'], textc=[!red, !blue], charsize=1.7, /bottom, /left

SPT Specific...
to read in some data,
data=make_data_struct('01-Jun-2009:00:00:00','01-Jun-2009:00:04:00)

to read in a fits file,
data=read_spt_fits('calibrator_20090623_191359.fits')

to convert between date strings and date numbers in Modified Julian Date (MJD)
mjd = date_string_to_mjd('01-Jun-2009:00:00:00')
date = mjd_to_date_string(mjd)


=== FITS FILES ===
/data/sptdat/fits/calibrator
/data/sptdat/fits/elnod
etc.

Again, to read in a fits file,
data=read_spt_fits('calibrator_20090623_191359.fits')
plot,data.observation.bolo_cal_response,/ps


=== CUTS ===
Martin's page on Cuts:
https://spt.uchicago.edu/trac/wiki/CutsJuly16

spt_analysis/cuts/get_cuts.pro is the parent program.
There are sub-routines.  get_response_cuts.pro is probably the one you
want to explore the most.

=== SUMMARY TABLES ===
I don't think we need to work on this stuff in the short-term, but
here's some information on Kathryn's summary tables.

http://spt.uchicago.edu/intweb/analysis/autotools/summary/summary.html

This is the starting page for the "Summary Tables".  Kathryn automated
the creation of these tables a while back, but nobody is keeping an
eye one them.

From there you can navigate to plots showing fridge performance,
weather, and, most importantly, bolometer performance.  Over time we
can build up a specific list of things to report back to the group on
(on a weekly telecon, for example), but for now we should just
familiarize ourselves with the plots (what's typical and what's not).

from spt_analysis/fits/
type:
> data=read_spt_fits('/data/sptdat/fits/calibrator/calibrator_20090623_191359.fits')
> plot,data.observation.bolo_cal_response,/ps

6/30

to do for mce:
add 3 commands:
  - mce_cmd
  - start_acquisition: 4 agruments
  - stop_acquisition: not implemented yet, put in stub

stand-alone fridge control:
  - in antenna layer, put

idl investigation

cuts: this works:
> data = read_spt_fits('/data/sptdat/fits/calibrator/calibrator_20090623_191359.fits')
> get_cuts, data
> print, data.observation.bolo_flags


goal 1: make plot of response as a fn of bolometers

looking at spt_analysis/cuts/get_cuts.pro

Sub-routines:
  - get_lowlevel_cuts
  - get_response_cuts
  - get_outlier_cuts
  - get_line_cuts
  - get_calibration_failed_cut
  - get_cal_wt_outlier_cuts

look at get_response_cuts.pro
cuts are stored in data.observation.bolo_flags
obs_tags = tag_names(data.observation)
nbolos = n_elements(data.observation.bolo_readout_idx)
bolo_elnod_response = data.observation.bolo_elnod_response
bolo_elnod_gof = data.observation.bolo_elnod_gof
bolo_cal_response = data.observation.bolo_cal_response

cutindex = cut_flag_name_to_index('CALIBRATOR_RESPONSE_CUT', /obs_bolo_flags)
in cut_flag_name_to_index.pro,
  - define_cut_flags ;; assigns names to each cut flag, stores names in system variable

keyword_set(expr) is a standard function, returns true or false depending if expr is defined
if(cond1 + cond2) means "and", I think
defsysv, defines a system variable

Questions:
  - Is there a way to look for functions, i.e. "which"? ->
  - "ls" function? -> $ls
  - "pwd" function? -> $pwd
  - what is the / notation? -> I think it means "this variable will be filled"
  - how can I see what is inside a struct?

  - what does if(cond1 + cond2) mean? -> I think "and"
  - how about "or"?
  - what is the ! notation?, i.e. master_names=!SPT_CUT_DEFS.obs_bolo_cut_names
  - where is the data struct defined? what are its members?
  - what is aux_bolo_psd_9to11, bolo_psd_9to11 ?
  - obs_tags is defined twice? on L108, L145