Skip to content

Instantly share code, notes, and snippets.

@thespacedoctor
thespacedoctor / gmail.yaml
Last active April 26, 2024 08:47
[Send Gmail from Python] #gmail #python
gmail:
username: "david.young@pessto.org"
password: "mypass"
@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 / 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 / README.md
Last active August 1, 2022 07:14
[Plot lightcurve of source from ZTF avro packet] #lightcurve #avro #ztf

Plotting ZTF Lightcurves from AVRO Packet

Here is the gist for the script and an example AVRO packet.

To generate a lightcurve from the AVRO alert packet for the ZTF object run the plot_ztf_lightcurve_from_avro.py script with the following usage:

python plot_ztf_lightcurve_from_avro [-o] <avrofile> 
@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.