Skip to content

Instantly share code, notes, and snippets.

View cgobat's full-sized avatar
🔭

Caden Gobat cgobat

🔭
View GitHub Profile
@cgobat
cgobat / AAVSO_M67_photometry.ecsv
Last active April 8, 2026 04:13
AAVSO standard field photometry
# %ECSV 1.0
# ---
# datatype:
# - {name: AUID, datatype: string}
# - {name: Label, datatype: uint8}
# - name: Umag
# unit: mag
# datatype: float64
# meta: !!omap
# - {ucd: PHOT_JHN_U}
@cgobat
cgobat / standardize_headers.py
Last active March 27, 2026 16:11
Standardize FITS headers produced by different smart telescopes
#!/usr/bin/env python
# Script to standardize and fix up FITS headers from several different smart
# telescopes (Seestar, DWARFLAB, Celestron Origin). Adds consistent MJD-OBS,
# DATE-OBS, and DATE-END timestamps, as well as misc. cleanups.
#
# Author: C. Gobat
import argparse
import datetime as dt
@cgobat
cgobat / origin_metadata.py
Created March 25, 2026 23:32
Populate Celestron Origin FITS header metadata using info.json
#!/usr/bin/env python
#
# This script populates metadata in the headers of FITS files produced by a Celestron Origin
# telescope, using information from an accompanying JSON file
#
# Author: @cgobat
import json
import argparse
import numpy as np
@cgobat
cgobat / AT2025agmm.ipynb
Last active December 15, 2025 05:56
Data reduction/analysis of observations of M31 nova AT 2025agmm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cgobat
cgobat / cputemp.py
Created December 8, 2024 21:18
Script to easily print current CPU temperature
#!/usr/bin/env python
"""Display/print current CPU temperature.
Copyright Caden Gobat (@cgobat on GitHub)
This program is free software. You may use, copy, modify, and/or redistribute it under the terms of the GNU GPL v3.
The lm-sensors package (or whatever provides the `sensors` command on your distro) is required to run this program.
This file is most useful if it is made executable and placed somewhere on your $PATH.
@cgobat
cgobat / 01_start.gcode
Created May 16, 2024 22:41
Creality Ender 3 v2 start/end gcode
M104 S160 ; Start warming extruder to 160
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
G28 ; Home all axes
G29 L ; Load UBL
G29 A ; Activate the UBL System.
G29 J ; 3-point level
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
G1 X0.1 Y20 Z0.5 F5000.0 ; Move to start position
@cgobat
cgobat / 00_readme.md
Last active March 21, 2024 11:57
Alpine Linux setup tools
@cgobat
cgobat / astro_hq.py
Last active October 11, 2023 16:03
Raspberry Pi setup script for astronomy. Portions from https://github.com/rlancaste/AstroPi3. Run `git clone https://gist.github.com/72d5705e65822a4e06363a444b1d2022.git scripts` to start.
print("This script has moved to https://github.com/cgobat/astro-instruments/blob/main/AstroHQ/astro_hq.py")

Turns a FITS binary table of Gaia DR3 stars with $m_G\leq8$ into a pseudo-tetra3-style database of stars with $m_V\leq7$.

@cgobat
cgobat / stdev_confidence_conversions.py
Created February 9, 2023 00:35
Functions to easily convert between number of sigma (standard deviations) and percent confidence intervals.
# see https://en.wikipedia.org/wiki/68–95–99.7_rule
import numpy as np
from scipy import special
def sigma_to_pct_conf(z: float) -> float:
"""If an uncertainty is ±zσ, what is the corresponding confidence interval?"""
return special.erf(z/np.sqrt(2))
def pct_conf_to_sigma(conf: float) -> float: