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
View rectangle_selector_example.py
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
=Limits(min=-2.0009707e-05,max=2.0009707e-05))
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-
05,max=5e-05))
View auto_lamella_26June.py
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
GenevieveBuckley / crosshairs_for_drift_correction.py
Last active Jun 25, 2019
Autoscript crosshair pattern for drift correction reference
View crosshairs_for_drift_correction.py
import numpy as np
import autoscript_toolkit.vision as vision_toolkit
def cut_crosshair_patch(center_coordinate_pixels, image):
"""Returns cropped image region with crosshair drift correction reference.
Parameters
----------
@GenevieveBuckley
GenevieveBuckley / QImageViewer.py
Created Jun 13, 2019 — forked from acbetter/QImageViewer.py
Image Viewer Example by PyQt5 and Python 3
View QImageViewer.py
#!/usr/bin/python3
# -*- 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
GenevieveBuckley / app.py
Created Jun 13, 2019
Non-blocking PyQt while loop callback using threading
View app.py
"""Example of a non-blocking PyQt while loop callback using threading
Example adapted from this StackOverflow answer:
https://stackoverflow.com/questions/22340230/python-pyqt-how-run-while-loop-without-locking-main-dialog-window?answertab=votes#tab-top
Ported from PyQt4 to PyQt5 using the tool pyqt4topyqt5:
https://github.com/rferrazz/pyqt4topyqt5
"""
import os
@GenevieveBuckley
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 setup.py sdist bdist_wheel
# Build with pyinstaller
pyinstaller myfile.spec -w -F -y
## If no spec file currently exists
pyinstaller mypackage/main.py
@GenevieveBuckley
GenevieveBuckley / settings.json
Last active May 2, 2019
Visual Studio Code settings.json config file
View settings.json
{
"editor.rulers": [
80
],
"autoDocstring.docstringFormat": "numpy",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"window.zoomLevel": 0,
"python.formatting.provider": "autopep8",
"editor.formatOnSave": true,
@GenevieveBuckley
GenevieveBuckley / .gitignore
Created May 2, 2019
Python .gitignore template file
View .gitignore
# Sphinx docs
docs/_build
# Logging
logs/*
!logs/.gitkeep
# Testing and coverage
cov.xml
.pytest_cache/
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 https://python101.pythonlibrary.org/chapter39_wheels.html
# PEP427 (describes the wheel format)
You can’t perform that action at this time.