Climate crisis at home (update)

Five and a half weeks after me writing about the dry weather in the UK we finally got some substantial rain (about 25 mm over 8 hours). After the rain I took another picture of the same hole as before:

Deep cracks in the soil in the garden on 25 August 2022. The remaining green grass is less green, trees are getting rid of their leaves due to drought. The hole has slightly filled up with soil falling of the cliffs.
Deep cracks in the soil in the garden on 25 August 2022. The remaining green grass is less green, trees are getting rid of their leaves due to drought. The hole has slightly filled up with soil falling of the cliffs.

The old picture:

Deep cracks in the soil in the garden, less than 10 cm of the 30 cm ruler stick out. At least some grass is still green, and we hope for rain before all died back.
Deep cracks in the soil in the garden on 17 July 2022. Less than 10 cm of the 30 cm ruler stick out of the crack. At least some grass is still green, and we hope for rain before all dies back.

I thought that the cracks got bigger, however, the pictures don’t show a clear widening of the crack. It’s not completely clear due to the different angles of the pictures. But still a good example why we shouldn’t rely on feelings or opinions when making decisions, but on measurable facts.

After the rain I also wanted to see how deep the moisture penetrated the soil, 6 hours after the end of the rain I dug a tiny hole. I was surprised how quickly the spade stopped, due to hitting dry soil:

The 25 mm of rain penetrated about 50 mm of soil, below the soil is still bone dry.
The 25 mm of rain penetrated about 50 mm of soil, below the soil is still bone dry.

It will take a lot more rainy days before the moisture will reach depths of over a meter and even longer to fill up the aquifers. With the measurement from our garden today, I think we would need this amount of rain every day for at least a month to counteract the drought. Forecast predicts no rain for the next 7 days, so I guess the top layer of the soil will be again completely dry by the time the next rain will be here.

