Skip to content

Instantly share code, notes, and snippets.

David Young thespacedoctor

Block or report user

Report or block thespacedoctor

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
@thespacedoctor
thespacedoctor / README.md
Last active Sep 17, 2019
[AVRO to MySQL Import Speed Test] #mysql #kafka #avro #ztf #lsst
View README.md

AVRO to MySQL Import Speed Test

This script will run on a folder of ZTF avro alerts (e.g. an unarchived bundle from the ZTF nightly archives).

Create a conda environment within which to run the script:

conda create -n avro_speed_test python=2.7 pip
@thespacedoctor
thespacedoctor / goodbadastro.py
Created Aug 8, 2019
[Good or Bad Astrometry] work through folder of FITS images and overlay astrometry than filter via good/bad #pessto #astrometry #image
View goodbadastro.py
#!/usr/bin/env python
import glob
import re
import string
import os
import ntt
@thespacedoctor
thespacedoctor / generate_mmd_page_of_mmd_image_links.py
Created Aug 8, 2019
[Generate a Multimarkdown Links to Images in an Assets Folder] #images #markdown
View generate_mmd_page_of_mmd_image_links.py
@thespacedoctor
thespacedoctor / generate_books_of_the_bible_nested_folders.py
Created Aug 8, 2019
[Generate Books of the Bible as Nested Folders] #bible
View generate_books_of_the_bible_nested_folders.py
#!/usr/local/bin/python
# encoding: utf-8
"""
*Generate books of the bible and chapters as nested folders*
:Author:
David Young
:Date Created:
August 14, 2015
@thespacedoctor
thespacedoctor / symlink_devonthink_files.sh
Created Aug 8, 2019
[Symlink File to Devonthink] #symlink #devonthink
View symlink_devonthink_files.sh
@thespacedoctor
thespacedoctor / filecount.sh
Created Jul 18, 2019
[Recursive Directory File Counts] #bash #directory #folder #count
View filecount.sh
find . -maxdepth 5 -mindepth 2 -type d | while read dir; do
printf "%-25.25s : " "$dir"
find "$dir" -type f | wc -l
done
@thespacedoctor
thespacedoctor / gmail.yaml
Last active Jul 10, 2019
[Send Gmail from Python] #gmail #python
View gmail.yaml
gmail:
username: "david.young@pessto.org"
password: "mypass"
@thespacedoctor
thespacedoctor / open_active_things_projects_in_separate_windows.applescript
Created May 27, 2019
[Open each active project in Things app in a new window - for review] #things #applescript #project
View open_active_things_projects_in_separate_windows.applescript
tell application "Things3"
-- MAKE SURE EVERY PROJECT HAS AT LEAST ONE TASK, OTHERWISE PROCEEDING ACTIONS WON'T FIND THE PROJECTS WITH 0 TASKs
repeat with pr in projects
if status of pr is open then
set thisCount to count of to dos of pr
if thisCount is 0 then
tell pr to make new to do with properties {name:"delete me"}
end if
end if
@thespacedoctor
thespacedoctor / 2019_02_08_768543036215015007.avro
Last active Apr 8, 2019
[Plot lightcurve of source from ZTF avro packet] #lightcurve #avro #ztf
View 2019_02_08_768543036215015007.avro
Objavro.codecnullavro.schema��{"type": "record", "version": "3.2", "name": "alert", "namespace": "ztf", "fields": [{"type": "string", "name": "schemavsn", "doc": "schema version used"}, {"type": "string", "name": "publisher", "doc": "origin of alert packet"}, {"type": "string", "name": "objectId", "doc": "object identifier or name"}, {"type": "long", "name": "candid"}, {"type": {"type": "record", "version": "3.2", "name": "candidate", "namespace": "ztf.alert", "fields": [{"type": "double", "name": "jd", "doc": "Observation Julian date at start of exposure [days]"}, {"type": "int", "name": "fid", "doc": "Filter ID (1=g; 2=R; 3=i)"}, {"type": "long", "name": "pid", "doc": "Processing ID for science image to facilitate archive retrieval"}, {"type": ["float", "null"], "name": "diffmaglim", "default": null, "doc": "Expected 5-sigma mag limit in difference image based on global noise estimate [mag]"}, {"type": ["string", "null"], "name": "pdiffimfilename", "default": null, "doc": "filename of positive (sci mi
@thespacedoctor
thespacedoctor / README.md
Last active Mar 7, 2019
[Listen to LVC GCN Notices and Download Localisation Maps] #ligo_virgo #map #gcn
View README.md

LVC GCN Listener & Map Downloader

This script will continuously listen to the GCN notice stream, filtering only notices originating from Ligo-Virgo. If an event is detected, and a skymap is referenced in the VOEvent packet, the script will immediately download a local copy of the HealPix localisation map.

Python 2.* only at the minute.

Here are the only dependencies you should need to install:

pip install fundamentals requests pygcn
You can’t perform that action at this time.