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
### simple cylindrical world map... requires https://github.com/wyojustin/astropy_visibility/blob/main/world.npy | |
def plot_world_map(): | |
fig, ax = pl.subplots(1, figsize=(12, 6)) | |
ax.set_xticks(np.arange(-180, 181, 60)) | |
ax.set_yticks(np.arange(-90, 91, 30)) | |
antarctica = world[:,1] < -60 | |
ant = world[antarctica] | |
start = np.argmin(ant[:,0]) | |
stop = np.argmax(ant[:,0]) | |
length = stop - start |
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 cv2 | |
import cv2.aruco as aruco | |
markerSize = 4 | |
totalMarkers=100 | |
key = getattr(aruco, f'DICT_{markerSize}X{markerSize}_{totalMarkers}') | |
arucoDict = aruco.Dictionary_get(key) | |
def findArucoMarkers(img, draw=True): |
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 PIL import ImageOps | |
from PIL import Image | |
import numpy as np | |
import pylab as pl | |
import sys | |
usage = '''USAGE: | |
python dither.py <input_image_fn> [dim] | |
''' | |
if len(sys.argv) < 2: |
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
#include "FastLED.h" | |
FASTLED_USING_NAMESPACE | |
// FastLED "100-lines-of-code" demo reel, showing just a few | |
// of the kinds of animation patterns you can quickly and easily | |
// compose using FastLED. | |
// | |
// This example also shows one easy way to define multiple | |
// animations patterns and have them automatically rotate. |
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 pylab import * | |
from numpy import * | |
Me = 5.98E+24 # KG | |
G = 6.67E-11 # KG^2/(MS^2) | |
Re = 6378137 # M | |
Rp = 6356752 # M | |
DEG = pi/180 | |
lat = arange(-90, 91, 1) * DEG |
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
''' | |
Download data from github: https://github.com/CSSEGISandData/COVID-19 | |
Place this file in | |
COVID-19/csse_covid_19_data/csse_covid_19_time_series/plotme.py | |
REQUIRES: | |
matplotlib | |
numpy | |
pillow |
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
### downloaded from web. Contact me if you developed this and would like attribution. wyojustin | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import AuthorizedSession | |
from google.oauth2.credentials import Credentials | |
import json | |
import os.path | |
import argparse | |
import logging | |
def parse_args(arg_input=None): |
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
#### USAGE! Attach to self.image (not self.root) that way button clicks do not count as long presses. | |
#### otherwise the button call backs hang long enough to trigger the long press | |
## self.longpress_obj = LongPressDetector(self.image, long_press_cb) | |
class LongPressDetector: | |
"""Helper class that calls a callback after a long press/click""" | |
# call_back will get the long_click duration as parameter | |
def __init__(self, root, call_back, long_press_duration = 1000 ): | |
"""Creates the LongPressDetector |
NewerOlder