A little bit of Physics

Before being onto EM business I was quite involved on Heavy Ion Physics (HIP). I have worked at CERN, and you can do the same applying for a job here. Or you can browse some raw videos from the LHCb here.fragmentation I went to CERN fascinated by new states of matter, like the CGC, the Color Glass Condensate, and the Glasma.  Such a fascinating composes you can get from the dense matter in heavy ion collision.  In the picture, a so called parton shower, where new quarks are created by breaking an existing quark pair.

There are a lot of experiments at CERN, like the ATLAS collaboration. Each experiment has several detectors, being the Liquid Argon Calorimeter one of the ATLAS experiment. Extreme matter states are created during a collision (called an event), and the aim of these detectors  is to understand the output of these events.  For that you may need to code on primigenial programming languages like FORTRAN, and if your code is very long it is quite handy to know how to make a FORTRAN library. To help on coding at CERN we had the CERNlibs.  CERNlibs were needed then (are they now? I have no idea!) to run most of the scientific software at CERN, like ROOT. With ROOT it is possible to make and fit histograms from the command line.  Also, you can plot with time axis. Or compile your own GUI like this High Voltage Display Application.

At CERN what we did is to simulate the event, fit the particle tracks to it and withdraw conclussions from the fit. I used Herwig from CDF as a Montecarlo particle generator. There are several version of Herwig available, being the current one dubbed H7. Another famous Toolkit for High Energy Physics Event Generation is ThePEG. Writing your simulation code it is in general a good idea to have at hand some ROOT Classes, like TPythia8, or TPythia6. You can find a TPythia8 example here. Or you may want to go to the FORTRAN pythia 8.2. After running a simulation under certain premises it is important to compare the datasets (here the STAR datasets). You can process your data using distributed network environment like the AliEN grid.

Why am I doing this? I was trying to find if Garfield was still available, so that I can do some EM with it. It look like it is, but from the style of the webpage it’s hard to say. BTW, If everything above is too heavy for you (pun intended) you may want to check the physics forum or the wolfram enciclopedia of physics to have your concepts refreshed. And check other labs and fields. For example, DESY is in charge of a huge laser, so powerful, that it may be able to extract energy from the void itself. Or the NRAO for Astronomy on Charlottesville, Viriginia. Or the Institute of Sound and Vibration Research. Or…


Clean up google history

googlelogo_color_272x92dp is fantastic. But sometimes it gathers much more information than the one you want, specially if you are logged in in some way or another as you are systematically asked to do. There are hundreds of articles about chrome privacy settings, but I don’t want quote any of the main sources here, since they may not be trustable, so to say.

If you were looking for, let’s say, an hotel for your holidays and then you change your mind, google (and friends) may be pushing you similar offers until you do something against it. Actually, it didn’t happen to me first with an hotel but with a dishwasher I happen to have in mind to exchange with mine. I searched for options a lot, and I was literally flushed with ads about it until I cleaned my full search history. So here I give you my two cents, a quick fix for it.

While logged in, open a new tab and type www.google.com (or whatever is your country version). On the right down corner of the white page, you should read settings. No, it’s not a wheel. One click, go to third option (your data in search) and go down a little until you see “eliminate last hour activity”.  You get one pop-up window informing you with what google does with your search information (thanks google for being so transparent!), click on Eliminate and check again, if you want, repeating the procedure from the http://www.google.com page. For extra safety, try on your second computer. I hope your undesired ads are gone for good! If not…ask google how to remove them 😉

Snow, Winter, Ice

I remember the first time I saw ice on the streets. It was, of course, winter. On the radio they told us that it was going to be specially cold that week. 10 degrees lower than usual, they said. Possibility of ice even at sea level. I was like 10 years old, and I had seen the snow already at the mountains…my father drove us there once. We stopped by the wayside when we started to see white bits around. The amount of snow was not enough to build an iceman, so we run around to scratch more material. Even so, we didn’t manage to lump together something bigger than a gnome before our father called us back. On the radio, they were saying a snowstorm was coming, so time to come back. We looked at the result with proud: our first snow gnome, before waving goodbye to it.

What I saw on the streets that day of December, when heading to school, was not at all similar to that snow on the mountain. It was looking more like a dirty mirror there, on the floor, as placed clumsily to cover the hole on the ground. I tentatively stepped over it, and it cracked easily. Below, the same dirty water that I used to splatch after the rain, was waiting me. I didn’t bow down to reach the ice shards, since for me they looked more like coal shards. Yes, I believe our city air and streets were not precisely clean at that moment. Even so, I remember it with love.

A meeting after the flood

– Yes, I tell you the city is different but the spirit remains. There are the channels now, that’s true, but the tourist pest is gone, together with the government, by the way. And you have great pubs now: they grow like mushrooms. I remember something like that from before the flood. It’s like we have rave parties everywhere. I know you knew the city pretty well, but do you let me guide you to the new hotspots?

