Extract Angle Cam Image from CODA files
SHMS and HMS Angle Cam Images in CODA files
The angle camera images are stored at the start of every CODA run. They can be extracted using the /home/coda/coda/scripts/Angle_snapshots/get_coda_photos tool.
This script uses evio2xml to support extracting the image so you will need to run it in a place that has access to the coda tools. There are lots of ways to do this, but the simplest is to just login to cdaq@cdaql1.
Login to the cdaq cluster, cd into an appropriate directory, and make a symlink of the script here:
% ln -s /home/coda/coda/scripts/Angle_snapshots/get_coda_photos .
Or copy the script if you want:
% cp /home/coda/coda/scripts/Angle_snapshots/get_coda_photos .
The basic syntax is "./get_coda_photos <coda_file.dat>". It will extract the angle-cam images into your current working directory. For example:
SHMS_angle_07977.jpg, and HMS_angle_07977.jpg
If you are in a directory with symlinks to raw/, cache/, etc, then you can just give it the filename and it will search the usual list of paths automatically like the analyzer does:
Feature bounties offered by Brad:
- I will buy lunch for any student that integrates the image decoder into an hcana class so that the angle images just get stored in the ROOT tree as JPGs as part of the standard analysis run. The encoded image format is described in the get_coda_photos script. Talk to me if you have questions though.
- I will give $100 to anyone who manages to get some decent character and feature recognition working to ML working to *reliably* extract the spectrometer angle from the camera image. This includes recognizing the angle digits and correctly interpreting the vernier. Note that you can take advantage of the fact that the image frame is fixed, the graduations have fixed spacing, and the camera center (from which the vernier is interpreted) never moves. Don't overthink the problem -- some hardcoded parameters are entirely fine (but do describe them and store them in a config file!)