Below I copied the text from my original article. And I actually feel I was quite good with my actions. I kept cycling most local journeys and reduced my meat and milk consumption and just bought the train tickets to go to Germany in a month (which is not the easiest travel, but luckily there is help: https://www.seat61.com/Germany.htm#london-to-leipzig-and-dresden-by-train)

In future these droughts are likely to occur more often, the last IPCC report is very clear about this. And there are things we can do. Like planting some trees in the garden (and maybe on fields?). From my experience in Germany and the UK, people don’t like trees in the garden (all this work with the leaves, …) but in our garden there is a clear difference in the number and size of the cracks in the shade of the tree and in the grass area. And huge difference in grass colour. I hope we can convince our landlord, to get the approval for a few more trees.

The reason for the climate crisis now, is however the behaviour of the generations from the 1960 up to mine. An economy was build on cheap oil and gas, without paying the true costs (and now people complain, when they have to pay prices closer to the real costs). All the work that needs to go in moving cities away from the coast, to repair infrastructure after it was hit by a heat wave (or much heavier/frequent storms/floods), all the lives lost in heat waves and other severe weather. We are paying now for the living standard of our grandparents (And poor countries for the wealth of rich countries, the colonialism still continues). And a further problem is the inflexibility for change in these generations (don’t take away my petrol car or the 200 km/h on a German motorway, I want to drive everywhere, why do I need to see wind farms or solar parks in my neighbourhood, one day a week without meat? – How dare you!). Unfortunately, these are the people that make politics and decisions. And they (and me) will be dead when we reach the 4°C average warming by the end of the century (that is the scenario our current goals announced by the politics head to), and future generations will have to deal with that. Parents usually say they love their children, but somehow their actions feel different.

So what can I do:

  • do I need to use a car, or can I spent a few minutes longer on the public transport (less stress) or use an (electric) bicycle (saves the gym visit)?
  • can I eat more plant based products? (lentil burger/bolognese, oat milk, bean based spread instead of salami)
  • do I need to take the plane, or can I spent a bit longer, but use the train? (challenging)

Programming improvements 2

A few things of the many things I learned last weeks in Python.

This is what I used to do to conditionally set settings:

class MyClass:
    def method(self, args**):
        <some code block>
        if some_arg == "condition":
            self.option = "this setting"
            <run some code>
            <call a method>
        else:
            self.option = "another setting"
            <run some other code>
            <call a different method>
        <some more code block>

myclass = MyClass()
myclass.method(args)

And it could be much more complicated.

Using an object oriented approach, can be so much nicer.

class MyBaseClass:
    def method(self, args**):
        <some code block>
        self._submethod(subargs**)
        <some more code block>
    @abstractmethod
    def _submethod():
        pass

The private submethod would then be defined in the child classes. First for “condition”

class MyClass_condiontion(MyBaseClass):
    def _submethod()::
        self.option = "this setting"
        <run some code>
        <call a method>     # can be in this or the parent class

Second for the else:

class MyClass_else_condiontion(MyBaseClass):
    def _submethod()::
        self.option = "another setting"
        <run some other code>
        <call a different method>     # can be in this or the parent class

To call the classes one could use the condition:

if some_arg == "condition":
    myclass = MyClass_condiontion()
else:
    myclass = MyClass_else_condiontion()
myclass.method(args)

With this approach the coding is so much neater. Each method knows what it has to do and there is no fuss about the settings.

While I still feel, it would have been nice, if I’d have learned these little things before (which comes from the thought I would be liked more, and from the expectation of perfectionism by me and because of that I also think others expect perfectionism from me – which is just not achievable), it is nice to pick new things up now. While I thought in my 20s that in many areas of life I can stop learning at some point, in the last years I learned that learning will never end in any part of life, and that is good! Because if I stop being willing to learn, I will go backwards.

Climate crisis at home

Before I moved to the UK, I heard of the rainy, foggy weather here. Typical English weather. But I have to say, that is not at all my experience. During the cycle commutes to and from work I got wet rarely and only at the a similar rate as in Germany. Although, these cycles are slightly biased, as I check the rain radar and have stayed half an hour longer to let rain pass, or left work a bit earlier to get home before the rain clouds arrived.

Deep cracks in the soil in the garden, less than 10 cm of the 30 cm ruler stick out. At least some grass is still green, and we hope for rain before all died back.
Deep cracks in the soil in the garden on 17 July 2022. Less than 10 cm of the 30 cm ruler stick out of the crack. At least some grass is still green, and we hope for rain before all dies back.

Now it has been a very long time since I last was out in the rain. And that’s not because I haven’t been out. While most of June was relatively cool with many days below 20°C, it didn’t rain much. So far July was very dry as well, at higher temperatures. The really hot days, however, are still ahead.

The dry weather is definitely visible now. On my recent cycles I saw so many brown meadows or village greens. And the cracks in the soil in our garden get bigger and bigger. I never have seen such deep cracks in soil with vegetation on it.

In future these droughts are likely to occur more often, the last IPCC report is very clear about this. And there are things we can do. Like planting some trees in the garden (and maybe on fields?). From my experience in Germany and the UK, people don’t like trees in the garden (all this work with the leaves, …) but in our garden there is a clear difference in the number and size of the cracks in the shade of the tree and in the grass area. And huge difference in grass colour. I hope we can convince our landlord, to get the approval for a few more trees.

The reason for the climate crisis now, is however the behaviour of the generations from the 1960 up to mine. An economy was build on cheap oil and gas, without paying the true costs (and now people complain, when they have to pay prices closer to the real costs). All the work that needs to go in moving cities away from the coast, to repair infrastructure after it was hit by a heat wave (or much heavier/frequent storms/floods), all the lives lost in heat waves and other severe weather. We are paying now for the living standard of our grandparents (And poor countries for the wealth of rich countries, the colonialism still continues). And a further problem is the inflexibility for change in these generations (don’t take away my petrol car or the 200 km/h on a German motorway, I want to drive everywhere, why do I need to see wind farms or solar parks in my neighbourhood, one day a week without meat? – How dare you!). Unfortunately, these are the people that make politics and decisions. And they (and me) will be dead when we reach the 4°C average warming by the end of the century (that is the scenario our current goals announced by the politics head to), and future generations will have to deal with that. Parents usually say they love their children, but somehow their actions feel different.

So what can I do:

  • do I need to use a car, or can I spent a few minutes longer on the public transport (less stress) or use an (electric) bicycle (saves the gym visit)?
  • can I eat more plant based products? (lentil burger/bolognese, oat milk, bean based spread instead of salami)
  • do I need to take the plane, or can I spent a bit longer, but use the train? (challenging)

Programming improvements

A few things of the many things I learned last week in Python.

My draft when a new optional dictionary was added to the method:

def method(self, arg1, options={}):

However, a better version was suggested to me:

def method(self, arg1, options=None):
options = (options or {})

And the other big learning through code review was, when constructing a string from a dictionary. My complicated code:

for key1, value1 in options.items():
    if key1 == "searchString":
        for key, value in value1.items():
            result_string = f"someString.{key}.{value}"

The suggested version is so much neater:

for key, value in options.get("searchString", {}).items():
    result_string += f"someString.{key}.{value}"

While I still feel, it would have been nice, if I’d have learned these little things before (which comes from the thought I would be liked more, and from the expectation of perfectionism by me and because of that I also think others expect perfectionism from me – which is just not achievable), it is nice to pick new things up now. While I thought in my 20s that in many areas of life I can stop learning at some point, in the last years I learned that learning will never end in any part of life, and that is good! Because if I stop being willing to learn, I will go backwards.

Moon halo (22° halo)

The moons 22° halo, as seen in a March night. This photo was taken by Ronny Errmann in his garden.
The moons 22° halo, as seen in a March night.

Recently I was made aware about an impressive moon halo, also know as moon dog. I have seen light versions of it before, but not as clear.

It happens when a layer of ice crystals forms high in the atmosphere. Each of the crystals then acts as a prism, refracting the light into a certain way. It’s a similar (and yet not) effect like when a rainbow forms. And actually a moon halo also has a colour gradient, the inner bit is red, the outer bit is blue. However, in my image that is not visible, a longer exposure time would have been good. Next time 🙂

Instead, what I did was recording a time lapse for 30 minutes:

30 Minute time lapse of a moon halo

While some clouds move very quickly, the only apparent change of the halo is caused by earth’s rotation (the moon and halo moving along the image). This also made clear, what are stars and what are optical effects/defects from the lens. Right to the moon are Castor and Pollux of constellation Gemini, and below the moon, next to the tree, is Procyon. All stars fainter than magnitude 2 are invisible due to the scattered moon light (which itself is just reflected sun light).

More information can be found on the Wikipedia article about moon halos: https://en.wikipedia.org/wiki/22%C2%B0_halo

Two and a half years earlier a got a glimpse of a sun halo:

Shitty sun halo (see small area below)
Shitty sun halo (see small area below)
Sun halo, seen from a moving train, which is just not ideal
Sun halo, seen from a moving train, which is just not ideal

Nicer examples of sun halos can be found on Wikipedia: https://en.wikipedia.org/wiki/Halo_(optical_phenomenon)

Create a time lapse from individual images: https://ronnyerrmann.wordpress.com/2022/02/12/commands-to-create-time-lapse-videos-from-individual-frames/

Carbon responsible travel

After the pandemic situation became better again, I started looking into travelling from the UK to Germany. Preferably by train, as flying is just not good in a climate crisis. And I travelled by train before several times a year. With the German DB “Super Sparpreis EU” one could book a ticket from London St Pancras to, lets say Dresden or return. Depending on how busy the trains were, I spent something between 70€ and 120€ per direction, maybe a bit more during Christmas. That was 2018.

When I checked this year to travel a month in advance, no public holidays, Prices ware around £75 for the leg London to Brussels and then another £60 to £80 from Brussels to Dresden. I don’t know if that is expensive, it’s definitely over 50% more expensive than 4 years ago.

And then I made the mistake and checked flights. It was shocking to see that they started at £7 for each way. And that was only 2.5 weeks in advance. Luggage adds another £21, and I would need another 17€ for the local train to my final destination. But that is still cheaper than any of the two parts of the train trip for the whole distance.

I understand that these plane ticket prices are not the real costs, the airline will make the money with the people who by tickets at a later stage (although, even for the flight tomorrow the price is still only £18, so probably they need to subsidise from other flights). And yet, I find it astonishing that the climate damaging travel is still cheaper than the more responsible travel.

Don’t look up (my personal thoughts)

(by Ronny Errmann)

I finally watched the movie “Don’t look up”. First thought I had at the beginning was how nice that the research environment was shown quite realistic. Not in everything (calculations on a white board instead of using computer programs and knowing it will hit earth with just few hours of position data), but hey, it’s a movie. And second thought was, why is everyone reacting so crazy to the threat.

I really could connect with the feelings of the main characters to get the public and politics react to the threat. In that sense it was quite a stressful movie for me, getting too much involved.

In terms of the climate crisis I feel the same situation as shown in the movie is happening in our real lifes and I wonder if scientists from that field feel like that for years or decades. The impact of humans on the climate is know for over 70 years, and we see the rising temperatures clearly for 40 years. And yet, only slow action is being taken and the things decided are not enough for a 1.5 C limit. If we, the world, keep creating the same amount of CO2, that we created in each of the previous years, then in 8 years will have used up all the budget to keep within the global average of 1.5 C temperature increase. If we use produce more, than we will raise the temperature more than 1.5 C, which will create much more severe effects. And I can’t see any chance that the global emissions will decrease, on the contrary, every year we produce more CO2 than the year before.

Links:

https://en.wikipedia.org/wiki/Climate_change
https://theconversation.com/the-1-5-global-warming-limit-is-not-impossible-but-without-political-action-it-soon-will-be-159297
https://www.statista.com/chart/26102/emission-reduction-goal-and-projected-achievements-by-country/
https://theconversation.com/new-research-suggests-1-5c-climate-target-will-be-out-of-reach-without-greener-covid-19-recovery-plans-151527
https://www.bbc.com/news/science-environment-45678338
https://www.nature.com/articles/d41586-021-03036-x

Commands to create (time lapse) videos from individual frames

12 Feb 2022 – Ronny Errmann

Some of the time lapses can be found on youtube: Youtube Channel Ronny Errmann, for example an 8 hour time lapse of the night sky over La Palma. If you modify your images before creating a video, creating a working directory and copying the images into that will safe you from accidentally destroying the originals.

Create a Video from images:

mencoder mf://*.jpg -mf fps=24:type=jpg -noskip -vf scale=1156:868 -of lavf -lavfopts format=mp4 -ovc x264 -sws 9 -x264encopts nocabac:level_idc=30:bframes=0:bitrate=16384:threads=auto:turbo=1:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh -o output.mp4

The following settings should be adapted to your images:

  • fps=24 : if the framerate of the pictures is not high enough a lower number might be better
  • scale=1156:868 : The pictures of my camera are 3 times bigger along each dimension than the values here, be sure to downsize your images without stretching one axis
  • bitrate=16384 : That bitrate gives reasonable results for my time lapses, however, you might consider larger values (better quality) or smaller values (less storage space needed)

Modify images before creating a video from them:

mogrify -resize 1156x868 IMG_20220212*.jpg

Rotate the images:

mogrify -rotate 90 -background black *.jpg

Crop the images:

To remove useless bits from the image, the values are the new size + start positions

mogrify -crop 3515x2541+142+199 *.jpg

Add exif information to the image, e.g. the time:

Sometimes it’s nice to see the real time running in the time lapse, for this the exif information can be used. In the example the modified images will be copied into “prefix_<original name>”

for img in *jpg; do convert "$img" -gravity SouthEast -pointsize 70 -fill white -annotate +30+30  %[exif:DateTimeOriginal] "prefix_""$img"; done

The following options can be changed:

  • gravity : this gives the corner in which the text should appear. Use geography, e.g. Northwest, South
  • pointsize : size of the text, probably worth to test on a subset of images first (copy images into a subfolder)
  • fill : text colour
  • annotate : distance from the chosen corner

Increase the brightness of the images:

For example, when taking night images and the video is too dark.

mogrify -modulate 200 *.jpg

How to code, an additional note

(by Ronny Errmann)

My last post could be read quite negatively, in the way that I didn’t make any progress. So I wanted to add some notes to counteract that feeling. When I looked into new methods actively, because I had a problem, I learned a lot. And I easily remember a few bits from the last years:

  • Replacing loops and conditions with numpy operations on the whole array or part of the array. This made execution so much faster. For example using
array[array > 0] = numpy.average(another_array, axis=1)
  • Making my program compatible to Windows. It’s just a few things to keep Python code compatible to different operating systems.
  • Adding multiprocessing to the program.

All of these helped me to learn new concepts and improve.

How to code, to my younger me

(by Ronny Errmann)

Every time I prepared for interviews or when I started a new role, I learned so many new concepts. Unfortunately, once working in a scientific role, I found it harder to keep this learning up. Making the time to learn about concepts and to talk about code was quite low on my priority list. While reviewing code is something, which I still think is difficult, learning new concepts is something that can easily done. For example, freeing up one hour once or twice a week can make a big difference. Recently I look into C++ methods and just by looking through a few pages of a tutorial (e.g. about classes), I feel I increased my knowledge by a large amount. So there is really no reason to use that as an excuse.

Discussion about code is a bit more difficult. Being the sole programmer in a team doesn’t make things easier, discussion of code means I take time from a different project. Furthermore, in a scientific environment, most people were also self-taught and, like me, only learned the necessary information and were goal driven. But of course, it is important to discuss code and the few experiences, that I have had in the last months, together with the explanation how companies practise these discussions, have changed my view a lot. It is worth the effort, and try to find a group to discuss things can be really beneficial. So similarly to my last post, I would answer to the question, if I would do things differently now with a clear yes.