2012/11/15

Alba synchrotron accident

The afternoon of November 13th, the Alba synchrotron has had an accident. As it has been officially mention by an email to all the staff, during the machine start up after a week shutdown, and accident have vent the vacuum in the storage ring.

Having a 3GeV beam with a current of around 100mA some beam studies were on going. It looks that the vertical orbit have suddenly change (+-5mm). The machine protection was off because it was necessary for the works on going and the orbit interlock protection hasn't being triggered to kill the beam. This protection has been design to avoid the beam hits the cavity when the beam goes out of a safe region.



The first indicator of the issue can be saw in the machine status because usually the operation pressure is rounding the 1e-9 mbar (in the Ultra-High Vacuum range) and in the picture taken the evening of that day this pressure is at 6e-2 mbar, where this is medium vacuum.

Even that this pressure value is not in one position, is an average. There where out-gassed sectors and sectors where the pressure has been contained:



In the bottom plot is possible to see where this accident have vent the cavity and where the pressure is very far than UHV. Notice that the scale is logarithmic in this plot, and we have already start work to fix that. When the accident has happen, some sectors have raised up to atmospheric pressure...

Now the machine status informs a little bit about this and is not giving a pressure value:




Update: Current user run cancelled. Due to the vacuum accident, the current 3 week run with beam for users has been cancelled. We hope to get it back up and running as soon as possible.

Update 20121116: We are recovering the vacuum. Yesterday we where at 0.39mbar on average in the storage ring, and today we are at 0.074mbar (on average).

Update 20121117: Yesterday we've been informed that the breakdown was less than can be thought, if it's possible to say like that. As far as I understood, the electron beam haven't hit the vacuum chamber; the damage has come from synchrotron photons have hit flanges downstream some bending magnets, the feebleest element on the path.

The vacuum technicians are working this weekend to speed up as much as possible the recovery of the machine operation. And today, on average we are at 0.0024mbar having only 4 places with pressures in the medium vacuum range (the others are already in UHV).

Update 20121119: Back from the weekend It look like the people that work this free days did an incredible work:
Sector 12 have 2 reading of 2.7e-3mbar, but as is show in the plot, the others are below the 1e-8mbar. Sector 7 looks to be in an incredible good 1e-12mbar...

Update 20121119, afternoon: the machine status gui recovers the pressure value
The Vacuum Controls gui (vacca) is also showing much better look:


2012/10/01

The German miracle

Taking the Spanish media and the international information that arrives to this country, Germany is where they pave our streets with gold. The PIIGS have their economies compared with Germany with the risk premium.

The gods of the markets decides above everything in a politics system that would be named marketcracy. And if the markets decides that a virgin worker must be sacrificed, the politicians, like a high priest does what ever is necessary to obey the god will.

But mass media are also priest on this system. They make up the reality to adapt the collective think to the global order. Lying to the plebs about how the things happens in other places. But some times they made a mistake throwing something that allows to understand.

In Germany, you have an special tax if you belong to a religion. Each church receives depending on the people that follows this religion. Then belong or not to a religion is translated to money for the ecclesiastic hierarchy.

Today, in the news, I have seen that in Germany the Catholic Christian church is denying religious services to the people that decide to save money by refusing to be Catholic. That means you save 8% tax, by refusing to mention your faith to the government. I think before, you must be practitioner to pay that, because if you don't follow the church activities was use less to pay. Then I think the people that is taking this decision are real believers with real money problems.

The plebs in the PIIGS have received the message that in the north, where the things are made in the good way, they work and they like fine. But the reality is different. In this wrong capitalism, where wins are private and loses are publicly shared, all the plebs are suffering to maintain the rich. It's still the save think than always, it's a class conflict. We didn't finish it, it's only one season more.

2012/08/16

DevEncoded and Basler Ace in Taurus

