Archive for December, 2009

Kstars: desktop planetarium

Kstars is a desktop planetarium in KDE. It is so user friendly that I prefer it over non-free programs.  You can select your geographic location, time zone, and local time, load whatever catalog you want (in addition to defaults), and check the sky. It is a must for any serious amateur astronomer.

Read Full Post »

Python: some additional packages

You might need some more packages to read ASCII tables, for instance. Here is a short list. You can check a more complete list on SciPy webpage. Other packages like pygsl can be found on sourceforge.


This page is intended to serve as a means for coordinating ideas about how astronomical utility libraries should be built for Python analogous to the ASTRON library for IDL. STScI would like to help develop an ASTRON-like library for Python. We have some resources to devote to it now and are starting work on building such tools. (for reference; here is the link to the documentation for the IDL “ASTRON library”).


This is a Python module to handle ASCII tables. Features:

  • Imports all reasonably well-formed ASCII tables
  • Column-first access
  • Easy creation and manipulation of tables, columns, rows and attached comments
  • Retains formatting of data values
  • Column sorting
  • Interchangeable comment character, column delimiter and null value
  • Exports data to: ASCII , FITS table , HTML table format , and LaTeX table format.


PyWavelets is a Python module for computing forward and inverse 1D and 2D Discrete Wavelet Transform, Stationary Wavelet Transform and Wavelet Packets decomposition and reconstruction.


DISLIN is a high-level plotting library for displaying data as curves, polar plots, bar graphs, pie charts, 3D-color plots, surfaces, contours and maps… It was provided by Max Planck Institute for Solar System Research, Lindau, Germany.


PyRAF is an environment that combines the power and flexibility of Python with the ability to use IRAF and STSDAS tasks…

and much more

For example, you can use unix commands in your python command line if you include unix.py and put it into your $PYTHONPATH, insert this line into ~/.pythonrc or execute manually:

from unix import *

Now, you can use commands like ls in your python shell.

You can also connect to your C++ and Fortran subroutines by F2py and weave.

Read Full Post »

Python: things to install 3


Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hard copy formats and interactive environments across platforms. Matplotlib can be used in python scripts, the python and ipython shell (ala MatLab or Mathematica), web application servers, and six graphical user interface toolkits.

Matplotlib tries to make easy things easy and hard things possible. You can generate plots, histograms, power spectra, bar charts, error charts, scatter plots, etc, with just a few lines of code. (PDF document, screenshots)

Some examples of Matplotlib….

An example of a polar plot.

An example of a polar scatter plot.

The source code for the above plot is as follows:

#!/usr/bin/env python
# a polar scatter plot; size increases radially in this example and
# color increases with angle (just to verify the symbols are being
# scattered correctlu).  In a real example, this would be wasting
# dimensionlaity of the plot
from pylab import *

N = 150
r = 2*rand(N)
theta = 2*pi*rand(N)
area = 200*r**2*rand(N)
colors = theta
ax = subplot(111, polar=True)
c = scatter(theta, r, c=colors, s=area)


Read Full Post »

How to format a new HDD?

few steps to format an external HDD, connecting by USB on Linux:

0) unmount it if it was mounted
1)  find which drive is it:

$ls  -l /dev/sda

it will be probably sda1 or sdb1, or similar

2) format it

$ mkfs.ext2  /dev/sda1
$ mkfs.ext2   -m 0 /dev/sda1 ( to keep nothing for superuser)

it may be .ext3 or .vfat

3) mount it, disk is the name

$ mount /dev/sda1/    /media/disk

4) make it accesible for read/write

$ chmod 777 -R /media/disk

that is it !

Read Full Post »

Python: things to install 2


The fundamental package needed for scientific computing with Python is called NumPy. This package contains:

  • a powerful N-dimensional array object
  • sophisticated (broadcasting) functions
  • basic linear algebra functions
  • basic Fourier transforms
  • sophisticated random number capabilities
  • tools for integrating Fortran code.

Documentation for NumPy or documentation as PDF

if you got used to IDL, see NumPy for IDL users page.

An interesting tutorial:

