Skip to content

Instantly share code, notes, and snippets.

@thespacedoctor
thespacedoctor / README.md
Created October 22, 2019 09:42
[List a subset of keywords from all FITS frames in a specified directory] #fits #xshooter #soxs #keyword

Report a list of the DPR.CATG, DPR.TECH and DPR.TYPE keywords from FITS frames.

Just copy the script into the directory of frames and run:

sh report_fits_keywords_for_directory.sh .
@thespacedoctor
thespacedoctor / download_kurucz_atoms.py
Last active May 5, 2021 16:00
[Kurucz Atomic Database Downloader] #atom #download #kurucz
#!/usr/local/bin/python
# encoding: utf-8
"""
*Scrape and download Kurucz atom lists*
:Author:
David Young
:Date Created:
October 8, 2019
@thespacedoctor
thespacedoctor / build_scheduler_api_calls_table.sql
Last active May 5, 2021 16:00
[Build Statistics Table for SOXS Scheduler API Calls] #soxs #scheduler #mysql
drop table scheduler_api_calls;
CREATE TABLE `scheduler_api_calls` (
`primaryId` bigint(20) NOT NULL AUTO_INCREMENT,
`transientBucketId` bigint(20) NOT NULL,
`objectName` varchar(50) NOT NULL,
`magnitude` double DEFAULT NULL,
`limitingMagnitude` tinyint(4) DEFAULT NULL,
`apiCallType` varchar(45) DEFAULT NULL,
`triggerTime` datetime NOT NULL,
@thespacedoctor
thespacedoctor / README.md
Last active May 5, 2021 16:00
[Renaming ESO Fits Frames Back to Their ORIGFILE Names] Renaming the XShooter fits files back to original more informative names instead of the ESO archive name #eso #xshooter #filename #fits

Renaming ESO Fits Frames Back to Their Original Names

Once FITS frames are added to the ESO Archive they are renamed with a standardised format. The original names are often more informative. This is a bash script to rename ESO fits files back to their original names.

@thespacedoctor
thespacedoctor / README.md
Last active May 5, 2021 16:00
[AVRO to MySQL Import Speed Test] #mysql #kafka #avro #ztf #lsst

AVRO to MySQL Import Speed Test

This script will run on a folder of ZTF avro alerts (e.g. an unarchived bundle from the ZTF nightly archives).

Create a conda environment within which to run the script:

conda create -n avro_speed_test python=2.7 pip
@thespacedoctor
thespacedoctor / goodbadastro.py
Created August 8, 2019 16:38
[Good or Bad Astrometry] work through folder of FITS images and overlay astrometry than filter via good/bad #pessto #astrometry #image
#!/usr/bin/env python
import glob
import re
import string
import os
import ntt
@thespacedoctor
thespacedoctor / generate_mmd_page_of_mmd_image_links.py
Created August 8, 2019 16:35
[Generate a Multimarkdown Links to Images in an Assets Folder] #images #markdown
@thespacedoctor
thespacedoctor / generate_books_of_the_bible_nested_folders.py
Created August 8, 2019 16:33
[Generate Books of the Bible as Nested Folders] #bible
#!/usr/local/bin/python
# encoding: utf-8
"""
*Generate books of the bible and chapters as nested folders*
:Author:
David Young
:Date Created:
August 14, 2015
@thespacedoctor
thespacedoctor / symlink_devonthink_files.sh
Created August 8, 2019 16:28
[Symlink File to Devonthink] #symlink #devonthink
@thespacedoctor
thespacedoctor / filecount.sh
Created July 18, 2019 08:27
[Recursive Directory File Counts] #bash #directory #folder #count
find . -maxdepth 5 -mindepth 2 -type d | while read dir; do
printf "%-25.25s : " "$dir"
find "$dir" -type f | wc -l
done