Skip to content

Instantly share code, notes, and snippets.

View andycasey's full-sized avatar

Andy Casey andycasey

View GitHub Profile
@andycasey
andycasey / gist:1cf6c5cc8eac6120f8ec
Last active August 29, 2015 14:02
CarPy is borked by default on Zorro
TL;DR:
``
setenv PYPREFIX /usr/local/CarPy
setenv PYTHONBASE /usr/local/CarPy/builds/Darwin.10.6.x86_64/
source /usr/local/CarPy/Setup.csh
setenv PATH /usr/local/CarPy/builds/Darwin.10.6.x86_64/bin:/usr/local/CarPy/builds/Darwin.10.6.x86_64/Python.framework/Versions/2.5/bin:/usr/local/CarPy/dist/bin_local:/usr/local/CarPy/dist/bin:/usr/local/CarPy/dist/bin_oldnumeric:/usr/local/CarPy/builds/Darwin.10.6.x86_64/bin:/usr/local/CarPy/builds/Darwin.10.6.x86_64/Python.framework/Versions/Current/bin:/usr/local/CarPy/dist/bin_local:/usr/local/CarPy/dist/bin:/usr/local/CarPy/dist/bin_oldnumeric:/Library/Frameworks/EPD64.framework/Versions/Current/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/usr/X11/bin:/usr/local/wcstools/bin:/usr/local/isis/bin:/usr/local/cdsclient/bin:/Applications/itt/idl/bin:/usr/local/magellan/bin:/usr/local/lco/bin
setenv PYTHONPATH /usr/local/CarPy/dist/lib_local:/usr/local/CarPy/dist/lib:/usr/local/CarPy/dist/lib_oldnumeric
setenv PYTHONDATA /usr/local/CarPy/datafiles
``
@andycasey
andycasey / gist:11047437
Last active August 29, 2015 14:00
well shit
In [1]: import ads
In [2]: first_query = list(ads.query(properties="software", rows=200))
In [3]: print len(first_query)
200
# OK, so the first query is limited by the number of rows we requested..
# This searches for both 'software' and 'refereed' properties...

Keybase proof

I hereby claim:

  • I am andycasey on github.
  • I am andycasey (https://keybase.io/andycasey) on keybase.
  • I have a public key whose fingerprint is 3619 615A 9E31 72A1 3423 A455 8F9E 0180 C859 9221

To claim this, I am signing this object:

@andycasey
andycasey / gist:9048403
Created February 17, 2014 10:42
Git aliases
alias status='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gca='git commit -a'
alias gd='git diff'
alias gco='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias gp='git pull'
# coding: utf-8
""" Analyse Gaia 'Benchmark' stars observed with the HERMES spectrograph. """
__author__ = "Andy Casey <andy@astrowizici.st>"
import os
from glob import glob
import smh

To-do items:

  • Clear out deleted files in repository
  • Create master release for historical purposes
  • Setup.py
  • Inititate test suite
  • Make API easier to complete stages (e.g. normalisation, stellar parameter determination)
  • Setup test suite for the Sun
  • Setup tests for EW measurements
  • Script to do standard-type analysis
  • Install script via pip (requirements)

TO DO

  • ads.search to return a generator so that we can obtain >200 queries
  • metrics built-in
  • >200 objects returned for each node level in citations and references
  • refactor
  • more comprehensive test suite
  • better handling of unicode/funny characters
  • some kind of hard warning for queries that try to retrieve >10,000 objects?
  • BiBTeX on demand!
  • allow positional queries for affiliations
# coding: utf-8
""" Stellar atmosphere model interpolator """
__author__ = "Andy Casey <andy@astrowizici.st>"
# Standard libraries
import os
import logging
import re
@andycasey
andycasey / gist:7138264
Last active December 26, 2015 10:39
FORTRAN-formatted files are shitty curses on modern programming languages.
import re
shitty_fortran_file_contents = """
43 0.20 0.0718 1.647E+07 2767.7 1.413E-01 8.382E+05 1.385E-01 0.000E+00
44 0.30 0.1681 2.500E+07 2798.9 1.644E-01 9.098E+05 1.472E-01 0.000E+00
45 0.40 0.2657 3.375E+07 2830.3 1.909E-01 9.885E+05 1.560E-01 0.000E+00
46 0.50 0.3645 4.271E+07 2861.8 2.212E-01 1.075E+06 1.649E-01 0.000E+00
47 0.60 0.4641 5.191E+07 2893.4 2.559E-01 1.170E+06 1.738E-01 0.000E+00
48 0.70 0.5643 6.135E+07 2925.3 2.958E-01 1.275E+06 1.827E-01 0.000E+00
49 0.80 0.6649 7.102E+07 2957.5 3.413E-01 1.391E+06 1.917E-01 0.000E+00
@andycasey
andycasey / gist:6353784
Last active December 21, 2015 19:20
phantompy on OSX 10.6.8
I'm on OS X 10.6.8 and I just installed cmake 2.8.11.2. Following the instructions on https://phantompy.readthedocs.org/en/latest/install.html#get-the-code, this is what I got:
mrmagoo:build andycasey$ cmake ..
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/cc