Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / astorb2ephem.py
Last active May 5, 2021 15:59
[astorb2ephem] Convert the astorb.dat database into an ephemeris database for a given epoch #orbital_elements #astorb #pyephem #ephemeris
#!/usr/local/bin/python
# encoding: utf-8
"""
*Convert the astorb.dat database into an ephemeris database for a given epoch (a solar-system snapshot). Note this script uses PyEphem to generate the ephemerides, so although it is fast, the resulting ephemerides are far from accuracte*
:Author:
David Young
:Date Created:
October 6, 2017
@thespacedoctor
thespacedoctor / 02a57844o0109c.dph
Last active May 5, 2021 15:59
[Find known astroids in ATLAS exposure] Using an inital pyephem generated ephemeris database, using orbfit, extract out the matched asteroid photometry from an ATLAS dophot file #atlas #asteroid #ephemeris #photometry
This file has been truncated, but you can view the full file.
# RA Dec m idx Type xtsk ytsk fitmag dfitmag sky major minor phi probgal apmag dapmag apsky ap-fit
72.99893 -0.17370 12.035 1 1 7313.40 41.15 -13.267 0.036 599.22 3.964 3.844 -11.84 -0.369E+02 -12.866 0.039 628.11 0.401
76.12737 -0.15137 12.590 2 1 1217.26 43.51 -12.759 0.020 537.91 4.137 3.937 -79.71 -0.294E+02 -12.990 0.007 583.07 -0.231
74.27340 -0.16706 12.081 4 1 4834.93 46.37 -13.238 0.028 607.48 3.996 3.876 -29.62 0.396E+02 99.999 0.011 0.00 0.000
76.61990 -0.13135 11.697 6 1 246.76 69.18 -13.643 0.018 504.47 4.218 3.926 -86.71 -0.306E+02 -13.908 0.003 581.17 -0.265
72.17332 -0.15140 11.307 8 1 8925.98 83.46 -13.998 0.016 662.68 3.941 3.859 7.13 0.320E+02 99.999 0.000 0.00 0.000
71.86221 -0.13694 11.915 14 1 9536.47 109.92 -13.374 0.011 648.81 3.940
@thespacedoctor
thespacedoctor / tidy_gmail_labels.py
Last active May 5, 2021 15:59
[Tidy Gmail Labels] Homogenise the visibility and naming of my Gmail labels (later converterd to macos finder tags) #gmail #label #tag
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from apiclient import errors
try:
@thespacedoctor
thespacedoctor / pinboard_tag_tidy_up.py
Created December 9, 2017 15:49
[Pinboard Tag Homogeniser] Make all pinboard tags lowercase with underscores #tag #pinboard
#!/usr/local/bin/python
# encoding: utf-8
"""
*Tidy up Pinboard Tags*
:Author:
David Young
:Date Created:
November 8, 2017
@thespacedoctor
thespacedoctor / archive-stale-marshall-transients.sql
Created December 19, 2017 08:29
[Archive Stale Transients in Marshall] Archive Old Objects from the Marshall Inbox #marshall
-- To count the objects before you archive them:
select * from transientBucketSummaries t, pesstoObjects p where p.marshallWorkflowLocation = "inbox" and p.transientBucketId=t.transientBucketId and t.dateAdded < "2016-04-15";
-- and then to archive:
update transientBucketSummaries t, pesstoObjects p set p.marshallWorkflowLocation = "archive" where p.marshallWorkflowLocation = "inbox" and p.transientBucketId=t.transientBucketId and t.dateAdded < "2016-04-16";
@thespacedoctor
thespacedoctor / README.md
Created December 27, 2017 13:29
[EFOSC SOFI Spectrum Counts for ESO Phase III] #phase_iii #efosc #sofi #spectrum #followup

How to Scrape the Data for the EFOSC SOFI Spectra for followed objects for ESO Phase III Release Description.

This will get you something like this:

Repeat this for SOFI spectra and export into an excel sheet and sort for the release description