Skip to content

Instantly share code, notes, and snippets.

View josePhoenix's full-sized avatar

Joseph Long josePhoenix

View GitHub Profile
% pyraf
setting terminal type to xterm...
NOAO/IRAF PC-IRAF Revision 2.16 EXPORT Thu May 24 15:41:17 MST 2012
This is the EXPORT version of IRAF V2.16 supporting PC systems.
Welcome to IRAF. To list the available commands, type ? or ??. To get
detailed information about a command, type `help <command>'. To run a
command or load a package, type its name. Type `bye' to exit a
--> updatewcs.updatewcs("*flc.fits")
- IDCTAB: Distortion model from row 6 for chip 2 : F606W
Card is too long, comment will be truncated.
Card is too long, comment will be truncated.
Card is too long, comment will be truncated.
Traceback (innermost last):
File "<console>", line 1, in <module>
File "/Users/jlong/STScI/ssbrel/python/lib/python2.7/site-packages/stwcs-1.1.2-py2.7.egg/stwcs/updatewcs/__init__.py", line 98, in updatewcs
makecorr(f, acorr)
File "/Users/jlong/STScI/ssbrel/python/lib/python2.7/site-packages/stwcs-1.1.2-py2.7.egg/stwcs/updatewcs/__init__.py", line 122, in makecorr
size(400,400);
int off_x = 200;
int off_y = 200;
int r = 30;
PVector radius, nextradius, center_to_center, center;
center = new PVector(0, 0);
radius = new PVector(r, 0);
nextradius = new PVector(r, 0);
class Hexagon { // Unlike your generic polygon, I assumed six sides to simplify things
float cx, cy, r, theta; // r is radius, theta is orientation. I tried to figure out whether positive theta is clockwise or counterclockwise, but I forget. Basically, you can change the orientation of your hexagon from 0 to 2pi
PVector radiusvec, center_to_center; // radiusvec is a vector where magnitude is r
Hexagon(float _cx, float _cy, float _r, float _theta) {
// see above for these
cx = _cx;
cy = _cy;
r = _r;
theta = _theta;
iex(6)> mydata = [{"foo", 1}, {"bar", 34}, {"quux", -2}]
[{"foo", 1}, {"bar", 34}, {"quux", -2}]
iex(7)> Enum.map(mydata, IO.inspect)
** (UndefinedFunctionError) undefined function: IO.inspect/0
(elixir) IO.inspect()
iex(7)> myinspect = fn a -> IO.inspect a end
#Function<6.90072148/1 in :erl_eval.expr/5>
iex(8)> Enum.map(mydata, myinspect)
{"foo", 1}
{"bar", 34}
def do_a_thing(filename):
print "Filename was", filename
if __name__ == "__main__":
import sys
do_a_thing(sys.argv[1])
# $ python ~/example.py foo.bar
# Filename was foo.bar
@josePhoenix
josePhoenix / output.txt
Created October 3, 2014 20:49
cd package-template && pip install -e .
------------------------------------------------------------
/Users/jlong/.virtualenvs/webbpsf/bin/pip run on Fri Oct 3 16:48:32 2014
Obtaining file:///Users/jlong/GitHub/package-template
Running setup.py (path:/Users/jlong/GitHub/package-template/setup.py) egg_info for package from file:///Users/jlong/GitHub/package-template
running egg_info
writing requirements to packagename.egg-info/requires.txt
writing packagename.egg-info/PKG-INFO
writing top-level names to packagename.egg-info/top_level.txt
writing dependency_links to packagename.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
------------------------------------------------------------
/Users/jlong/.virtualenvs/pysynphottest/bin/pip run on Wed Oct 8 16:18:41 2014
Downloading/unpacking pysynphot
Getting page https://pypi.python.org/simple/pysynphot/
URLs to search for versions for pysynphot:
* https://pypi.python.org/simple/pysynphot/
Analyzing links from page https://pypi.python.org/simple/pysynphot/
Skipping link https://pypi.python.org/packages/2.7/p/pysynphot/pysynphot-0.9.5-py2.7-win32.egg#md5=c7896528a160edfd59b953170921cb44 (from https://pypi.python.org/simple/pysynphot/); unknown archive format: .egg
Skipping link https://pypi.python.org/packages/2.7/p/pysynphot/pysynphot-0.9.6-py2.7-win32.egg#md5=57a2b8733b95b5613610e9141779fb40 (from https://pypi.python.org/simple/pysynphot/); unknown archive format: .egg
Found link https://pypi.python.org/packages/source/p/pysynphot/pysynphot-0.9.5.tar.gz#md5=eb414e63cd7f52380828715eaa2c85ec (from https://pypi.python.org/simple/pysynphot/), version: 0.9.5
In [5]: for i in range(10) + ['missing'] + range(11,50):
...: print float(i)
...:
0.0
1.0
2.0
3.0
4.0
5.0
def my_decorator(function_to_decorate):
def new_callable(firstarg, *args, **kwargs):
print "first argument set to", firstarg
return function_to_decorate(firstarg, *args, **kwargs)
new_callable.__doc__ = function_to_decorate.__doc__
return new_callable
def do_a_thing(foo, bar, baz='quux'):
print "foo is", foo
print "bar is", bar