-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add calibration script #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked at the nitty-gritty of the calibration code yet. Just some preliminary, mostly organizational, notes for now.
I'd rather not include the jupyter notebook in here. The jt_cal.py script should emulate it pretty well, so we don't need both, right?
I'm wondering whether we need a jet_tracking_cal
folder. What if we moved jt_cal up a level and the arp script to a bin folder in the top level?
#!/bin/bash | ||
|
||
source /reg/g/psdm/sw/conda1/manage/bin/psconda.sh | ||
ABS_PATH=/cds/home/a/aegger/jet_tracking/jet_tracking/jet_tracking_cal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ABS_PATH=/cds/home/a/aegger/jet_tracking/jet_tracking/jet_tracking_cal | |
ABS_PATH=`dirname $(readlink -f $0)` |
with open(args.cfg) as f: | ||
yml_dict = yaml.load(f, Loader=yaml.FullLoader) | ||
det_map = yml_dict['det_map'] | ||
ipm_name = yml_dict['ipm']['name'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we swap ipm
for i0
since it won't always be an ipm?
|
||
# Constants | ||
# Location of my branch for testing | ||
JT_LOC = '/cds/home/a/aegger/jet_tracking/jet_tracking/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be unhardcoded
|
||
# Setup data source and write directories | ||
exp_run = ''.join(['exp=', args.exp, ':run=', args.run]) | ||
base_dir = ''.join(['/cds/data/psdm/', hutch, '/', args.exp, '/']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I get these folders likely won't change in our filesystem a long while, can they be moved to the yaml as it seems like a configuration value and just for portability's sake?
parser.add_argument('--run', type=str, \ | ||
default=(os.environ.get('RUN_NUM', None))) | ||
parser.add_argument('--cfg', type=str, \ | ||
default=(''.join([JT_LOC, 'mpi_scripts/mpi_configs/default_config.yml']))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for now. Todo for later: add some autodetection, sort of like happi does for its cfg
@@ -0,0 +1,23 @@ | |||
api_msg: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this file be moved up to higher level, as it doesn't seem to be specific to mpi? Seems kinda buried at the moment esp with nothing else in mpi_scripts
1: 'CXI:JTRK:REQ:DIFF_INTENSITY' | ||
2: 'CXI:JTRK:REQ:I0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these for other mpi_scripts?
Just a note, cleanup is coming, a lot of little things to fix here... Sorry for the hard coding and magic numbers, I think I know exactly how this should work now. |
@amandashack @vespos So is this ready to merge now? Further changes can be addressed in another PR |
I think it is. There are still improvements needed, but I thing it is at a good place to be merged for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't rereviewed but approving for the merge. Trusting Adam and the tests that its good enough.
Description
Add the calibration script
Motivation and Context
calibrate jet tracking runs
How Has This Been Tested?
Run on calibration data from Fromme
python jt_cal.py --exp cxilv4718 --run 172
have to source /reg/g/psdm/sw/conda1/manage/bin/psconda.sh
Where Has This Been Documented?