Sometime a go, I have received the request to control a new model of cameras The Basler Ace acA1300-30g{m,c}. Yes both types: monochrome and colour. The most common cameras to look at the beam are the Basler Scout scA1000-30gm and the scA1300-32gm (yes until now we have only supported monochrome cameras in the service of beam diagnostics by imaging.

To take the pictures of this Basler Scout we have used and contribute using the Soleil's device ImgGrabber, and to analyse those taken pictures we have used the ImgBeamAnalyzer (also originally from Solei).

How we look at the images? Long time a go we have start working with Qt and as a result we have used Qub widget from esrf. This widget has been integrated in tau that has been renamed to taurus.

As an example, I have saved hundreds of snapshots of the gui with beam. The latest publish here was to celebrate the first x-ray beam at alba, but I can share much more of those pictures:




But the software we used doesn't support the Ace cameras. There is a newer software that makes deprecated this software and many of the synchrotrons that are using tango are migrating to LImA (Library for Image Acquisition). This is a very powerful software specially focussed in detectors.

This ccds that I'm talking here are not usually "detectors" in a synchrotron sense. They are not the end of the beamline from where the data of the experiment is collected. The most often activity of this cameras is beam diagnostics previous to the experiment to make sure that everything is on the expected place and the shape of the beam have the desired characteristics. Then they are used very often as a live video image in the graphical user interface (gui) from which I have placed images before.

Another situation is during beam commissioning when this cameras are used much more like a detector during a scan using Sardana. On this situation is not that important the image availability during the measurement, the most important this is the beam study of each picture and the statistical characteristics from the beam.

Then we have two very different user cases. In the upgrade to LImA both must be implemented, and yes they already are.

In the LImA Basler device the Ace cameras are already supported and there are some attributes that allows the possibility to have a gui like we have. But what was the problem? This attribute are from the "new" tango data type DevEncoded. Our system didn't support yet this data type and this has been an august development (almost the best month to work, almost every one on holidays and no one is bothering your development).

What make this data type special? This data type can contain almost anything: basically is a list of an string together with a list of bytes, where the string says what and how the things are codified in the list of bytes.

In the case of the LImA's "video_last_image" attribute, the DevEncoded is given as a "VIDEO_IMAGE" format. An issue of this flexibility is the naming, we are starting putting names without a rule and in the future this will be very difficult to unify and harmonise. 

LImA is hosted in a git repository and in the file "applications/tango/LimaCCDs.py" there is a method 'read_video_last_image()' where this "VIDEO_IMAGE" is codified.

Recently this DevEncoded format has been integrated in taurus.

And as we want to see the images using guiqwt who is integrated in taurus using an extension of this software, we have integrated this DevEncoded as a interpretable data from taurus.

The result: we've been able to take and show images from a monochrome Basler ace camera:


Using a fake beam (a image of the beam printed in a paper and placed in front of a ccd) we can check how it behaves with different beam types:


Very glad and satisfied when you see this images. It doesn't look special, but knowing the effort behind that the view is different.

2012/08/13

The Andalusian labourers and the significant differences of sensitivity before the robbery

Following a similar idea than one of my previous posts I have read something on this matter:
"The Andalusian labourers and the significant differences of sensitivity before the robbery"

I like to share here and translate it:
No one like that some one else robs what is ours. The think is like this from immemorial time that the human beings we have occurred to rules and institutions to avoid it and to punish to that do it.
I understand, therefore, the anger of the owners of the supermarkets where a group of Andalusian laborers has removed food. Although the objective is noble, I have already said that to anybody it likes that someone else robbs what is own and I understand him, then, that they have reported to the authorities.
I even understand that these have been mobilized immediately and leaders of some parties have requested quickly that are punished to the guilty. Is what the spokesman of the Popular Party has done in the Congress, Rafael Hernando, who affirmed that he hopes that the deputy of United Left, Juan Manuel Sanchez Gordillo, is denounced by robbery because, according to there is saying, “the laws are had to fulfill and must have exemplary conducts. This form of protests seems to me lamentable and I hope that Justice intervenes in the affair”. 
I already say that it seems normal to me. But what, nevertheless, it does not seem so normal to me it is that these authorities and the politicians who have been scandalized so much by the theft of the laborers are so little sensible to other much more great robberies that happen to newspaper in our country. That is to say, that they have got upset as much by a theft of small account and they do not persecute the great robberies and swindles.
Let us see: 
Let us suppose that the labourers filled each one of the shopping cart with food by value of 300 euros each one (what he would mean, by the way, that the stolen total amount is very small for Carrefour and Mercadona, because between both company they obtained 845 million euros of benefits in 2011, and if we suppose that they gathered 25 cars of food is that with that benefit they would be possible to be filled to 2.8 million cars with food by value of 300 euros each one).
Now let us compare this theft with other three robberies of which they have taken place or they take place day to day in Spain: 
a) Robbery of the electrical companies.
The engineer Antonio Moreno has demonstrated that “every day that happens without the Government approves the official rule that he defines in what consists “the suitable renovation and update of the park of accountants”, the electrical companies receive the following amounts illegally (including the VAT):
- More than 600,000 euros by a service (“the suitable renovation and update of the park of accountants”) that do not given because the Government not yet has defined of what this service consists.
- Between 196,000 and 342,000 euros by the positive error that has 80% of the accountants because they have not been verified periodically because the Government not yet has published the corresponding norm”.
That is to say, that the company electrical (single to receive a service of renovation and update of accountants that does not render) robs every day to the Spaniards equivalent to 2,000 shopping cart with food by value of 300 euros each one, which represents about 730,000 shopping cart after the year.
As it can be seen in the Web of Brown Antonio (http://www.estafaluz.com) if the other concepts of the continuous swindle of these companies are added, it would be that the very many ones are robbing us equivalent to more shopping cart.
b) Robbery of the preferred participations.
As it is known, a good number of banks deceived thousands of Spanish savers placing “preferred participation to them” as if those products were deposits, without informing to them of which in fact those things are something like actions without right to vote and whose single cash could be recovered in very leonine clauses (a news tv report of Tele5 on this subject here).
As a result of that fraud of the banks around a million people there are lost the immense majority of its savings, calculating that those losses, a true robbery, can have a value of between 10,000 and 30,000 million euros.
If we accepted the lowest estimation (10,000 million), it is that the banks have robbed to a million Spanish citizens, and only by the concept of preferred participations, the equivalent to 33 million shopping carts loaded with food by value of 300 euros each one.
c) Fiscal fraud.
According to the technicians of the Ministry of Finance the 72% of the fiscal fraud (that is of about 89,000 million euro altogether), is made by the biggest fortunes and the greatest enterprises corporations, which means that these didn't pay to Finance's Ministry about 64,000 million euros to the year.
If we accepted that to evade the payment of taxes to which we are compelled it is a robbery to the society, it is that the great fortunes and corporations rob to all the Spaniards the equivalent one to 213 million shopping carts loaded with food by value of 300 euros each one.
To these robberies we could add others to great scale, like that the deceived families who contracted with banks credits with fraudulent clauses ground (information here and here), those that practice the pharmaceutical companies (information here), or and endless suffered daily of bad practices of the banks that cost thousands of million to all the Spanish citizens (adicae). Neither mention the global robbery of astronomical amounts of money that the financial crisis has supposed, the banking rescues, etc.
In conclusion: it could seem reasonable to me that it is wanted to persecute and to condemn the labourers who have stolen a few shopping carts of food by value of about 7,500 euros and not on its own benefit. But what I ask myself it is another thing:  how is possible that such judges, public prosecutors, police, authorities… that they are persecuting and that will finish jailing to the labourers responsible by the theft for a few shopping carts of food do not persecute with similar fervor to those who amounts are robbing us that are several million greater times?
I do not know that the readers think but, at sight of this so contradictory behavior and the poor effective persecution who have those multimillionaire robberies, with what I think they criminalize the labourers not because the robbery itself but by another thing worries to them: because to whistle-blower to show the worse and more revolting shame of our opulent world is seen: the hunger. A suffering, do not forget, that the result of the lack of resources is not an accident nor but, as said the previous Relator of the Nations United for the Problems of the Feeding, Jean Ziegler, “a organized crime  against the Humanity”. And he is for that reason, I create, who the criminals who commit it or who help to commit do not want it that he is spoken of it.
So do not be hypocritical: If the authorities that demands the respect to the order and the property were coherent and ended the true thieves who are robbing to the immense majority of the society there would not be more labourers taking eaten of the supermarkets. 

