Skip to content

Instantly share code, notes, and snippets.

View keflavich's full-sized avatar

Adam Ginsburg keflavich

View GitHub Profile
@keflavich
keflavich / powerspecplot_in_casa.py
Created August 16, 2019 07:32
Power spectrum plotting in CASA
from turbustat.statistics import psds
import pylab as pl
import numpy as np
def plotpsd(image, pixscale=None, mask=None):
if isinstance(image, str):
ia.open(image)
data = ia.getchunk().squeeze()
ia.close()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
$ python setup.py install_radex install_myradex build install
/Users/adam/miniconda3/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running install_radex
Downloading RADEX
Download succeeded, or at least didn't obviously fail.
Extracting RADEX source from file /Users/adam/.astropy/cache/download/py3/1defa05c60c0df7c847ebc33345310c6
Reading fortran codes...
Reading file 'main.f' (format:fix,strict)
Reading file 'radex.inc' (format:fix)
@keflavich
keflavich / co2plots.py
Created June 9, 2019 21:29
some co2 plotting
import numpy as np
import pylab as pl
import pandas
def plotdata(csvfile, linestyle='-', marker=None):
if isinstance(csvfile, pandas.DataFrame):
dat = csvfile
else:
dat = pandas.read_csv(csvfile)
if 'Unnamed: 0.1' in dat:
#!/Users/adam/anaconda/envs/astropy35/bin/python
import os
import datetime
import co2meter.co2meter
import pylab as pl
mon = co2meter.co2meter.CO2monitor()
mon.start_monitoring(interval=10)
@keflavich
keflavich / get_db.py
Last active May 16, 2019 08:32
MTGA tool deck data retrieval
# cached metadata database retrieval
import json
import requests
cache = {}
def get_db():
if 'db' not in cache:
db_rslt = requests.get("https://mtgatool.com/database/database.json")