Feeds:
Posts
Comments

Debian Wheezy repository

This is the repository of the Debian testing, wheezy. It is still in the testing branch and will be stable by end of 2012. I have installed that recently. ################################################################################## deb ftp://ftp.debian.org/debian wheezy main contrib non-free deb-src ftp://ftp.debian.org/debian wheezy main contrib non-free deb http://ftp.debian.org/debian wheezy-proposed-updates main contrib non-free #deb http://security.debian.org/debian-security Wheezy/updates main deb http://security.debian.org/ wheezy/updates main contrib non-free deb http://www.debian-multimedia.org wheezy main non-free deb http://download.skype.com/linux/repos/debian/ stable non-free  ##################################################################################

The procedure:

Basically I have changed the source file (/etc/apt/sources.list), then run apt-get update, and then apt-get dist-upgrade.  It updated the list, and downloaded all the new packages. After that, the old packages were removed and started to install the new ones.

Problems: Since I have Debian on a MacBookPro, there are basically two issues that I had to solve manually. They are related to NVidia graphics card and Broadcom wireless card. I have installed them using the module-assistant as explained here. At some point during upgrade, it crashed complaining a dependency conflict (libgstreamer, if I remember correctly). I removed some packages using dpkg -r to solve the problem. Then, the upgrade was completed and I got a message about errors during the upgrade. It was basically Nvidia problem, as I expected. I following the instruction and run the module assistant.

That was it. Now, it runs Debian 7 (Wheezy), with an updated kernel (3.1). As far as I have experienced the system so far, it is rather stable.

Solar battery chargers

Recently, there are quite a lot of solar battery chargers. Such instruments like the one in the following image are able, in theory, to recharge mobile devices, ipods, etc when they are charged, and charge themselves using the sun light.

In this particular example, the company provides the following specifications for the instrument: it has a charge capacity of 3.5 Ah (Ampere  hour) at a potential difference of 3.7 Volts. That means it contains 12.95 Watt h energy when it is fully charged. Just for comparison, a small auto battery has like 40 A.h at a potential difference of 12 V.  That means the energy stored in the device is like 2% of the energy stored in an auto battery, so it is quite a bit actually.

Needless to say, you can charge it via AC adapter or USB cable of your laptop and use it to charge your mobile phone when required. The life cycle according to the webpage is 500. Indeed, the typical Lithium-ion polymer batteries have a life cycle of 1000 or more. Perhaps due to irregular solar charging rather than the standard net charging, the life cycle will be shorter as expressed in the webpage.

Can it really charge itself via solar radiation? I try to simply evaluate how much solar energy it can absorb, according to the data given in the webpage. The solar constant, the energy that the unit area on the top of the earth atmosphere receives in a second is about S = 1400 Watt per square meter. On tropical latitudes, the received energy on the ground is larger than 1000 W/m2. On middle latitudes like central Europe, and in a summer day, S = 800 W/m2. In winter, it is usually about 500 to 600 W/m2 in a sunny day. When it is overcast and very dark, it drops to values comparable to 1W/m2.

Now let us calculate how long it takes to collect 12.95 Wh energy from the received solar radiation on an average day. The collecting area, according to webpage, is 11.5 x 6.0 cm2 , and the efficiency is 17%. If I take S = 300 W/m2 for a relatively bright day, then the rate of collecting energy is

Area  x  Solar constant  x  efficiency = 69 cm2 x 300 W/m2 x 0.17 = 0.35 Watt.

Therefore to collect 12.95 Wh, i.e. to recharge the battery via sun light,  one has to keep the instrument in sunshine for 37 hours. In tropical regions, this time can be a factor 2 or 3 shorter.

This simple calculation shows that if you have such an instrument, you should be patient to get it charged using its own solar panel. In practice, the charging time can be longer because of the cloudy sky, and a decline of the efficiency with aging. 

Do you save money if you buy it?

Perhaps not, specially if you live in high latitudes. The instrument can, in theory, work for 500 cycles of 12.95 Wh. That amounts to 6.5 kWh during its lifetime. The electricity price in expensive cases is like half a dollar per kWh. That means you collect in total like 3.2 US dollar while the instrument costs like 40+ dollars. This particular device is more a (big) spare battery than a solar charger.

There are better options. Consider a similar instrument with an area of 2-3 times larger. That efficiently reduce the recharging time. In addition, I guess the systems with rechargeable AA batteries have the ability to live longer: you can exchange those batteries when they are dead. The solar panels usually work much longer (like 10+ years).

M13 in Hercules

