This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numba import cuda | |
import numpy as np | |
@cuda.jit | |
def foo(arr): | |
for i in range(arr.size): | |
arr[i] += i | |
A = np.arange(10000) | |
B = np.arange(10000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "/home/christopher/mc/envs/dp/bin/pyFAI-calib", line 47, in <module> | |
import pyFAI | |
ImportError: No module named pyFAI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
DatumNotFound Traceback (most recent call last) | |
<ipython-input-26-0b516695237d> in <module>() | |
----> 1 ev0 = next(events) | |
/mnt/work-data/other_src/databroker/databroker/databroker.pyc in get_events(headers, fields, fill, handler_registry, handler_overrides) | |
402 # (else omit it from the events of this descriptor) | |
403 if fill: | |
--> 404 fill_event(event, handler_registry, handler_overrides) | |
405 yield event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Start in the home dir | |
cd | |
# Need to install/start mongo | |
# install miniconda | |
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O ~/miniconda.sh | |
chmod +x miniconda.sh | |
./miniconda.sh -b -p ~/mc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# packages in environment at /mnt/work-data/other_src/mc/envs/master_dev2: | |
# | |
accelerate 2.2.0 np110py27_0 defaults | |
accelerate_cudalib 2.0 0 defaults | |
ase 3.12.0b1 <pip> | |
atk 2.8.0 0 mw | |
backports 1.0 py27_0 defaults | |
backports-abc 0.4 <pip> | |
backports.shutil-get-terminal-size 1.0.0 <pip> | |
backports.shutil_get_terminal_size 1.0.0 py27_0 conda-forge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [81]: retrieve(e['data']['pe1_image']) | |
Out[81]: | |
array([[ 0. , 0. , 0. , ..., | |
0. , 0. , 0. ], | |
[ 4844.60009766, 4847.5 , 4862.58349609, ..., | |
4563.81689453, 4625.20019531, 4574.41650391], | |
[ 4883.38330078, 4861.45019531, 4895.26660156, ..., | |
4736.98339844, 4641.60009766, 4626.58349609], | |
..., | |
[ 4739.86669922, 4723.53320312, 4718.79980469, ..., |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from magic import integrate | |
functions_dict = {integrate:[(args),{kwargs}} # ask people about more elegant way to do this | |
def __init__(self, functions_dict): | |
self.functions_dict = functions_dict | |
def run_analysis(self): | |
for data in self.data: | |
for func, v in self.functions_dict.items(): | |
ret = func(img, *v[0], *v[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
import numpy as np | |
from bluesky.plans import (scan, subs_wrapper, abs_set, pchain, | |
reset_positions_wrapper, count, list_scan, | |
open_run, close_run, stage, unstage, | |
trigger_and_read, checkpoint, sleep, wait) | |
from bluesky.callbacks.broker import post_run, LiveTiffExporter | |
from bluesky.callbacks import LiveTable, LivePlot | |
from bluesky.plan_tools import print_summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyFAI.geometry import Geometry | |
from skbeam.core.utils import radius_to_twotheta | |
from skbeam.core.utils import twotheta_to_q | |
from numpy.testing import assert_array_almost_equal | |
import matplotlib.pyplot as plt | |
geo = Geometry( | |
detector='Perkin', pixel1=.0002, pixel2=.0002, | |
dist=.23, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import databroker.databroker as db | |
def export_daemon(): | |
last_updated = now | |
while True: | |
last_updated_2 = now | |
hdrs = db(start_time=last_updated)) | |
last_updated = last_updated_2.copy() | |
if hdrs: | |
for hdr in hdrs: |
OlderNewer