This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by Brett Morris @bmorris3 | |
# Saving for future use | |
def strided_array(a, window_width): | |
as_strided = np.lib.stride_tricks.as_strided | |
#window_width = 4 | |
new_shape = (len(a) - window_width + 1, window_width) | |
b = as_strided(a, new_shape, (a.strides[0], a.strides[0])) | |
return b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import astropy.io.ascii as at | |
from scipy.interpolate import interp1d | |
# Read in Kraus & Hillenbrand for later use | |
kh = at.read('kraushillenbrand5.dat') | |
ksub = np.array([-23,-19,-15,-12,-11,-9,-7,-6,-5,-4,-3,-2,-1]) | |
kh_rpmK0 = (kh['Mr'] - 0.035*(kh['Mr']-kh['Mi']) - 0.007 - kh['MK']) | |
kh_rpmK = kh_rpmK0[ksub] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://bconnelly.net/2013/10/creating-colorblind-friendly-figures/ | |
from __future__ import print_function, division | |
import matplotlib.pyplot as plt | |
from matplotlib import colors | |
from cycler import cycler | |
import numpy as np | |
palette_names = np.array(["Black", "Orange", "SkyBlue", "#009e73", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_mdm(filename,to_plot=False,return_header=False): | |
with fits.open(filename) as spec: | |
# print(spec.info()) | |
# print(spec[0].data) | |
flux = spec[0].data[0][0] | |
w0 = np.float(spec[0].header["CRVAL1"]) | |
wi = np.int(spec[0].header["CRPIX1"]) | |
wstep = np.float(spec[0].header["CD1_1"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from datetime import date | |
today = date.today().isoformat() | |
plt.savefig("filename_{0}.png".format(today)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to crossmatch literature binary IDs with Simbad and Gaia | |
""" | |
import os, sys | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import astropy.io.ascii as at | |
from astropy.coordinates import SkyCoord |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input_folder="./CA1_submitted" | |
output_folder="./CA1_rubrics" | |
rubric="CA1_rubric.pdf" | |
ls $input_folder/*.pdf > inlist | |
while read -r line | |
do | |
# echo "$line" | |
fname=${line##*/} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For PAF | |
# Title, author list, (year), journal, vol, first page | |
%T. %l (%Y), %J, %V, %p.\n | |
# For CV in LaTeX | |
# Title, author list truncated, (year), journal abbrev, vol, first page | |
%ZEncoding:latex\\emph{%T}. %10.4e (%Y), %q, %V, %p\\\ \\vspace{-0.35cm}\\\ | |
# for other products, print all possible info, have to edit by hand | |
%ZEncoding:latex\\emph{%T}. %10.4e (%Y), %q, %Q, %V, %p, %d, %X \\\ \\vspace{-0.35cm}\\\ |