Archive for January, 2007
So, I get a few search engine queries on pyraf that end up here – and occasionally searches of the site itself for pyraf. As you probably know, there is no pyraf installer here. The process of installing pyraf (or the larger stsci_python) is somewhat involved. But, I managed to do it today on my Mac Pro and I have lived to tell the tale. I’ll explain how I did it and where any problems popped up.
Ok, well let’s look at the requirements for stsci_python:
- IRAF (IRAF 2.13beta must be installed on MacOSX with Intel CPUs)
- TABLES/STSDAS – 3.6
- Tcl/Tk – v8.3 or higher
No problems here, installers are on this site for IRAF, TABLES, and STSDAS. Tcl/tk comes with OS X and it appears to be at version 8.3. What else does it need….
- Readline
- Python – v2.4 or higher (with readline and _tkinter modules enabled)
- Numeric – v24.2
- libf2c (Note: the package on our web site has a change that allows it to work on 64bit Linux platforms)
- Pmw 1.2
- Urwid -( optional)
- Ipython – (optional)
Ok, I needed some of these. Being a minimalist when it comes to installs, I ignored the Urwid and Ipython requirements. Python in Tiger is at 2.3, so that’s no good. I turned to fink for Readline, Python 2.4, Numeric, and Pmw. I installed Python 2.4 first, then the packages for it.
libf2c is included with iraf, and lives in /iraf/iraf/unix/bin.macosx or /iraf/iraf/unix/bin.macintel depending on your processor.
To make sure things are working, the stsci_python instructions say to try these commands:
%python
>>>import readline
>>>import Tkinter
>>>Tkinter._test()
>>>import Numeric
>>>import Pmw
and if there are no errors, you’re good. So, I tried them. Blamo – readline didn’t work. Oh, and python was curiously version 2.3. Hmm. It turns out fink installs python in /sw/bin which should have priority over the python at /usr/bin given the way that fink sets up its PATH variable. But, the python binary isn’t python it’s python2.4 so I had to create a symbolic link of python in /sw/bin and then typing python ran the fink python. Hooray. I learned later than a better approach is to change the symbolic link at /usr/bin/python to point at /sw/bin/python2.4.. This is because if you ever run an executable something_cool.py script, it may very well explicitly state the python path as /usr/bin.
All the above commands worked, but Tkinter._test() only will show a window if you run python from an xterm, xgterm, etc. or if you have manually set the DISPLAY variable in an OS X terminal. (Apple’s OS X Terminals do not set the DISPLAY variable which is why running X11 based programs from them usually fail. Simplest workaround – use an xterm or anything in which X11 appears as the active application – but not Terminal.)
Ok, so all now looked fine – I downloaded stsci_python, built numarray per their instructions, built stsci_python per their instructions (giving my f2c location as /iraf/iraf/unix/bin.macintel/) and pyraf was installed.
One extra thing I needed was scipy. That proved a pain because while I was able to compile numpy without any problems, scipy did not build giving some kind of g95 error. They had a binary for Tiger… but the download page explained that the binary installer would required Macpython or Activepython, neither of which I’d ever heard of before, and that the installer wouldn’t detect a fink build if python. Super. Indeed, it did not. So, not wanting to reinstall python, I used Pacifist to open the .pkg file and manually put the scipy folder in /sw/lib/python2.4/site-packages. This seems to be working, but I haven’t rigorously tested it yet.
Update The scipy trick very much did not work. I had to ultimately follow these instructions to compile scipy – the trick seemed to be that neither the fancy gcc 4.3 nor the Apple gcc 3.3 worked – it had to be gcc 4.02, and still I get 2 errors in the scipy.test(10). Confirming that I was using Apple’s gcc 4.02 required some trickery since I had installed gcc 4.3 from the MacOS X high performance computing site to get g95, and I don’t think scipy liked gcc 4.3
Anyway, it seems to be working now as well as I’m going to get it to…. the errors seem related to BLAS and check_dot. I don’t know what that means though.
Another update scipy woes continue. I either get the 2 errors in the test or I get malloc problems. And, the local package I’m trying to run which depends on scipy… that is producing odd “encountered invalid numeric results” problems. Which may or may not be scipy related but I think it is…
Yet another update – I’m told the failures in the scipy test don’t mean it’s not working … some failures are expected. The local pyraf based package however is very much not working, and in which package exactly the “invalid numeric result” is occurring is unknown at this time.
.
Google recently announced a port of FUSE (file system in user space) to the Mac, aptly titled MacFUSE. I didn’t pay much attention until today. Combined with sshfs (ssh file system) this is fairly useful method to mount other computers as volumes on a Mac. Granted, if you’re connecting to another Mac, Appleshare is probably better. It seems like a possible alternative to NFS exports, etc.
The idea of sshfs is that any ssh server can be mounted as a volume (seen in the Finder.) For copying files, the Finder and sshfs are about half as fast as sftp (sftp speeds done via Transmit.)
For editing of remote text files though (say, if you want to use TextWrangler), sshfs is probably a bit simpler than the download/re-upload method that Transmit and Fugu use.
Another cool trick is SpotlightFS, which turns spotlight queries into real functional folders (unlike smart folders in Tiger) that can be accessed via the Terminal.
Check it all out at Google’s MacFUSE site. MacFUSE requires MacOS X 10.4 (Tiger) or later.
.
I thought this was default behavior on Macs, and I think it was in the early days of OS X. But, my new Mac Pro wasn’t doing it as my iBook did so I googled around and found out how to enable transparency for the dock icons of hidden applications. This tip courtesy of Creative Bits and MacOS X Hints.
In a Terminal:
defaults write com.apple.dock showhidden -bool true
killall Dock
and whalaa, when you hide an Application, its Dock icon will become translucent.
.
I’ve noticed a reasonable number of Macintosh users who, when giving a presentation, use Powerpoint rather than Apple’s Keynote. Furthemore, there is another group (with some overlap) who use Firefox(not even the more Mac-like Camino).
Obviously, these are matters of personal preference – but I wonder how many Mac users use Firefox because they have heard how much better it is than Internet Explorer. And while it is certainly true that Windows users should use Firefox, on the Mac I personally don’t see the point. Safari is a much better and more Mac-like browser, in my opinion – and if you need a Mozilla browser, Camino is vastly more Mac-like in its behavior. I haven’t noticed that Firefox is any faster than Safari. For a while Firefox had better HTTP proxy support, but this is no longer true in Tiger.
As far as Keynote goes, there is seems to be a growing belief that Keynote is just better at producing higher quality presentations than Powerpoint.
My theory on Powerpoint is this – in the Microsoft Office hegemony in which we live, most people – even many Mac users – associate “presentation” with “Powerpoint” and aren’t aware of alternatives. Also, many universities and or businesses have site licenses for Office so many people just use what they have.
Hence, my latest highly unscientific poll – of the people who visit this site – are those who use Powerpoint doing so because they prefer it or because they haven’t tried Keynote? We’ll see what the results show.
My personal reasons for using Keynote (and also Pages for posters)? It supports vector PDF graphics. Powerpoint will take an EPS or PDF file and rasterize it – Keynote just keeps it in its glorious resolution-free state. That alone is reason enough for me.
UPDATE : I will go ahead and concede that if you have browsing issues with Safari it’s perfectly ok to try another browser. BUT, might I suggest the much more Mac-like Camino, which uses the same Gecko rendering engine as Firefox but isn’t a multi-platform UNIX-like program. Camino uses Mac-specfic features like the address book, the keychain, has spell-checking in text fields, etc. I can see how those coming from other platforms would … not miss a program that ignores these Mac specific abilities, but to me – a Mac application should act like it belongs on a Mac; not behave like a Linux program.
Update II Ok, ok. I get it. Extensions. I never use Firefox or Firefox extensions so I guess I just don’t know what I’m missing. I personally find Firefox so un-Mac-like I just don’t even consider it an option. However, the buzz is they are trying to make it behave more like a Mac like application (ala Camino) so we’ll see how it evolves.
Tags: apple, unix — .
On the download page and a direct download link is below.
Download STSDAS for MacOS X PPC .pkg installer
I also finally added a TABLES link on the download page. Although that has been available for weeks now, the link was missing.
Thanks to Killan Braun for nudging me about a STSDAS PPC installer. The files had been sitting on my laptop almost ready for weeks.
.
This pretty slick trick(via Daring Fireball) tells how to open remote man pages with BBEdit. I think it’s definining some sort of function in bash? I’ve never seen the function command used before, so I assume it’s a trick with some shell.
Mmm, indeed – it’s a bash function. If you use bash (and you might, because it’s the OS X default shell) there are TextWrangler instructions for bash in the comments of the original link … you’d add the function to your .bashrc file.
Being as how I use tcsh, and TextWrangler rather than BBEdit, I modified this tip to work as a shell script. I created a file manb, made it executable, put it in my path. It contains:
#/bin/csh
ssh $argv[1] man $argv[2] | col -b | edit -t "$2@$1" --clean --view-top
mmm, the last lines are --clean --view-top which appear to run off the edge of the screen. So, the idea is you type “manb remotehost ssh” and the ssh man page opens up in TextWrangler on your computer from the remote machine. Now, cooler would be able to type a command on the remote machine and open it up on your own computer … but seeing as how I rarely actually read man pages remotely, I haven’t bothered to try and write such a script.
For reading man pages that reside on your Mac, I highly recommend ManOpen, which includes a command line utility “openman” which you can type instead of “man.”
.
Generally speaking, IRAF tasks are single-threaded, meaning they don’t take advantage of multiple cores or multiple processors. So, wanting to use all the power in my new Mac Pro – I discovered one can run tasks in the background in IRAF with an &, just like in UNIX.
So, for those of us with Intel processors that have 2 cores, or Mac Pros with 2 2-core chips, this is a good way to speed up tasks by running multiple processes simultaneously. For data reduction, this can speed things up, since each extraction of say a spectra is independent of the next one.
For example, I automate my extractions of echelle spectra. Usually I make doit files and just run them all sequentally. But now I can set up a “doit” file that contains lines like so
myspec file1 output1 &
myspec file2 output2 &
myspec file3 output3 &
myspec file4 output4
....
and then four more lines similarly. The first 3 are run in the background, the fourth is run normally… so the fifth line of this doit file doesn’t get run until the fourth (and presumably at about the same time the first 3) tasks finish. Feed this into the cl like so…
cl> cl < doit
And the end result? IRAF uses nearly 400% of my CPU… check out the screen cap below…
Update Ok this does work. If I want to log what’s happening in each “myspectask” I just need to do…
myspectask input1 output1 > log1 &
making sure the ampersand is after the redirect to a log file.
Update Number 2 Apparently, some times the next batch of 3 background tasks tries to fire up before the first three are done, and then for some reason I get a “no more background slots” error, even though I’m told that IRAF can have 20 background tasks. So, I stuck a sleep 3 after each non-background task to let the background tasks “catch up” and finish before the next four simultaneous tasks are started. That seems to work…

.
The headline says it all. I’ve actually tested this one. It’s on the download page and a direct download link is below.
Don’t forget that TABLES 3.6 is required to use STSDAS.
Download STSDAS 3.6 for MacOS X – Intel
.
Hmm, so a Macworld Keynote without any mention of the Mac. Is this exciting or troubling?
First off, we have the iPhone. That is, in fact, its name – despite the fact that Linksys or someone just released a product with this name not just a few days ago. The best iPhone article I’ve read thus far is this one by Jason Snell. Can other companies write programs for the iPhone (i.e. is it a platform like the Mac or even Palm?) or will Apple keep others off. And can or can not people connect to AIM and the like on phone… or is it just SMS?
Overall, the iPhone looks pretty sweet, and I’m sure it’ll get better over time – along with variants. I don’t think I personally would ever spend $500 on a phone, though. I’d like an iPod with all the touch screen coolness though.
The Apple TV looks pretty cool. I have to say I want one. And I think it’ll work with my existing Macs – the only Mac requlrement is that it run 10.3.9 or later. Hey, my 400 MHz G4/AGP qualifies on that account. The AppleTV has an enigmatic “Intel processor” inside without further elaboration, and a 40 gig hard drive for caching – so presumably not much horespower is needed on the hosting computer. Pretty good for $299.
I would have liked to hear about iLife and iWork ’07, and MacOS X 10.5. Perhaps at WWDC? I imagine iLife and iWork get annouced via press release later this week. Leopard on the other hand, will still be a few months away.
.
Well, the last few days at Kitt Peak have served as a sometimes painful reminder of why I use Macs. They just work better than – well, anything else. Specifically, lately I’ve been around a handful of laptops running Linux and the experience has not been pretty.
On one the trackpad jumps around and there’s no way to configure it that I can find. (It’s SuSE).
On another, a USB mouse isn’t recognized at all when plugged in
On yet another – there’s no sound. Ah, Linux.
Back on the one with a jumpy trackpad, I tried to install the ecl on SuSE laptop – no uudecode. I had to compile and install GNU sharutils from source.
On I think maybe all of them, when using command-line sftp (no Fugu, but there must be a graphical sftp client for linux, I just don’t know what it is) – the backspace key doesn’t work, I have to hunt for the tiny delete key.
None have been able to print to an nearby lpr printer (this includes one Window laptop as well) except my iBook, so I’ve been printing things for others.
I just take all these things for granted. Things should just work. And, by and large, on my Macs things usually do just work. And when they don’t, I get understandably upset and make sure I find the fix. My impression from linux-laptop users is so many things don’t work right they just learn to accept it.
I don’t mean to completely disparage linux, it does have its place. Maybe my bullet list is as much an advertisement for … Ubuntu over SuSE than for a Mac. Never-the-less, I think those of us who use Macs for astronomy are definitely having a much smoother and more productive desktop (or in this case laptop) computing experience.
MacOS X has all the tools of Linux… and none of the weird shortcomings (peripherals, multimedia). When I see Linux/Windows dual boot laptops… I just scratch my head and am thankful I use a Mac.
.