Skip to content

Instantly share code, notes, and snippets.

@thespacedoctor
thespacedoctor / 01_README.md
Last active April 1, 2021 12:02
[Plot ESO 1D FITS Binary Table Spectra] #spectrum #eso

Plot ESO 1D FITS Binary Table Spectra

This script can be used to generate plots of spectra contained in the ESO Fits Binary Table format, and optionally include a visualisation of an associated 2D spectral image.

The gist containing this content and be found here.

Installation

conda create -n plot_spectrum python=3.7 pip six matplotlib specutils numpy colour ccdproc
@thespacedoctor
thespacedoctor / idl_startup
Last active May 5, 2021 15:58
[IDL Startup dotfile] #idl #dotfile
defsysv,'!HOME',GETENV('HOME')+'/'
defsysv,'!IDL_RBUF_SIZE',5000
device,retain=2
; ---- Use my Progs directory and subdirs
myprogs=expand_path('+/misc/pessto/git_repos/idl',/all_dirs)
!PATH = myprogs+':' + !PATH
; ----
astrolib
@thespacedoctor
thespacedoctor / replicate_entry_in_devonthink.applescript
Last active May 5, 2021 15:58
[Replicate Item in Devonthink to specific location] Replicate a record to another location in devonthink #devonthink #applescript #duplicate #replicate
try
tell application id "DNtp"
set databasePath to "/Users/Dave/Dropbox/devonthink/home media.dtBase2"
set toDatabase to (POSIX path of databasePath)
set toDatabase to open database toDatabase
set theSelection to selection
if theSelection is {} then error "Please select something"
@thespacedoctor
thespacedoctor / OpenMeta2OSXTags.sh
Last active May 5, 2021 15:58 — forked from Zettt/OpenMeta2OSXTags.sh
[OpenMeta 2 MacOS tags] Script that reads OpenMeta tags and writes them to OS X Mavericks tags #tag #openmeta #convert
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
@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
@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 / 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 / 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 / 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 / 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