Feature #14378
open
Speed up download of CTF data with beam tilt
Added by William Rice over 1 year ago.
Updated over 1 year ago.
Description
- move beam tilt queries out of loop and into main CTF query to significantly speed up this download
- for microscopes with no beam tilt-image shift calibration, puts raw image shift values into beam tilt so they can still be grouped by tiltgroup_wrangler.py
- Description updated (diff)
- added same speed-up to download of grouped CTF data from tiltgroup_wrangler_cli.py
- added changes to config.php.template to define temporary directories since this was also needed
- variables put into the ctf report php
- also added a definition to use a python different from the system python, used for downloading ctf grouped data
- Status changed from New to Assigned
- Assignee set to William Rice
Hi, Bill,
Can you add a default on these assignments that is back compatible ? Something like this:
$temp_dir = defined(TEMP_DIR) ? TEMP_DIR: "/tmp/";
This seems surprisingly difficult to get working. I have tried
$temp_dir = TEMP_DIR;
$temp_dir = empty($temp_dir) ? $temp_dir:"/tmp/";
and tried tests using functions empty(), isset(), and defined().
None seem to let me have it use the TEMP_DIR variable when it is defined or a default if it is not defined.
- empty($temp_dir) is true even when TEMP_DIR is defined.
- isset($temp_dir) is true even when TEMP_DIR is not defined.
- defined($temp_dir) is true even when TEMP_DIR is not defined.
Does my example work ? WIthout $, TEMP_DIR is a constant in php and can be evaluated through "defined". When it is false, it is not defined in config.php and therefore $temp_dir (a variable) is assigned to "/tmp/" which is what I called default.
No, it evaluates as false. I was hoping that a normal variable would work.
Sorry, figured it out. Needs to be in quotes for the test
$temp_dir = defined("TEMP_DIR") ? TEMP_DIR: "/tmp/";
found the same myself. Sorry about the bad example.
Also available in: Atom
PDF