Tuesday, April 21, 2009

Python 64 bit!

I got python 64 bit to compile, but it required a number of tricky steps.

First, this guy has the instructions I followed:
captnswing

However, it didn't work entirely as advertised. I ran the configure as advertised:

./configure --enable-framework=/Library/Frameworks \
--enable-universalsdk=/ \
MACOSX_DEPLOYMENT_TARGET=10.5 \
--with-universal-archs=all \
--with-readline-dir=/usr/local


then the make install, but /usr/local/bin/python pointed to the wrong place, so I replaced the symbolic link in my python path with the correct one:

sudo rm /Library/Frameworks/Python.framework/Versions/2.6/bin/python
sudo ln -s /Library/Frameworks/Python.framework/Versions/2.6/bin/python-64 /Library/Frameworks/Python.framework/Versions/2.6/bin/python


Now python is 64 bit:

eta ~$ python -c "import sys; print sys.maxint"
9223372036854775807


I haven't checked whether it works yet though...

Update: Had to reinstall with gnu readline installed. Also have to install PyQt4 and might have to recompile numpy...

numpy won't compile with python 2.6.2:
C compiler: gcc -arch i386 -arch ppc -arch ppc64 -arch x86_64 -isysroot / -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

compile options: '-Inumpy/core/include -Ibuild/src.macosx-10.5-universal-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c'
gcc: build/src.macosx-10.5-universal-2.6/numpy/core/src/_sortmodule.c
In file included from numpy/core/include/numpy/ndarrayobject.h:26,
from numpy/core/include/numpy/noprefix.h:7,
from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness
lipo: can't figure out the architecture type of: /var/folders/ni/ni+DtdqFGMeSMH13AvkNkU+++TI/-Tmp-//cceaWIvZ.out
In file included from numpy/core/include/numpy/ndarrayobject.h:26,
from numpy/core/include/numpy/noprefix.h:7,
from numpy/core/src/_sortmodule.c.src:29:
numpy/core/include/numpy/npy_endian.h:33:10: error: #error Unknown CPU: can not set endianness
lipo: can't figure out the architecture type of: /var/folders/ni/ni+DtdqFGMeSMH13AvkNkU+++TI/-Tmp-//cceaWIvZ.out
error: Command "gcc -arch i386 -arch ppc -arch ppc64 -arch x86_64 -isysroot / -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Inumpy/core/include -Ibuild/src.macosx-10.5-universal-2.6/numpy/core/include/numpy -Inumpy/core/src -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c build/src.macosx-10.5-universal-2.6/numpy/core/src/_sortmodule.c -o build/temp.macosx-10.5-universal-2.6/build/src.macosx-10.5-universal-2.6/numpy/core/src/_sortmodule.o" failed with exit status 1


That sucks.

Monday, April 20, 2009

Hosting on my mac

I'm hosting my website off my mac; it should be accessible to the outside world now: eta.colorado.edu.

A few things went into this....

  1. Don't install the fink version. The two versions clash and depending on how you access your computer you could end up looking at entirely different directories (e.g. localhost and eta.colorado.edu referred to different sites for a while)
  2. The configuration file is /private/etc/apache2/httpd.conf
  3. I needed to change DirectoryIndex to index.htm (from index.html)
  4. uncommmented "LoadModule php5_module libexec/apache2/libphp5.so"
  5. had to allow override so that .htaccess files would work.

Wednesday, April 15, 2009

Mac stuff cont'd

Trying to get Apache server to run, and it's just a pain.

I frequently forget how to update the locate database because it's different on macs. Marcos' Mac Singularity has the instructions .

In short:
sudo /usr/libexec/locate.updatedb

Tuesday, April 14, 2009

Google has failed me

So, either no one on the internet has successfully installed 64-bit python on a mac (which I find nothing short of impossible) or google has totally failed. None of the hits for any combination of 64 bit, python, mac, etc. has shown a useful result. Wow.

Monday, April 6, 2009

Caffeine

Caffeine consumption stopped around mid-October. I think it was when I got back from observing so October 20 give or take. Re-started consumption mid-March. Date is hard to say... I think it was Sunday before Spring Break, but hard to say because I still took it easy until ~last week.

Conclusions? I'm probably more tired in the mornings with caffeine than without. Also, probably perform better @ ulty when I'm not addicted. However.... not really conclusive. Just addictive.

Saturday, April 4, 2009

weekend

What did I do this weekend?
-upgraded PyRAF from 1.6.1 to 1.7
-switched matplotlib backends from TkAgg to Qt4
-put up a new article on molecularclouds


So... totally unproductive, but only in an awesome way?

I tried to switch PyRAF from X11 to Aqua a la Ticket 86 on the PyRAF trac site, but it failed with a can't-load error.

Also, updated readcol documentation so that it makes sense. Sam has used it, Robbie might.

Electron-Cyclotron Masers from planets around White Dwarves

I believe two departures from the stated topic become a rule rather than an exception. OK, so this is now a blog about generally interesting astronomical topics.

Today's topic is planets around white dwarves. First, why do we care? Well, everyone wants to find more planets, and in this case we'd be seeing planets that survived the deaths of their host stars.

When a main sequence star like the sun reaches a certain age (around 10 billion years old for the sun), it expands and cools, becoming a red giant. At this point, depending on a number of factors including the mass of the star, it can engulf the planets around it. If this happens, the planets experience a drag force (think "wind resistance") as they move through the star's atmosphere and they spiral in to the center, where they burn up and are destroyed.





However, if the star is just the right size and the planet is in just the right place, something more interesting may happen. The Red Giant phase lasts for a few hundred million years, after which it undergoes an Asymptotic Giant Branch (AGB) phase where it alternately grows and shrinks. During this phase, it will temporarily engulf a planet, but not for long enough to destroy it - just long enough to move it inwards a little bit. Of course, conditions on the planet won't be very pleasant during this period.



As shown in the animation, the AGB phase leads into the formation of a planetary nebula with a white dwarf at the center. If things went right, a planet could end up close to the white dwarf after the tumultuous period just described.

This is an exciting proposition because it opens the possibility that we could detect the planet interacting with the White Dwarf's magnetic field. You may recall hearing that the Earth has an iron core, which is why it has a magnetic field surrounding it. A similar planet orbiting a white dwarf would generate currents, and the electrons would then flow onto the poles of the white dwarf and show up as hot spots, like on Jupiter.



The hot spots would be impossible to spot by normal methods, but on either side of the hot spots there are big lobes where the electrons will emit radio light, which is detectable by the best radio arrays on the ground (e.g. the Very Large Array and LOFAR).



Why should we care? Well, besides just detecting the presence of a planet, we would be able to tell something about the conductivity of its core, which is very difficult in any other situation. We might also be able to say whether the planet has a magnetosphere and therefore was Earth-like. Finally, we could say something definitive about the eventual fate of the Earth... in about 4.5 billion years.

This post was based on papers by Andrew Willes and Kinwah Wu in 2004 and 2005.

Wednesday, April 1, 2009

April 1st, 2009

No April fools' day would be complete without scientists' contributions:

http://arxiv.org/abs/0903.5308
http://arxiv.org/abs/0903.5321
http://arxiv.org/abs/0903.5377

although it's not obvious whether .5308 is actually intended to be humorous