This is intended to show how Python can be used to interactively analyze astronomical data much in the same way IDL can. This tutorial has been written by Perry Greenfield and Robert Jedrzejewski to illustrate how one can use Python to do interactive data analysis in astronomy (in much the same style as is now popular with IDL). The focus is initially in showing someone how to get going quickly in using Python to do interactive tasks, and only later on teaching details of how to program in Python.


SciPy (pronounced “Sigh Pie”) is open-source software for mathematics, science, and engineering. The SciPy library depends on NumPy, which provides convenient and fast N-dimensional array manipulation. The SciPy library is built to work with NumPy arrays, and provides many user-friendly and efficient numerical routines such as routines for numerical integration and optimization. Together, they run on all popular operating systems, are quick to install, and are free of charge. NumPy and SciPy are easy to use, but powerful enough to be depended upon by some of the world’s leading scientists and engineers…

Besides its main package which provides numerous scientific modules like array manipulation, integration, interpolation, linear algebra, FFT, special functions, etc, you can include topical packages depending on your special tasks. For a complete list of the topical software within SciPy, see Topical Packages.

Read Full Post »

The most visible meteor shower in most years are the Perseids, which peak on August 12 of each year at over 1 meteor a minute. A useful tool to calculate how many meteors per hour are visible from your observing location is found here: http://leonid.arc.nasa.gov/estimator.html.

APOD: 2004 August 13 - Perseid Fireball Over Japan


The most spectacular meteor shower is probably the Leonids, the King of Meteor Showers which peaks on a day near 17 November. Approximately every 33 years the Leonid shower produces a “meteor storm”, peaking at rates of thousands of meteors per hour. These Leonid storms gave birth to the term “meteor shower”, when it was first realised during the November 1833 storm that the meteors radiated from near the star Gamma Leonis. The last Leonid storms were in 1999, 2001 (two), and 2002 (two). Before that, there were storms in 1767, 1799, 1833, 1866, 1867, and 1966. When the Leonid shower is not storming it is less active than the Perseids.

APOD: November 13, 1998 - A Leonid Fireball From 1966

Other notable strog meteor showers are Quadrantids and  Geminids.

The Geminids are a meteor shower caused by an object named 3200 Phaethon, which is thought to be an extinct comet. The meteors from this shower can be seen in mid-December and usually peak around 12-14 of the month. The Geminid shower is thought to be intensifying every year and recent showers have seen 120-160 meteors per hour under optimal conditions. The Geminids were first observed only 150 years ago, much more recently than other showers such as the Perseids and Leonids.

APOD: 2004 December 22 - Comet, Meteor, Nebula, Star

The meteors in this shower appear to come from a radiant in the constellation Gemini (hence the shower’s name). However, they can appear almost anywhere in the night sky, and often appear yellowish in hue. The meteors travel at medium speed in relation to other showers, at about 22 miles per second, making them fairly easy to spot. The Geminids are now considered by many to be the most consistent and active annual shower.

The radiant f the Quadrantids is an area inside the constellation Boötes. The name comes from Quadrans Muralis, an obsolete constellation that is now part of Boötes. It lies between the end of the handle of the Big Dipper and the quadrilateral of stars marking the head of the constellation Draco. Adolphe Quetelet of Brussels Observatory discovered the shower in the 1830s, and shortly afterward it was noted by several other astronomers in Europe and America.


APOD: 2009 January 5 - Comet and Meteor

Peak intensity is exceedingly sharp: meteor rates exceed one-half of their highest value for only about 8 hours (compared to two days for the August Perseids). This means that the stream of particles that produces this shower is narrow – and apparently derived within the last 500-years from some orbiting body. The parent body of the Quadrantids was recently tentatively identified (in a paper by Peter Jenniskens) as the minor planet 2003 EH1, which in turn may be the same object as the comet C/1490 Y1 [2] which was observed by Chinese, Japanese and Korean astronomers 500 years ago. The best date to view the Quadrantids is January 3, although they can normally be viewed on any day from the 1st to the 5th of the month. The radiant rises after local midnight.

Read Full Post »

Linux: list of modules

modprobe is a Linux program written by Rusty Russell used to add/remove a module to/from the Linux kernel (to add/remove a loadable kernel module).

The current version of modprobe is distributed as part of the software package “module-init-tools”, for Linux kernel version 2.5.x and later. It was previously developed as “modutils” for use with Linux versions 2.2.x and 2.4.x.

Modules are loaded when you boot the system. If you have a new hardware, e.g., a webcam, that is not recognized by the system, you have to check if the corresponding module was loaded.

which modules have been loaded?

$ lsmod
Module                  Size  Used by
nvidia               9576524  28
autofs4                20544  0
binfmt_misc             7120  1
rfcomm                 30368  0
l2cap                  18120  5 rfcomm
ppdev                   6348  0
parport_pc             22420  0
lp                      8012  0
parport                31144  3 ppdev,parport_pc,lp
cpufreq_powersave       1292  0
cpufreq_userspace       2768  0
cpufreq_conservative     6256  0
cpufreq_stats           3520  0
rpcsec_gss_krb5         8640  0
nfsd                  204900  0
exportfs                3792  1 nfsd
nfs                   221580  0
lockd                  57972  2 nfsd,nfs
fscache                34440  1 nfs
nfs_acl                 2640  2 nfsd,nfs
auth_rpcgss            31416  3 rpcsec_gss_krb5,nfsd,nfs
sunrpc                163772  7 rpcsec_gss_krb5,nfsd,nfs,lockd,nfs_acl,auth_rpcgss
fuse                   47752  1
tun                    11208  0
acpi_cpufreq            7640  0
ndiswrapper           149420  0
appletouch              8904  0
loop                   13324  0
firewire_sbp2          12692  0
snd_hda_codec_realtek   178472  1
snd_hda_intel          22192  2
mbp_nvidia_bl           2712  0
snd_hda_codec          63580  2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               6120  1 snd_hda_codec
applesmc               20780  0
joydev                  8576  0
snd_pcm_oss            32232  0
snd_mixer_oss          12368  1 snd_pcm_oss
led_class               3852  1 applesmc
snd_pcm                62420  3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
input_polldev           3588  1 applesmc
uvcvideo               49308  0
i2c_i801                8564  0
i2c_core               20844  2 nvidia,i2c_i801
videodev               31040  1 uvcvideo
pcspkr                  2104  0
btusb                  10276  2
snd_seq_midi            5688  0
v4l1_compat            11416  2 uvcvideo,videodev
iTCO_wdt                9696  0
bluetooth              47060  7 rfcomm,l2cap,btusb
snd_rawmidi            18596  1 snd_seq_midi
evdev                   8028  9
hid_apple               5668  0
snd_seq_midi_event      6212  1 snd_seq_midi
bcm5974                 7532  0
snd_seq                42436  2 snd_seq_midi,snd_seq_midi_event
snd_timer              17436  2 snd_pcm,snd_seq
snd_seq_device          6136  3 snd_seq_midi,snd_rawmidi,snd_seq
snd                    49060  15 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore               6184  1 snd
snd_page_alloc          8180  2 snd_hda_intel,snd_pcm
video                  18044  0
output                  2604  1 video
button                  5060  0
processor              34504  3 acpi_cpufreq
ac                      2960  0
battery                 6012  0
intel_agp              22900  0
agpgart                30836  2 nvidia,intel_agp
ext3                  107172  1
jbd                    41036  1 ext3
mbcache                 6924  1 ext3
usbhid                 31568  0
hid                    34528  2 hid_apple,usbhid
ide_cd_mod             24484  0
cdrom                  30316  1 ide_cd_mod
sd_mod                 28748  3
crc_t10dif              1632  1 sd_mod
piix                    5680  0
ide_pci_generic         3632  0
ide_core               88100  3 ide_cd_mod,piix,ide_pci_generic
ata_generic             4340  0
firewire_ohci          18952  0
firewire_core          37736  2 firewire_sbp2,firewire_ohci
crc_itu_t               2148  1 firewire_core
ata_piix               20848  3
libata                150904  2 ata_generic,ata_piix
sky2                   38636  0
scsi_mod              131800  3 firewire_sbp2,sd_mod,libata
ehci_hcd               29680  0
uhci_hcd               19132  0
usbcore               126004  9 ndiswrapper,appletouch,uvcvideo,btusb,bcm5974,usbhid,ehci_hcd,uhci_hcd
thermal                12580  0
fan                     4044  0
thermal_sys            13140  4 video,processor,thermal,fan

Read Full Post »