Skip to content

Instantly share code, notes, and snippets.

Genevieve Buckley GenevieveBuckley

  • Monash University
  • Melbourne
Block or report user

Report or block GenevieveBuckley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import RectangleSelector
def _select_rectangle_callback(eclick, erelease):
"""eclick and erelease are the press and release events"""
x1, y1 = eclick.xdata, eclick.ydata
x2, y2 = erelease.xdata, erelease.ydata
View beam_shift_limits.txt
In [60]: microscope.beams.electron_beam.beam_shift.limits
Out[60]: Limits2d(limits_x=Limits(min=-2.0009707e-05,max=2.0009707e-05),limits_y
In [61]: microscope.beams.ion_beam.beam_shift.limits
Out[61]: Limits2d(limits_x=Limits(min=-5e-05,max=5e-05),limits_y=Limits(min=-5e-
import numpy as np
import matplotlib.pyplot as plt
import numpy as np
from autoscript_sdb_microscope_client import SdbMicroscopeClient
from autoscript_sdb_microscope_client.enumerations import *
from autoscript_sdb_microscope_client.structures import *
def select_point(image):
GenevieveBuckley /
Last active Jun 25, 2019
Autoscript crosshair pattern for drift correction reference
import numpy as np
import as vision_toolkit
def cut_crosshair_patch(center_coordinate_pixels, image):
"""Returns cropped image region with crosshair drift correction reference.
GenevieveBuckley /
Created Jun 13, 2019 — forked from acbetter/
Image Viewer Example by PyQt5 and Python 3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog
GenevieveBuckley /
Created Jun 13, 2019
Non-blocking PyQt while loop callback using threading
"""Example of a non-blocking PyQt while loop callback using threading
Example adapted from this StackOverflow answer:
Ported from PyQt4 to PyQt5 using the tool pyqt4topyqt5:
import os
GenevieveBuckley / python_builds.txt
Created May 21, 2019
Building wheels and exe files with python
View python_builds.txt
# Build a wheel (outputs to dist/ directory)
python sdist bdist_wheel
# Build with pyinstaller
pyinstaller myfile.spec -w -F -y
## If no spec file currently exists
pyinstaller mypackage/
GenevieveBuckley / .gitignore
Created May 2, 2019
Python .gitignore template file
View .gitignore
# Sphinx docs
# Logging
# Testing and coverage
View python_wheels.txt
# Installing a python wheel
pip install some-package.whl
# Creating a python wheel
pip wheel --wheel-dir=path/to/save/wheel wheel_filename
# See
# PEP427 (describes the wheel format)
GenevieveBuckley / 2to3
Created Apr 30, 2019
Converting python 2 code to python 3
View 2to3
For the whole repository:
$ 2to3 --output-dir=python3-version/mycode -W -n python2-version/mycode
For a single file:
$ 2to3
# See details at:
# Stack overflow
You can’t perform that action at this time.