M13 globular cluster in Hercules constellation is one of the favorite night sky objects for observers in northern hemisphere. This photo, captured on July 06, 2009. It is a composite photo of 23 exposures (8 seconds each). As usual, I used a Canon EOS 400D camera without tracking. The reduction and processing was done using Iris.

Using a Bayesian fit is totally different from a  least-squared fit. Doing it is also more complicated.  In a chi-squared fit, we minimize a merit function. In a Bayesian fit, we have a set of priors, and a set of observations. To fit a model to those observations, we calculate a likelihood function. Unlike a least-squared problem, here basically each variable has a distribution. and we find the peak of distribution as the solution for unknown parameters. It is way better to read a review or something like this nice paper:

http://adsabs.harvard.edu/abs/1992ApJ…398..146G

Well, now that we know what is it, how can we do simplest things with that: i.e., fitting a straight line to some data points? Pymc made it easy. It is a python package which contains three different solvers for Bayesian statistics including a Markov chain Monte Carlo (MCMC) estimator.

You can not only use it to do simple fitting stuff like this, but also do more complicated things.  However, I try to show some simple examples of its usage and comparison to a traditional fit in a separate post. Basically I compare fitting a parabola using chi-square and Bayesian method.

save the following in a file (I call it test.py):

# A quadratic fit
#———————————————————–
import numpy, pymc

# create some test data
x = numpy.arange(100) * 0.3
f = 0.1 * x**2 – 2.6 * x – 1.5
numpy.random.seed(76523654)
noise = numpy.random.normal(size=100) * .1     # create some Gaussian noise
f = f + noise                                # add noise to the data

z = numpy.polyfit(x, f, 2)   # the traditional chi-square fit
print ‘The chi-square result: ‘,  z

#priors
sig = pymc.Uniform(‘sig’, 0.0, 100.0, value=1.)

a = pymc.Uniform(‘a’, -10.0, 10.0, value= 0.0)
b = pymc.Uniform(‘b’, -10.0, 10.0, value= 0.0)
c = pymc.Uniform(‘c’, -10.0, 10.0, value= 0.0)

#model
@pymc.deterministic(plot=False)
def mod_quadratic(x=x, a=a, b=b, c=c):
      return a*x**2 + b*x + c

#likelihood
y = pymc.Normal(‘y’, mu=mod_quadratic, tau=1.0/sig**2, value=f, observed=True)
#———————————————————–

Now, go to command line and run the following (or alternatively put them in a file):

import pymc, test              # load the model file
R = pymc.MCMC(test)    #  build the model
R.sample(10000)              # populate and run it
print ‘a   ‘, R.a.value        # print outputs
print ‘b    ‘, R.b.value
print ‘c    ‘, R.c.value
The output looks like this:

The chi-square result: [ 0.0999244  -2.59879643 -1.49278601]
Sampling: 100% [00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000] Iterations: 10000
a    0.0981867109293
b     -2.54514077442
c     -1.77016283024

The correct results are a=0.1, b=2.6, and c=1.5. Both methods gave satisfactory results. Indeed, if you increase number of iterations from 10000 to one million, the answer will be like this:

Sampling: 100% [000000000000000000000000000000000000000000000000000000000000000000000000000000000000000] Iterations: 1000000
a    0.0997945467529
b     -2.59731835923
c     -1.47308938314

As you see, the results are more accurate compared to the former case.

If you like to have more information, you can use the following command:

print ‘a   ‘, R.a.stats()

a    {’95% HPD interval’: array([ 0.09956635,  0.10027448]), ‘n’: 1000000, ‘quantiles’: {2.5: 0.099545071298350371, 25: 0.099805050609863097, 50: 0.099919386231275664, 75: 0.10003496316945379, 97.5: 0.10025986774435611}, ‘standard deviation’: 0.0050467522199834905, ‘mc error’: 0.0003721035009025152, ‘mean’: 0.099548164235412406}

Recall that in  a Bayesian fit, each variable has a distribution. The following plot shows the data points as well as the two Bayesian fits.

To compare it with a least-square fit, I repeated the experiment with a sample data which has more noise. The resulting fits are compared in the following panel.

There are much more you can learn from the examples of Pymc. I hope in a future post, I can explain other types of fit, like a weighted-least-square fit or a bisector fit.

Sirius and M41

Following  older posts on astrophotography  where I have shown Lyra and Andromeda, here I present Canis Major, the constellation of the brightest star in the sky, Sirius. The M41 open cluster is seen clearly in the image. It has 90 seconds of total exposure time, a focal length of 30mm, and opening of f/4.0. I used Iris to calibrate and merge the raw images. The original  image has a resolution of about 8 times better.

Older Posts »

Follow

Get every new post delivered to your Inbox.