Skip to content
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

Merged
merged 24 commits into from
May 5, 2021
Merged

Add calibration script #19

merged 24 commits into from
May 5, 2021

Conversation

aegger13
Copy link
Contributor

@aegger13 aegger13 commented Nov 4, 2020

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?

@aegger13 aegger13 added the WIP label Nov 4, 2020
@ZryletTC ZryletTC changed the title Feature/jt cal Add calibration script Nov 6, 2020
Copy link
Contributor

@ZryletTC ZryletTC left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ABS_PATH=/cds/home/a/aegger/jet_tracking/jet_tracking/jet_tracking_cal
ABS_PATH=`dirname $(readlink -f $0)`

jet_tracking/jet_tracking_cal/submit_jt_arp.sh Outdated Show resolved Hide resolved
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']
Copy link
Contributor

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?

jet_tracking/__init__.py Outdated Show resolved Hide resolved

# Constants
# Location of my branch for testing
JT_LOC = '/cds/home/a/aegger/jet_tracking/jet_tracking/'
Copy link
Contributor

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, '/'])
Copy link
Contributor

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'])))
Copy link
Contributor

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:
Copy link
Contributor

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

Comment on lines 13 to 14
1: 'CXI:JTRK:REQ:DIFF_INTENSITY'
2: 'CXI:JTRK:REQ:I0'
Copy link
Contributor

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?

@aegger13
Copy link
Contributor Author

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.

@ZryletTC
Copy link
Contributor

@amandashack @vespos So is this ready to merge now? Further changes can be addressed in another PR

@vespos
Copy link
Collaborator

vespos commented Apr 30, 2021

I think it is. There are still improvements needed, but I thing it is at a good place to be merged for now.

Copy link
Contributor

@ZryletTC ZryletTC left a 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.

@ZryletTC ZryletTC merged commit 86ab473 into pcdshub:master May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants