rock physics templates

Yesterday I started to write a little background story to introduce a post on how I use Python and how fun and creative that is. However, the “little background story” started to grow and became something else entirely, so I decided to cut off the science part and leave it for this post here.

So here we are: this post is just a big fat link to one of my Jupyter notebooks that shows how to code rock physics models from published equations, build a rock physics template and use it in conjunction with real data (plus, how to make it interactive through widgets, but to see that you need to download the notebook on your computer, run it locally and basically you need to know what you’re doing).

[Read More]

geoscience and python

Since I picked up Python a couple of years ago I have enjoyed my everyday job more and more. It’s like being thrown back to my 12-year old self playing with a ZX Spectrum or Commodore-128, when all I wanted was to create videogames or do some other stuff1; only back then I didn’t have the perseverance and the excuses that I have now.

“Excuses” is a fine word for what I do; I am assigned a task (or sometimes I go looking for one), and I see this task only as an excuse to solve the problem in a way that I see fit. So if there’s even a hint of repetition I will go and write a for-loop to do that. If I need to use a dumb-ass software that I don’t like I will write the dumb-ass piece of code myself2. Etc.

[Read More]

get those flickr urls

Warning: this is serious nerdy stuff. Not for the faint of heart. Carry on reading if:

  • you know what Python is
  • you have a blog, but not the easy kind like Tumblr or Blogger, something that allows you to write in HTML (or Markdown), e.g. Pelican or Jekyll
  • you have a Flickr account and want to post links to photos or albums in said blog

What these two scripts do is simply to print out to console a nicely formatted <figure> tag with the static URL of a 1600 px (long side) version of your original photo and a caption with all the common shoot data (aperture, shutter speed, etc, like you used to have in the old times before artists got fancy and began shooting with iPhones; I know I used to record on a little paper notebook these data long before Exif was born). If that’s not available (for older photos I know flickr did not create such versions) the script will fall back to a standard “Large” size (1024 px long side).

[Read More]
Tags: tech python