Skip to content

Instantly share code, notes, and snippets.

View alexrudy's full-sized avatar

Alex Rudy alexrudy

View GitHub Profile
Process: Finder [255]
Path: /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
Identifier: com.apple.finder
Version: 10.7.2 (10.7.2)
Build Info: Finder_FE-751002010000000~9
Code Type: X86-64 (Native)
Parent Process: launchd [234]
PlugIn Path: /Library/ScriptingAdditions/TotalFinder.osax/Contents/Resources/TotalFinder.bundle/Contents/MacOS/TotalFinder
PlugIn Identifier: com.binaryage.totalfinder
@alexrudy
alexrudy / getattr.py
Created September 19, 2012 03:46
Stack Attribute Trick
def __getattr__(self,name):
"""Provides a passthrough for functions that we haven't named yet.
This allows *stacks* to call methods defined within *frames*. Most frames define a :meth:`~BaseFrame.__show__`. This method can be called using :meth:`show` with the following syntax::
>>> Stack.show("SomeFrameName")
The special syntax can take as many framenames as desired as arguments, and will call the named method on each one. So::
>>> Stack.show("FrameA","FrameB","FrameC")
@alexrudy
alexrudy / installiraf.md
Created October 16, 2012 01:24
IRAF installation

Title: Notes on Installing IRAF Author: Alexander Rudy

Introduction

We're going to install [IRAF][] and [PYRAF][] on a MacMini. Our MacMini uses [MacPorts][] to manage most things, so a lot of software will be checked and updated using [MacPorts][]. The installation instructions are mostly done stream of conciousness as I went through everything. It turns out that despite [IRAF][]'s big, scary, horrible nature, this process is not too complicated for a basic, working setup.

PLEASE BEAR IN MIND:

  • I use [MacPorts][] whenever possible, and almost always for Python things. If your numpy, matplotlib or ipython installations are wierd, you're in for a ride.
  • Also, I don't do much interactively in PyRAF, so if you do, you may find bugs. Let me know!
@alexrudy
alexrudy / ssh-instructions.md
Last active December 12, 2015 06:58
A description of my setup for SSH keys and GNU Screen

SSH Key-Based Authentication

First, on the local machine:

$ ssh-keygen -t rsa

This creates an ssh key. You should only do this once, and you only need to do it if you want to set your own password to use with your SSH key. Here are some good reasons to set a password with your SSH key:

  • If someone steals your key files, they can't use them.
  • Your password will be stored in the Mac OS X Keychain (like so many others), so you usually won't even have to enter it.
  • Passwords make life a little bit safer.
@alexrudy
alexrudy / MeetingNotes-6-17.md
Created June 18, 2014 04:32
Meeting Notes from 2014/6/17

First Group Meeting

Evan and I met to discuss the start of his SIP work. We are currently persuing three projects:

  1. Learning Python
  2. Exploring images of the Crab Nebula
  3. Reading the Schweitzer et. al. Paper

We also talked briefly about stellar evolution, and how Pulsars form.

@alexrudy
alexrudy / starlist.py
Last active August 29, 2015 14:14
Starlist Parsing Tools
"""
This is a parser for the Keck starlist format.
The format is documented at the Keck website: <https://www2.keck.hawaii.edu/observing/starlist.html>
Author: Alex Rudy, UCSC
Date: 2015-01-24
License: BSD
"""
import warnings
@alexrudy
alexrudy / flipaxes.py
Last active August 29, 2015 14:17
Flip OSIRIS Datacube axes.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""OSIRIS Datacubes have axes which are (WAVE, RA, DEC) in FITS files. Most programs
for reading and analyzing data cubes expect to have axes which are (RA, DEC, ...).
This script moves the (RA, DEC) axes to the front of the data cube.
The data is transformed using :func:`numpy.rollaxis` and the WCS solution is transformed
using :meth:`~astropy.wcs.WCS.reorient_celestial_first`. All other FITS header keywords
remain unchanged.
@alexrudy
alexrudy / submit.pl
Last active August 29, 2015 14:19
Prepare LaTeX Manuscripts for Submission
#!/usr/bin/env perl
#
# submit.pl
# A simple tool to prepare .tex manuscirpts for submission.
#
# Copyright (c) 2015, Alexander Rudy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@alexrudy
alexrudy / tmux_funcs.sh
Last active August 29, 2015 14:19
tmux shell scripting functions
#
# tmux_funcs.sh
#
# This file provides some basic helper functions for
# working with TMUX from a shell script.
#
# Copyright (c) 2015, Alexander Rudy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@alexrudy
alexrudy / Compound Models.ipynb
Created May 5, 2015 22:07
Compound Astropy Models
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.