2012/08/10

When there are two laws

Now a days, specially during this crisis, it becomes much more evident that even before the double standard of the law. There is two ways of justice in Spain, and certainly every where else in this world but often they have more precautions, where today is too much evident.

It's not the same punishment for things that are morally equivalently wrong, and the worst is when the punishment depends on your social class. As rich as you are: more impunity you have.


This country is plenty of examples of this. Should be Felix Millet in jail due to a misappropriation of public founds? There are people in jail to have robbed much less, but he is not prisoner. The Catalan health system is also soiled by scandals. And the corruption of this both cases splash too many politician, when at the same time the mass media hides this informations. And even all this things the citizens have to pay an extra € per each medicine prescribed by your doctor of the public health care system. I know people who can not take the medicines because they are too expensive and to buy it they have to eat less.

Scandals of corruption jumps to the news very often in spite of the effort to cover and hide it. Where is the solidarity and equitable redistribution. Every where is the same shit.

And law doesn't act, is absolutely blind in this cases. But in the protests from the citizens in the country, we are criminalized. Even if it is a pacific protest in the street, the can accuse the citizens of resistance to the authority to make possible to punish it with jail in a similar form than if your protest is violent.

By criminalize the actions of the working class, that includes unemployed and retired, when fights for the rights and duties of this society, the problem is not solved at all: it makes it more complicated.

