Skip to content

Instantly share code, notes, and snippets.

View canismarko's full-sized avatar

Mark Wolfman canismarko

View GitHub Profile
In [1]: from haven.instrument.xray_source import PlanarUndulator
In [2]: from ophyd import sim
In [3]: undulator = sim.instantiate_fake_device(PlanarUndulator)
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File /home/beams1/B268176/miniforge3/envs/haven/lib/python3.9/site-packages/ophyd/device.py:325, in Component.__get__(self, instance, owner)
324 try:
--> 325 return instance._signals[self.attr]
@canismarko
canismarko / IOC boot log
Last active March 20, 2024 15:47
USB Ctr IOC Errors
Starting 20bmb
# Linux startup script
< envPaths
epicsEnvSet("IOC","ioc20bmb")
epicsEnvSet("TOP","/net/s20data/xorApps/epics/synApps_6_3/ioc/20bmb")
epicsEnvSet("SUPPORT","/APSshare/epics/synApps_6_3/support")
epicsEnvSet("EPICS_BASE","/APSshare/epics/base-7.0.8")
epicsEnvSet("ALIVE","/APSshare/epics/synApps_6_3/support/alive-R1-4-1")
epicsEnvSet("AREA_DETECTOR","/APSshare/epics/synApps_6_3/support/areaDetector-R3-12-1")
epicsEnvSet("ASYN","/APSshare/epics/synApps_6_3/support/asyn-R4-44-2")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@canismarko
canismarko / tiled_pydantic_mwe.py
Last active February 9, 2024 14:38
Tiled Pydantic Error
import numpy as np
import pandas as pd
from tiled.adapters.mapping import MapAdapter
from tiled.adapters.xarray import DatasetAdapter
from tiled.client import Context, from_context
from tiled.server.app import build_app
# Tiled data to use for testing
# Some mocked test data
@canismarko
canismarko / changes.diff
Created December 28, 2023 20:01
dungeonsheets-PR changes
diff --git a/dungeonsheets/character.py b/dungeonsheets/character.py
index 0e88c81..8c84232 100644
--- a/dungeonsheets/character.py
+++ b/dungeonsheets/character.py
@@ -196,7 +196,7 @@ class Character(Creature):
self.portrait = attrs.pop("portrait", None)
if self.portrait:
self.images = [(self.portrait, 1, 117, 551, 170, 220)] + self.images
- self.source_file_location = attrs.pop("source_file_location")
+ self.source_file_location = attrs.pop("source_file_location", "")
@canismarko
canismarko / HDFConvert.py
Created March 2, 2023 15:06
Converting HDF to TXT files
import pandas as pd
import h5py
from pathlib import Path
from tqdm import tqdm
target_dir = Path("./")
for fp in tqdm(list(target_dir.iterdir())):
if fp.suffix != ".hdf":
continue
Exception in thread Thread-21:
Traceback (most recent call last):
File "/local/usertxm/conda/anaconda/lib/python3.8/site-packages/tomoscan-0.1-py3.8.egg/tomoscan/tomoscan.py", line 668, in fly_scan
self.begin_scan()
File "/local/usertxm/conda/anaconda/lib/python3.8/site-packages/tomoscan-0.1-py3.8.egg/tomoscan/tomoscan_32id.py", line 211, in begin_scan
super().begin_scan()
File "/local/usertxm/conda/anaconda/lib/python3.8/site-packages/tomoscan-0.1-py3.8.egg/tomoscan/tomoscan_pso.py", line 97, in begin_scan
self.compute_positions_PSO()
File "/local/usertxm/conda/anaconda/lib/python3.8/site-packages/tomoscan-0.1-py3.8.egg/tomoscan/tomoscan_pso.py", line 291, in compute_positions_PSO
time_per_angle = self.compute_frame_time()
@canismarko
canismarko / CTSegNet_SavedModel_Output
Created April 20, 2020 18:02
First attempt at using CTSegNet
(tomo) ✘ mwolf@mal  ~/src/CTSegNet   master ●  python bin/run_segmenter_hdf5.py -c cfg_files/setup_seg_hdf5.cfg
############################################################
Welcome to CTSegNet: AI-based 3D Segmentation
############################################################
Dataset shape: (899, 940, 2124)
Dataset size: 7.18 GB
* 7f97348f122768e391bcbf70f78c3d04961f4fcd (upstream/master) Merge pull request #46 from aps-7bm/master
|\
| * 7eb98bd11afb04f5285eff9511fa144a9fc89257 (origin/master, origin/HEAD) Merge remote-tracking branch 'upstream/master'
| |\
| |/
|/|
* | 8cb16b3d2b728e0fd0f91127bb2a4d0f0ca76632 Update README.rst
* | 274b675608196b6992b5b523894f7e89974ecc38 Merge pull request #44 from decarlof/master
|\ \
| * | 65a7b7d771c75e3af6dd9317461e73c49285c7ab fix auto-mock
@canismarko
canismarko / gist:be0b5d0f4766eb0b603ca6b599271ea5
Created September 13, 2019 19:58
Rotation_Center_Astra_MWE
# -----------------------------------------------------------------------
# Copyright: 2010-2018, imec Vision Lab, University of Antwerp
# 2013-2018, CWI, Amsterdam
#
# Contact: astra@astra-toolbox.com
# Website: http://www.astra-toolbox.com/
#
# This file is part of the ASTRA Toolbox.
#
#