Skip to content

Instantly share code, notes, and snippets.

@thespacedoctor
thespacedoctor / 01_README.md
Last active September 19, 2023 23:12
[kindle highlights to PDF annotations] #kindle #highlight
@thespacedoctor
thespacedoctor / 01_README.md
Last active July 7, 2023 16:38
[soxsim] #soxs #simulate #data

soxsim

The gist containing this content and be found here.

Use this script to stitch together the simulated SOXS data (from E2E simulator) with official SOXS FITS headers (from NGC controller software).

Installation

conda create -n soxsim python=3.7 pip six pandas tabulate astropy
@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 / 01_README.md
Last active April 19, 2024 08:15
[Plot Results from ATLAS Forced Photometry Service] #atlas, #photometry, #lightcurve, #plot

Plot Results from ATLAS Forced Photometry Service

This code has been rehomed in this github repo.

@thespacedoctor
thespacedoctor / 0_REAME.md
Last active May 5, 2021 16:00
[Distribution of number of candidates that go into making ZTF objects] #ztf #lasair

Distribution of number of candidates that go into making ZTF objects

In ZTF speak a candidate is a single detection and an object is a collection of associated candidates. I wanted to visualise (see plot above) the distribution of the number of candidates (ncand) that go into making a ZTF object.

To generate the CANDIDATE table distribution data in candidate_ncand_dist.csv I run the following query on Lasair (April 8, 2020):

SELECT 
@thespacedoctor
thespacedoctor / ps1_point_source_scores_to_sherlock.py
Last active May 5, 2021 16:00
[PS1 to Sherlock Database Importer] #sherlock #panstarrts #dr1 #import
#!/usr/bin/env python
# encoding: utf-8
"""
*Ingest FITS data downloaded from MAST into Sherlock Database*
:Author:
David Young
:Date Created:
January 9, 2020
@thespacedoctor
thespacedoctor / 0README.md
Last active May 5, 2021 16:00
[Whitelist Dropbox Folders to Sync] #dropbox #sync #whitelist

Dropbox Whitelister

I use this script on my linux machines to whitelist a single folder located in my ~/Dropbox/server-sync directory. Here I have a separate folder for each of my servers.

To run the script use:

dropbox_whitelist [options] <serverName>

 -k|--keep keep all byproduct files (use for debugging)
@thespacedoctor
thespacedoctor / 0README.md
Last active May 5, 2021 16:00
[Generate an SOF from directory of FITS files] #fits #sof #esorex

Set of Frames (SOF) Files

Here's an example of sof (set of frames) files generated by the XSHooter pipeline when creating a master bias frame.

There are 4 files creates:

  1. data.sof
  2. input_sof.json
  3. output_files.sof
  4. products_sof.json
@thespacedoctor
thespacedoctor / 01_README.md
Last active May 5, 2021 16:00
[Parse Ligo-Virgo GCN VOEvents] #voevent #ligo_virgo #gcn

Parsing VOEvents Streamed from the Ligo-Virgo GCN Feed

Here you will find VOEvent packet examples for the 4 types of LV event alerts:

LV Alert Timeline<br>Image Credit: LVEM User Guide

  1. Preliminary GCN Notice. The automated preliminary notice is sent (via GCN) within 1-10 minutes of event detection and the trigger visible in GraceDB. Once a map has been generated a second preliminary notice is sent.

  2. Initial GCN Notices. A source classification (BNS, NSBH, BHBH ..) and updated skymap will be released within 4-24 hrs. The initial notice is also accompanied by a GCN Circular which is the first formal publication of the candidate and can be cited as such.

@thespacedoctor
thespacedoctor / example_recipe.py
Last active May 5, 2021 16:00
[Reflex Python Plugin Support] #python #reflex #pipeline #soxs #muse
# This file shows the minimum example of a Python based EsoRex recipe that can
# be integrated into a EsoReflex workflow, i.e. executed with the RecipeExecuter
# actor.
# The appropriate module needs to first be loaded that provides the facilities
# for declaring an EsoRex recipe plugin.
import esorexplugin
# Additionally it is convenient to import some of the utility functions from the
# module directly into this code's namespace. Note, the import statement above