– Of course, Mara.

– Then let’s go to the Grand Cafe. Or what is remaining of it.

The Grand Cafe was close to the Constitution Square, a huge esplanade of the size of a small football field surrounded by gorgeous colonial buildings. Now the buildings were abandoned, and vegetation was growing out of some of them, but the streetlights, gothic-style, were still there. I’m surprised to see that half of the facade of the Grand Cafe is gone, and something similar to a big white screen is standing on its place.  After paying attention, I realize that there are also speakers hanging from the trees, as a sort of sound system.

– You’re lucky, the show didn’t start yet. Welcome to the Grand Cinema.

We grab each one a liter of beer in a mug (is it an Oktoberfest mug? what the hell is it doing here?) at the entrance and we enter in what is remaining of the Grand Cafe building. Inside, people seem to be hanging around instead of on tables, over the rubbles. Mara seems to recognize somebody on the back of what was the Cafe Hall (I remember dancing tango here) and she grabs me in that direction. Her people greet us with wet kisses, some more passionate than they should with strangers. But I suppose I’m no stranger.

– Girl, this is him. I told you he has changed a little. But didn’t we all?

Mara takes the ashlar stone broken column, I sit close to her over one of the cylindrical sections. We speak about the new life, the life after the flood. The new deals. I tell them not everything is working so well where I come from. The girl close to me starts grabbing my butt in a discrete way, but I have eyes only for Mara. She has definitely improved with the years, but she keeps her mod style. There you have the striped, black and white shirt and the loose pirate trousers over very weared off leather military boots. Her friends, on the other hand, despite being dressed up in a similar way, don’t look so stylish. I don’t match so much, but we cheer, we speak, we drink, the girl by my side continues her advance, an I’m happy here.

AI boss

There it is. Standing over the podium, like if this meeting was not about him. I look around. The other six are as unsettled as I am. He looks normal. I mean, his avatar has no difference with ours, except by, maybe, his sharpness. It’s not that people don’t disguise their appearances when on a work VR meeting. I do it from time to time: I change my hairstyle, or my eye color, or my breast size, just to play with the people, to see if they notice. This man, our new boss, is a native. He has no appearance, he’s just an entity. A f*cking AI.

– You know I was coming. – He does not even act as one. My first impression is of an craftsman, or a sailor. Maybe an old explorer. He looks like 60, although I know that’s impossible for an AI. I guess it matches his personality or something like that. I guess a young avatar could have not been taken seriously. – I was announced, I insisted on that. – Yes we know. It’s the first boss I have that insisted on meeting his team, even on VR.

– I have a clear purpose for this meeting. You know AIs. You probably have one or two of my dummy cousins at home! – muffled laughs now – But I’m no home microwave, or fridge, power unit or EU. I’m a person, as you are. Therefore I need human interaction. – Funny he really said that. – I need you to see me like one of us, like your neighbour next door, like another client.

– But you are not. – Martin, responsible of integration. I did not personally meet him, so I don’t know if he looks like his avatar. But his avatar looks aggressive: bold and filled with tattoos, when he looks around looking for support, his eyes that I meet are definitely having an extra layer of intimidation. – You are a program! Hell, you could be one of our programs, as far as I know.

– And what if I am, Martin? Do you see something wrong there? Are you producing defective material, or is it that you think a human mind must be the one directing your projects? – Silence. The others try to look around, but there’s nothing else to look at. The room is as neutral as you can get: a white box with one oval table, chairs, and the podium for the speaker. Behind him, the screen space, that at this moment displays only the logo of the company. If we were on the 20’s, we would be looking all at the mobiles at this point, avoiding the scene. –  Think of me like your son. Can’t your son be indeed better than you, since he or she possesses not only your experience, but also that of the other progenitor? Apply that sum to ten progenitors and there you have me!

– Do you know your parents, then? – Karmen, from PR. She is our face outside. I mean the real face: she physically travels around to meet our customers. Her avatar is gorgeous, but not so much: elegant but not in excess. If I increase my breasts from time to time, I’m sure she may reduce them. Or not, I don’t know. Now she smiles at us. I like Karmen, she’s one of the reasons I like what we do. I saw what she tells of us to the customers, and I’d like to think she really thinks that of us.

– You can say I know what part of me is your contribution. – Now he smiles, and I think he has Karmen’s smile. – But let’s focus. I just want to assure you that this is not a part of the master plan of we AIs to takeover the world. – Again some muffled laughs – We already control it. This is a fair trade, it’s always been, and I won this position against other, let’s say, more “human” candidates. – This time the rumor is not of laughs. – I’m as qualified for the job as any of you. But I’m not perfect, and I don’t want to hide you that I have my own problems. And I want you to understand that.

