Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Maximilian Nöthe maxnoe

🏠
Working from home
  • TU Dortmund
  • Germany
View GitHub Profile
@maxnoe
maxnoe / perseverance.ipynb
Created Mar 8, 2021
Perseverance flight to Mars animated using matplotlib / astropy / astroquery
View perseverance.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maxnoe
maxnoe / plot_cosmic_rays.py
Created Dec 5, 2019
Plot data files from https://lpsc.in2p3.fr/cosmic-rays-db without unpacking the tarball
View plot_cosmic_rays.py
import tarfile
import pandas as pd
from io import TextIOWrapper
import matplotlib.pyplot as plt
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('outputfile')
@maxnoe
maxnoe / plot_mjd_secondary.py
Last active Apr 21, 2021
Plotting a secondary MJD date axis with matplotlib ≥ 3.1
View plot_mjd_secondary.py
import matplotlib.pyplot as plt
import numpy as np
from astropy.time import Time
import astropy.units as u
t = Time.now() + np.linspace(0, 30, 30) * u.day
# plot something vs time normally using a list of datetimes as x values
fig, ax = plt.subplots(constrained_layout=True)
@maxnoe
maxnoe / header-matplotlib.tex
Last active Aug 17, 2018
Graphic explaining the hillas features in Imaging Air Cherenkov Astronomy
View header-matplotlib.tex
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{fontspec}
\usepackage{xcolor}
\setmainfont[BoldFont=Akkurat Office]{Akkurat Light Office}
\setsansfont[BoldFont=Akkurat Office]{Akkurat Light Office}
\setmonofont[BoldFont=Fira Code, Scale=MatchLowercase]{Fira Code Light}
\usepackage[
math-style=ISO,
@maxnoe
maxnoe / muon_lifetime_fits.py
Last active Jun 21, 2018
Fitting histograms of muon lifetimes. Do not estimate weights from your data!
View muon_lifetime_fits.py
import numpy as np
from scipy.optimize import curve_fit, minimize
import matplotlib.pyplot as plt
from tqdm import tqdm
from scipy.stats import poisson
MUON_LIFETIME = 2.196_981_1
bins = np.linspace(0.5, 12, 150)
@maxnoe
maxnoe / download_gutenberg.py
Last active Jan 5, 2018
Download html and images from gutenberg.spiegel.de and convert to ebooks
View download_gutenberg.py
import requests
from bs4 import BeautifulSoup
from argparse import ArgumentParser
import subprocess as sp
import tempfile
import os
from multiprocessing.pool import ThreadPool
import json
import logging
import re
View ADS_Language_Query.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.