Skip to content

Instantly share code, notes, and snippets.

@thespacedoctor
thespacedoctor / dummy.obs
Last active May 5, 2021 15:59
[OrbFit5.0 Options and Setup Files] An options file and a few setup files to get you up and running with Orbfit v5.0 #orbfit #ephemeris #orbital_elements #settings
04067J38D01T* A2000 01 01.000 00 00.0 +00 00 00.0 BZ020024
@thespacedoctor
thespacedoctor / papers-anno2md.py
Last active May 5, 2021 15:59
[papers-anno2md] A Script for macOS Papers.app: Convert Papers PDF Annotations to Markdown Notes and Add to the General Notes Section for the Publication #papers #annotations #markdown
#!/usr/local/bin/python
# encoding: utf-8
"""
*Convert Papers PDF Annotations to Markdown Notes and Add to the General Notes Section for the Publication*
:Author:
David Young
:Date Created:
August 30, 2017
@thespacedoctor
thespacedoctor / minor-planet-square-exposure-crossmatch.py
Last active May 5, 2021 15:58
[Moving Objects Telescope Exposure Crossmatch] Find which known minor-planet bodies lie within any telescope exposure with a square FOV #pyephem #moving_object #fov #atlas #crossmatch
#!/usr/local/bin/python
# encoding: utf-8
"""
*Find which known minor-planet bodies lie within any telescope exposure with a square FOV*
:Author:
David Young
:Date Created:
June 30, 2017
@thespacedoctor
thespacedoctor / README.md
Last active May 5, 2021 15:58
[Download PS1 images of TNOs] Use panstamps to download multiple PS1 images that a TNO is detected in #panstarrs #tno #moving_object #panstamps
@thespacedoctor
thespacedoctor / README.md
Last active May 5, 2021 15:58
[Coordinate-Square FOV Crossmatch] Given a location on the sky, and a list of the centres of square sky-tiles, return the tile ID(s) that cover the sky position. #atlas #fov #image #crossmatch

If you want to test the script with some data download this file of ATLAS pointings and run the example command in the docstring:

python sky-tile-pinpointer.py 5.46 09:13:13.89 +61:05:33.6 G268556-ATLAS-coverage-stats.csv
@thespacedoctor
thespacedoctor / G268556-ATLAS-coverage-stats.csv
Last active May 5, 2021 15:58
[PS1 and ATLAS Coverage Stats for GW170104] #panstarrs #atlas #ligo_virgo #coverage #GW170104 #likelihood
INDEX EXPID RA DEC MJD EXPTIME FILTER LIM-MAG CUM-AREA CUM-LIKELIHOOD
00000 TA107N17 107.92213 17.27220 57757.493516 30.0 c 18.86 30.32 00.00
00001 TA114N32 115.85167 32.36398 57757.502751 30.0 c 18.81 59.96 00.00
00002 TA109N27 110.61277 27.31987 57757.504349 30.0 c 18.68 89.75 00.00
00003 TA110N22 110.99279 22.25953 57757.506413 30.0 c 18.78 116.14 00.00
00004 TA112N17 113.15288 17.26072 57757.506904 30.0 c 18.90 141.89 00.01
00005 TA117N17 118.37233 17.26308 57757.516406 30.0 c 18.95 168.96 00.03
00006 TA115N22 116.32205 22.27249 57757.516907 30.0 c 18.81 193.40 00.04
00007 TA120N22 121.65217 22.27262 57757.517402 30.0 c 18.91 219.58 00.07
00008 TA115N27 116.22283 27.33236 57757.518959 30.0 c 18.83 242.92 00.07
@thespacedoctor
thespacedoctor / convert list of uncompleted reminders and their notes to taskpaper format.applescript
Last active May 5, 2021 15:58
[MacOS Reminders to Taskpaper] convert list of uncompleted reminders and their notes to taskpaper format #taskpaper #reminders
-- OUTPUT A LIST OF UNCOMPLETED REMINDERS AND THEIR NOTES IN TASKPAPER FORMAT
tell application "Reminders"
set myList to "inbox"
if (count of (reminders in list myList whose completed is false)) > 0 then
set todoListNames to name of reminders in list myList whose completed is false
set todoListNotes to body of reminders in list myList whose completed is false
set output to ""
repeat with itemNum from 1 to (count of todoListNames)
set output to output & "- " & (item itemNum of todoListNames) & return
if item itemNum of todoListNotes exists then
@thespacedoctor
thespacedoctor / Image zoom effect for Magnific Popup.markdown
Last active May 5, 2021 15:58
[Image Zoom Effect] Image zoom effect for Magnific Popup #image #zoom #ui
@thespacedoctor
thespacedoctor / copy-supplementary-data.rb
Last active May 5, 2021 15:58
[Jekyll supplementary data module] copy jekyll post's supplementary data files to a location adjacent to the post's built html #data #jekyll
module Jekyll
Jekyll::Hooks.register :site, :post_write do |site|
build = site.config["destination"]
site.posts.each {|post|
source = post.path.split("/")[0..-2].join("/")
# SKIP POSTS THAT ARE SINGLE FILES NOT DIRECTORIES
if source.split("/")[-1] == "_posts"
next
end
destination = post.url.split("/")[0..-2].join("/")
@thespacedoctor
thespacedoctor / sync.sh
Last active May 5, 2021 15:58
[Git Repo and Github Sync] Place at the root of a git repo and run from cron to schedule syncs with remote repo #sync #github #repo
#!/bin/sh
if [ -x /usr/local/bin/keychain ]; then
/usr/local/bin/keychain ~/.ssh/id_rsa
. ~/.keychain/`/bin/hostname`-sh
fi
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
HOST="$(hostname)"
cd $DIR