– Problems, such as? – Alban, an architect. I once managed to sleep with him. Unfortunately, it didn’t work. Not because of the sex, the sex was great, simply, there was no chemistry amongst us.

– It’s very simple, Alban. First, I have no body. And I will never have. Second, I never sleep, I never rest, I never stop. Therefore, I may not understand your need for it. – Silence. For like a minute, nobody moves, nobody speaks. We are a screenshot of our team, not living beings. Then the spell is broken. – Now that you know me, and if you don’t have further questions, shall we discuss our priorities?

A python script to take screenshots on Windows

We want to know what one of our Windows servers is doing without using remote desktop. The idea is to have a snippet running on the background that takes a screenshot each certain (fixed) time and saves it on a specified folder. That folder can be accessed from the network, so we will have “a movie” of what’s going on on the Windows server screen(s). This is the script.

# thread to take screenshots each 5 seconds
import threading
import time, datetime
   import pyautogui 
except ImportError:
   raise ImportError('IMPORT ERROR : try pip install pyautogui')
# ask the user to give the path to the network folder
dir_name = raw_input("  Directory? (for example: C:\\test) :")
# function that does the magic
def shotit():
   threading.Timer(5.0, shotit).start()     
   # Take screenshot
   pic = pyautogui.screenshot()
   # Save the image
   logfile = 
   pic.save(dir_name + logfile) 
   print " pic saved"
### main loop

We run the function “shotit” after giving the path to the network drive. The time interval is hard coded on the threading.Timer function (5.0 seconds). Where’s the catch? It works, but it’s not a multi-platform snippet and it doesn’t check anything on the machine it runs except that the python package needed is present. But nobody’s perfect! I will leave the additional improvements to the reader 🙂

Scipion 1.2 cannot find -lmpi_cxx on CentOS 7

I did install previously a Scipion 1.1 module on CentOS 7 that was linking scipion all the existing programs, including xmipp. Now I want to install the newest version with the default programs, instead of linking it to the existing ones. I followed the How to Install Scipion from sources, with our particularities. One, we use a network folder. Two, we use modules. I will, anyhow, minimize the last point, and I will load only mpi-3.0.0.

So we get the git (I like how it sounds, yeah!) and provided we have the dependencies installed and we have configured the scipion.conf file we are ready to compile it. We want to use the defaults, that is:

./scipion install -j 5

or something similar. Unfortunately, after quite some (compilation) time the install fails with this error:

mpi-3.0.0/lib -lXmippAlglib -lXmippBilib \
-lXmippCondor -lXmippDelaunay -lXmippData \
-lXmippRecons -lXmippClassif -lsqlite3 \
-lfftw3 -lfftw3_threads -ltiff -ljpeg -lpng \
-lhdf5 -lhdf5_cpp -lmpi -lmpi_cxx -lXmippParallel 
/usr/bin/ld: cannot find -lmpi_cxx
collect2: error: ld returned 1 exit status
scons: *** [software/em/xmipp/bin/
xmipp_mpi_angular_continuous_assign] Error 1
scons: building terminated because of errors.

What now? Google doesn’t have an answer to the lmpi_cxx problem, but don’t cry yet. What if we comment out the request for that library?

root # > grep 'mpi_cxx' software/em/xmipp/*
...some more stuff here...
grep: software/em/xmipp/resources: Is a directory
kwargs['libs'] += ['mpi', 'mpi_cxx', 'XmippParallel']

Let’s edit the file scipion_sconscript with the request and try again.  On the line 464, instead of

kwargs['libs'] += ['mpi', 'mpi_cxx', 'XmippParallel']

we write

kwargs['libs'] += ['mpi', 'XmippParallel']

We save the file, and run

./scipion install -j 5

again. This time, everything goes fine 🙂

How about the post-installation tests? In my case, everything went fine…provided you run as root. Or some tests will fail due to a weird Permission Denied error.

>>>> python scripts/sync_data.py –download xmipp_tutorial
Selected datasets: xmipp_tutorial
Dataset xmipp_tutorial not in local machine. Downloading…
Traceback (most recent call last):
File “scripts/sync_data.py”, line 440, in <module>
File “scripts/sync_data.py”, line 128, in main
download(dataset, url=args.url, verbose=args.verbose)
File “scripts/sync_data.py”, line 257, in download
File “/usr/local/scipion/software/lib/python2.7/os.py”, line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: ‘/usr/local/scipion/data/tests/xmipp_tutorial’

Yes, what can I say? Be root, my friend. I’m not going to write down the scipion-1.2 module, I hope you’re fine with that already. Or if not, just copy the one of scipion-1.1, remove the python module call and change the path so that it points out to the new install 🙂