This file contains hidden or 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
from astropy.table import Table | |
data = Table.read("/uufs/chpc.utah.edu/common/home/sdss50/dr17/apogee/spectro/aspcap/dr17/synspec_rev1/allStar-dr17-synspec_rev1.fits") | |
column_names = data.dtype.names | |
ignore = ["TIII_FE"] | |
available_elements = [ea for ea in column_names if f"{ea}_FLAG" in column_names and ea not in ignore] | |
keep = ( |
This file contains hidden or 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
# /uufs/chpc.utah.edu/common/home/sdss43/dr17/apogee/spectro/redux/dr17/exposures/apogee-n/57282 | |
# or | |
# https://dr17.sdss.org/sas/dr17/apogee/spectro/redux/dr17/exposures/apogee-n/57282/ | |
from glob import glob | |
from astropy.io import fits | |
# Just use the middle chip for now | |
paths = glob("ap2D-b-*.fits") |
This file contains hidden or 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
# TODO: Library.get(X) should resolve to Library.get(id=X) | |
# Make & (Document.date > (datetime.now() - timedelta(days=365.25 * 5)) work | |
# Make document.year > 2017 work | |
# Make Document.in_(library) and Library.contains(document) work using docs() function | |
# Remove default behaviour of .limit(10) | |
# Document.full() should be searchable, and Document.full == '' SHOULD NOT WORK | |
""" | |
Give me: | |
- highly cited people; |
This file contains hidden or 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 pendulum | |
from datetime import datetime | |
from airflow import DAG | |
from airflow.models import DagRun | |
from airflow.sensors.external_task import ExternalTaskSensor | |
from airflow.operators.dummy import DummyOperator | |
def get_most_recent_dag_run(dag_id): | |
dag_runs = DagRun.find(dag_id=dag_id) |
This file contains hidden or 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 | |
from astroquery.gaia import Gaia | |
import matplotlib.pyplot as plt | |
import astropy.coordinates as coord | |
import gala.dynamics as gd | |
import gala.potential as gp | |
from astropy import units as u | |
np.random.seed(42) |
This file contains hidden or 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 pystan as stan | |
model = stan.StanModel(model_code=""" | |
data { | |
real parallax; | |
real parallax_error; | |
} |
This file contains hidden or 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 | |
from astroquery.gaia import Gaia | |
import matplotlib.pyplot as plt | |
def astrometry_covariance_matrix(source): | |
""" | |
Construct a covariance matrix for a 5-parameter astrometric solution | |
measured by Gaia for a single source. |
This file contains hidden or 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 | |
from scipy.spatial import Delaunay | |
training_set_labels = #.... from somewhere else | |
test_set_labels = np.atleast_2d(test_set_labels) | |
# construct convex hull of the training set using all labels | |
hull = Delaunay(training_set_labels) |
This file contains hidden or 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
wget https://data.sdss.org/sas/dr14/apogee/spectro/redux/r8/stars/l31c/l31c.2/cannon/allStarCannon-l31c.2.fits | |
wget https://data.sdss.org/sas/dr14/apogee/spectro/redux/r8/stars/l31c/l31c.2/allStar-l31c.2.fits |
This file contains hidden or 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 monitor and restart wireless access point when needed | |
maxPloss=10 #Maximum percent packet loss before a restart | |
restart_networking() { | |
# Add any commands need to get network back up and running | |
/etc/init.d/networking restart | |
#only needed if your running a wireless ap |