Skip to content

Instantly share code, notes, and snippets.

@hdevillepoix
hdevillepoix / KML_countours.py
Last active July 13, 2025 16:32
generate map contours in KML
# coding: utf-8
# requires srtm: https://github.com/aatishnn/srtm-python
# pip install simplekml
# cache location for srtm
SRTM_cache = r'/home/dfn-user/SRTM3/dds.cr.usgs.gov/srtm/version2_1/SRTM3'
MIN_LAT = -27.667
MAX_LAT = -27.585
MIN_LON = 119.923
{
"version": 1,
"type": "raster",
"sources": [
{
"uri": "mapbox://tileset-source/hadry/SOURCE_ID"
}
],
"minzoom": 12,
"maxzoom": 22
sed -i '/^#/! s/+//g; /^#/! s/ //g'
@hdevillepoix
hdevillepoix / de-AASmacro.sh
Created December 6, 2022 17:12
Replace AAS macros from a bib file (typically exported from ADS)
#!/bin/bash
# de-AASmacro a bib file
ifile=/tmp/hadrien.bib
sed -i 's|\\zap|Zeitschrift fuer Astrophysik|g' ${ifile}
sed -i 's|\\ssr|Space Science Reviews|g' ${ifile}
sed -i 's|\\sovast|Soviet Astronomy|g' ${ifile}
sed -i 's|\\solphys|Solar Physics|g' ${ifile}
sed -i 's|\\skytel|Sky and Telescope|g' ${ifile}
#!/bin/bash
# script to be called in crontab
# the idea is to set the same environment for cron jobs
# as if they were run on a live shell
#
# list conda environments installed: conda-env list
#
# usage: /usr/local/bin/conda_ini.sh conda_environment_name whatever_script.sh -a whatever arguments
#
@hdevillepoix
hdevillepoix / trajectory_info_to_DFN_pipeline_ready.ipynb
Last active May 30, 2022 16:09
This notebook that lets you generate a meteor observation table, compatible with the DFN data processing pipeline
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# https://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples.html
gcc listhead.c -o listhead -I/usr/lib/x86_64-linux-gnu -lcfitsio
@hdevillepoix
hdevillepoix / great_expectations_DFN_dataset.py
Created February 15, 2019 13:17
Messing with the great expectations package
import numpy as np
from astropy.table import Table
import great_expectations as ge
ifile = '/home/hadry/data/consolidated_dfn_fireball_dataset-latest.xml'
t = Table.read(ifile)
# great_expectations derives a pandas dataframe
df = ge.from_pandas(t.to_pandas())
df.set_index('event_codename')
@hdevillepoix
hdevillepoix / gphoto_next.sh
Created August 12, 2018 07:56
DFN lens testing/focussing gphoto wrapper script
#!/bin/bash
# lens testing script
# takes a picture with gphoto, and opens a jpg version on screen
#
# gphoto doesn't support multiple same model cameras, as they are designated by model instead of USB port
# to find out what your model is called:
# gphoto2 --list-cameras | grep D810
#
# requirements: dcraw, gphoto, eog
# camera setting: RAW only (no RAW+JPG)