All of us have rights and duties, and I insist all of us. Politicians have also duties and not only their rights. Their actions won't be free of consequences. Often is said that the workers forgets our duties, but don't generalize because is not general. And why the consequences only falls down to the plebs? Many politicians and rich forgets their duty to obey the law.

But what they are doing is to change the law in order to have their own full permission to do what they like. That is not the way. Well is a way, but is not the way to live together peacefully.

2012/08/08

Refactoring

The software has its live cycle during which the development and bug fixing are link to several variables, some under control or the developer but many are out of this control. I'm not talking much about the time dedicated to the development during a project, but too. Those variables are out of control specially in the bug fixing time, when the speed and extreme programming are more present.

When some day, some how, some one decides that something is urgent, or more urgent than the other urgent things. At that time, the development will done because of an heroic effort and all bugs will be fixed fast (hopping that the bug fix will not produce any other side effect).

How old must be a code to consider refactoring? It could depend on the number of requirements coming from the heaven. I mean when the number of times that some one is very urgent to codify, the developer does it, but with a price. And this price is a quality loss, until it becomes untenable. When any bug fix requires longer and longer time due to the side effects of the modification.

But there is a moment, that triggers an alert for the project manager that says refactoring is mandatory: when the design have almost nothing in common with the code: when code smell.

Then I found a book that looks nice for this task: "Refactoring: Improving the Design of Existing Code" Fowler, Martin (1999). More than ten years old book, older than the code I want to refactor, live irony.

2012/08/06

Generalized Rijndael, schematics

Before to enter in deep on the questions remarked in the previous post about this series, I like to post some schemas that some day would be useful.

The Rijndael symmetric cryptosystem build by iteration using a network of permutations who follows the basic shannon's properties of "confusion and diffusion". The bits in the plain text are mixes and substituted by a group of operations do by an order. To decrypt, what have to be done is to do the same things but in the opposite way. For sure, there is a key to introduce here the secret to be able to undo the encrypt operation.
Diagram 1: Flow of the Rindael encrypt/decrypt

As in the diagram 1 shows, using only 4 operations (subBytes, shitfRows, mixcolumns, addRoundKey, and its inverses). But those operations are in a certain order to maintain a set of properties.

  • subBytes: word substitution, where each element in the state matrix is replaced by its inverse and an affine mapping. Operations in
  • shiftRows: cyclic left shift of the elements of the i'th row by i words.
  • mixColumns: column linear transformation of the state matrix, where each column is given as an element of a polynomial ring, where the coefficients of this polynomial are polynomials in .
    This polynomial ring is: 
  • addRoundKey: XORed transformation between the state matrix and the round key.

Is necessary to emphasize the use of a part of the key in the 'addRoundKey()' operation. This round key is much longer than the given key to encrypt/decrypt, and the process to generate this key expansion can be described in a iterative way:


Diagram 2: Iterator schema of the Rijndael key expansion
The first 4x4 matrix (the ) is the original key given with in a structure of a matrix of elements in the wordsize (8 bits, a byte in rijndael, AES). This example is using the 128 key option but the key matrix can have more columns: To build the key expansion its the same way, but remark that "#c" represents the number of columns for the message, not the key.

To build the following columns to have each round keys, an iterator is good to see how this is made. I have tried to get an schema from other webs sites, but the ones that I found haven't convinced to me. I hope this would help to someone who search on internet for a diagram of the rijndael key expansion.