Skip to content

Instantly share code, notes, and snippets.

@anielsen001
anielsen001 / exiftool.qmd
Created December 27, 2023 21:54
remove photo EXIF meta data with exiftool
Remove photo EXIF metadata with `exiftool`
```bash
exiftool -EXIF= <filename>
```
# this is a simple example of how to parse an Aranet4 CO2 sensor and plot the data using Julia
using Dates
using DataFrames
using CSV
using Plots
plotly()
fname = "Aranet4 017E9_2020-12-10T05_04_41.csv"
# example of using xargs to find files and sending files to a shell command with complicated file parsing
ls *mp4 | xargs -I{} sh -c 'base=$(basename $1 .mp4) ; ffmpeg -i "$1" -vcodec copy -an "${base}"_noaudio.mp4' -- {}
@anielsen001
anielsen001 / adsbx.conf
Created November 24, 2019 16:44
adsbexchange.com api interaction
[adsbx]
api_key =
[search]
lat =
lon =
dist =
@anielsen001
anielsen001 / quicklook.py
Last active November 18, 2019 10:53
meteor collection
import numpy as np
from matplotlib.pylab import plt
plt.ion()
def to_cplx( r ):
c = ( r[0::2]-127.5 ) + ( r[1::2]-127.5 )*1.0J
return c
d = np.fromfile( 'file2019-11-17-21', dtype=np.uint8, count = 2**32 )
@anielsen001
anielsen001 / mp_example.py
Created October 9, 2019 09:15
python multiprocessing example with return values
#!/usr/bin/env python3
import multiprocessing as mp
SENTINEL = None
dat = range(10)
rets = []
def function( *args ):
@anielsen001
anielsen001 / skin_depth.py
Created August 22, 2019 12:28
Generate skin depths in copper and aluminum as a function of frequency
"""
Permeabilities can be found here:
https://www.engineeringtoolbox.com/permeability-d_1923.html
Resistivity can be found here:
http://hyperphysics.phy-astr.gsu.edu/hbase/Tables/rstiv.html
"""
import numpy as np
@anielsen001
anielsen001 / ambiguity.py
Created June 19, 2019 09:22
Python implementation of wideband ambiguity function
# this is a python version of the wideband ambiguity function. A matlab version that it was ported from is below.
# https://dsp.stackexchange.com/questions/51372/how-to-calculate-the-ambiguity-function
import numpy as np
from scipy.interpolate import interp1d
from matplotlib import pylab as plt
tb = -1
tend = 1
dilation = 0.8
@anielsen001
anielsen001 / parser_examples.py
Created June 5, 2019 09:07
example code for parsing android data logger files
# Example code for parsing sensor log files from Andriod apps
import pandas as pd
# SensorDataLogger
# https://play.google.com/store/apps/details?id=es.terrik.SensorLogger
# 'a' and 'b' are empty colums
date_parser = lambda x: pd.datetime.strptime( x, "%Y-%m-%d_%H-%M-%S.%f" )
@anielsen001
anielsen001 / basemap.org
Last active November 15, 2018 01:36
building matplotlib/basemap

Target Ubunutu 16.04

Dependencies

cython

pip3 install cython

proj