After a long, tedious process (see previous posts), I got 64 bit python, 64 bit tcl/tk, and 64 bit tkinter all to work! I can now use the TkAgg backend in matplotlib! Python 64 bit on Mac OS X: Sam Skillman's post Tcl/Tk 64 bit: a post on the tcl/tk forums tkinter 64 bit: python bug report 4017 (last two posts give the solution) and my posted solution
Sync a fork with the original repository on Git
A seemingly simple operation that I just can't seem to get right. This page gives me useless information: $ git checkout -b upstream/master $ git remote add upstream git://github.com/upstream_maintainer/master.git $ git pull upstream remote $ git checkout master $ git merge upstream/master `` If you do that, it frankly doesn't work. Why? "upstream/master" etc. all have special meanings. Here's the real process & explanation (thanks to Erik Tollerud for some help): ``git checkout master # (assuming you have a local branch named master - otherwise, pick whatever branch you want synced)git remote add original git@github.com:thing/thing.git # "upstream" = "original" = "remote" - the place you're trying to sync fromgit fetch original # 'original' being the name YOU gave for the "remote/original" repositorygit merge master original/master # now merge the "original/master" branch (they should have a branch named "master" too, otherwise you have to figure out which branch to get) into your mastergit push # push your now-merged stuff back to github# I was instructed to use these commands. They didn't work.# git reset original # the word "original" here matches the word "original" on the previous line# git reset --hard original # this will overwrite local changes
Testing trackbacks?
I just want to see if "trackbacks" work at all. I recently posted about histograms on google spreadsheets. While I'm at it, might as well throw up a link to my google code site.
usetex failure in latex documents
When I use matplotlib's internal tex (rcParams['text.useTex']=False), the postscript files generated cause errors that look like this when you try to ps2pdf them: ps2pdf h2co_pilot.psError: /rangecheck in --get--Operand stack: --dict:20/25(ro)(L)-- --nostringval-- 71Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop 1739 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- %finish_show --nostringval-- --nostringval-- 9 6 0 --nostringval-- (pdf_text_enum_t) %op_show_continue --nostringval--Dictionary stack: --dict:1147/1684(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)-- --dict:116/300(L)-- --dict:44/200(L)-- --dict:25/42(L)--Current allocation mode is localLast OS error: 2Current file position is 791626GPL Ghostscript 8.64: Unrecoverable error, exit code 1make: *** [h2co_pilot.pdf] Error 1 They will not open in MacOS's Preview.app either. Solution: Make figures with rcParams['text.useTex'] = True
Using AWK to fixed-format print in VIM
24,42!awk '{printf("\%30s\%20f\%15g\%15g\%15g\%15g\%15g\%15g\%15g\%5i\n" , $1,$2,$3,$4,$5,$6,$7,$8,$9,$10)}'
It's important that the %'s must be escaped, otherwise they print the current filename.
wget
wget is very useful for acquiring data from, e.g., IRSA, the NASA Infrared Science Archive. wget -nd -r -l1 -A*g09*_b4_20.fits http://irsa.ipac.caltech.edu/data/IGA/images/ The important elements: -nd: don't reproduce the host directory structure -r: recursive. Grab the files referred to by the page, not just the page itself -l#: number of recursion levels -A: "accept" wildcard
Why astronomy is important
Preface: This is not a good argument for why astronomy is important now. But it may be in the future. Earth is a limited habitat. Bacteria in a petri dish show the same growth curve as humanity: exponential growth. An exponential curve grows very quickly, but we are in a finite (non-growing) environment. If humanity is to continue its growth, we must find new worlds to inhabit. There is always a moral question of whether we should continue our growth and attempt to conquer significant portions of the galaxy, but we probably won't (and maybe shouldn't) start examining the morality of our survival until it's ensured. Consider what happens if humanity stops growing. Our current economic system is completely dependent on continued growth. The financial markets can't survive unless more wealth is constantly being generated. Interesting calculation to try: Divide the total solar energy input to Earth by the average energy consumed per person, or the minimum energy (theoretically) per person. It's probably not as large as you think when you take into account efficiency factors.
Why can't numpy do duplicate index assignment
AG I want to do drizzling with numpy. It should be trivial, but it's impossible (without a for loop, afaik) instead. In [2]: a = array([1,1,2,2])In [3]: b = arange(5)In [4]: b[a] += 1In [5]: bOut[5]: array([0, 2, 3, 3, 4])In [6]: # but b should really be:In [7]: b[a] += 1In [8]: bOut[8]: array([0, 3, 4, 3, 4])
Why do astronomers have such a strong presence on the web?
I'm not making this a complete post, just a few examples of blogs and websites I'm aware of. But we do have a strong presence on the web - astronomers have an unusually high google ranking etc. Is it just because 'we' were here first ('we' excludes me, I'm just jumping on the bandwagon and getting a free ride)? Examples: Pamela Gay Dr Lisa Science writers who write on astronomy: Dave Mosher
wrapping text around a figure in latex
An example from Devin: %\begin{wrapfigure}{l}{0.5\textwidth} % \vspace{-27pt} % \begin{center} % \includegraphics[width=0.48\textwidth]{nsf_fig3.ps} % \end{center} % \vspace{-27pt} % \caption{\it{}} % \vspace{-12pt} %\end{wrapfigure} 1:16 \usepackage{wrapfig}