2011/08/13

PyTango in Ubuntu natty

I have installed the lastest relase of kubuntu in a new computer and there is a better newer way to have tango installed in your system than the guide for tango that I have posted


Tango has been released for 10.04 LTS distribution of ubuntu by one of the developers: Alessio Igor Bogani, worker in Trieste's synchrotron: Elettra. After that the idea have had succeed and we have a official repository for core of tango.


Then: I had s pending to publish a how to for this repository and mark the old one saying that here is this update. Well go ahead.


step 0: Remove older tango-cs packages
If you have installed this abogani's repository, is better if you remove its packages and then remove the file in the '/etc/apt/sources.list.d/abogani-tango-.list'.


$ sudo add-apt-repository ppa:tango-controls/core
This also adds for you the key of this repository in your keyring and the file 'tango-controls-core-.list' file.


Like in the abogani's way here there are two ways to continue: with or without tango-db. The second way assumes that there is another server with the tango database running.


step 1, option with db:
If mysql is not installed in the system do it. I am not sure if this works well being executed in the same apt command. I suggest to first install mysql and then tango:
$ sudo apt-get install mysql-server
$ sudo apt-get install tango-common tango-db tango-starter tango-test python-pytango libtango7-doc omninotify
This also installs the necessary dependencies.


step 1, option without db:
The list of packages to install is the same but without the tango-db package:

$ sudo apt-get install tango-common tango-starter tango-test python-pytango libtango7-doc omninotify


step 2, starter is running in your system:
Check is there are running processes from the new user 'tango'. For example, 
$ ps -ef |grep tango
Should show two process: the DataBaseds (the one who listen the port 10000) and the Starter (the one responsible to launch the device servers on start up in the correct sequence).


Also, another way to check that this works fine, is to try to "import PyTango" in a python interpreter.


I hope soon I will explain how to configure some devices to simulate things of a synchrotron machine. But before we will have to prepare and configure the tango core utilities.

2011/08/05

Looking back, four years from now

In last June, this blog have made 4 years, I'm really sad that is not walking the way I thought.


From the last two years I am not writing much about the main goals of this blog. Like the name says this has been think to post information about cryptology and about synchrotron related stuff (this partially more in general about the physics I'm learning due to my job, but also write about software engineering on my job). At least I have wrote this way in the second post. I remember when I wrote the first one.


But looking back, the fact is that the events in the job are not the best to focus on development. From the smallest to the biggest. From the macroeconomic to daily work. From the global crisis and the particular situation of Spain to the lasts incidents that happens at work.


What the hell!! Cannot be the things easier? Is not possible to live in peace? Dedicating the efforts in what makes work funy.


In Alba, the head of Experiments division "decided to stop activity": complicated way to say in an email that he will left Alba next September. In the "good bye" email, with the cold subject "information" (reflects a lot the behaviour of the workers at this institution) he have mention many times the word "reputation".


Next years will be crucial for this synchrotron reputation. I have a similar opinion, but a bit different perspective.


Yes, the Alba's reputation is made by many individual users who come to perform experiments. The effort of all the workers will make the users happy and they will comeback and tell they colleges about how good the work is done here.


And also there is motivation. Motivation of the workers to do our best. But since the last years this is becoming difficult. We succeed in linac start up in 2008, then comes the booster and after the storage, this year the beamlines commissioning. But there are "individuals" who have capacity to break this good environment. Specially the people how are upper in the hierarchy, they have more public skills. And they broke it.


By today, the company has been demanded in the trial for it's attitude against the workers unions. About the acts that some one in the management has made to threatening the workers. This action is not what brakes the environment, this is the consequence of an aggressive attitude subtended in time. A long time, years.


Don't believe them when they say: then the victim reports the assault is injuring the reputation of the institution. It's a very bad excuse and it criminalizes the victim to say that has been harm.


The directors of the cells consortium (and the LLS and the ST -4, another society in the Alba's area) have done many actions that disturbs the environment. Since I start to work here I have seen many situations of power abuse. Under the umbrella of this happens from time to time and you have to be aware and as far from him that you can work, the better. We have lost many good workers. There are examples of fired people, and many are people who left Alba as fast as possible to go to "better" places (meaning better by anywhere, but many to the ITER and its European corp). And all of them have a very good background and skills. They were very big losses. We suffer it.


The president of this institution has been kept inform of this events. He has been informed of the unpleasant situations with out acting to protect the workers. I think he is more interested in the reputation perspective from outside. If this news didn't go outside, to the public opinion, to the end-users, they are not important. Is not important if a worker is intimidated, the important thing is that no body else would know that.


I don't think as a good plan for reputation, when someone is attacked, try to silent the victim. This doesn't fix the problem, this would happen again, and it happens many times.


Having the people afraid to be vexed (or fired as a better situation) is not a way to make reputation on an institution. This is the way to have the people busy searching for a job somewhere else.

2011/08/04

Autocollimator device server

Recently I have write a little documentation for a device server to control an autocollimator. I'm specially glad for how this device is running and the integration with the Sardana system.

When the server is launched it tries to go to the live acquisition state. This means start receiving measures and showing them with in some attributes. This way you can have a gui where some attributes can be shown to see the current measures.

For example, you can say "I like to see the measures taken during 10 minutes". Then the device will continue collecting data and when it have this 10 minutes of samples it will cycle, having the same number of samples available from the last read.

But you may be interested in an usage of this laser to integrate data on time and collect it doing some steps. For example, if you have a surface to measure and you are scanning this surface with the laser to see how flat is this surface. For this you need synchronization between the movement and the acquisition.

That's why this device can go to a RUNNING state. In ON state is acquiring this live way.

The command start() will stop the live mode, clean the buffers (all of them intermediate and the one in the instrument), then it timestamps when the 'A' or 'R' is send to the instrument.

Then new data is collected during the time set in specific attributes for this purpose. At the end of the acquisition there will be launched a set of events to acknowledge the interface that this is done.

After this synchronous acquisition, the data will be available in this specific attributes and the live mode will continue (with clean buffers, remember).

Also I have test many error situations (hang intermediate device, unplug the instrument during some of the tasks of the devices, and so on), and it's reliable. Decays to fault state with an error message in the status to guide the user to set it up again.