Robin's Blog

van Heuklon ozone model now available on PyPI and conda

I was going to post this as one of my ‘previously unpublicised code’ posts, but that would be stretching the title a bit, as I have previously blogged about my implementation of the van Heuklon (1979) ozone model.

Ozone

This is just a brief update (in the spirit of my ‘previously unpublicised code’ posts) to say that I have now packaged up my implementation as a proper python package, added a bit more documentation, and a license and all of the other things that a proper library should have. I can’t say it’s the most exciting library ever – it has one function in it – but it could be useful for someone.

So, next time you need to calculate ozone concentrations (and, be honest, you know the time will come when you need to do that), just run:

pip install vanHOzone

or

conda install -c https://conda.anaconda.org/robintw vanhozone

and then you can simply run something like this to get all of the ozone concentration estimates you could ever need:

from vanHOzone import get_ozone_conc
get_ozone_conc(50.3, -1.34, '2015-03-14 13:00')

The full documentation is in the docstring:

get_ozone_conc(lat, lon, timestamp)

Returns the ozone contents in matm-cm for the given latitude/longitude and timestamp (provided as either a datetime object or a string in any sensible format - I strongly recommend using an ISO 8601 format of yyyy-mm-dd) according to van Heuklon's Ozone model.

The model is described in Van Heuklon, T. K. (1979). Estimating atmospheric ozone for solar radiation models. Solar Energy, 22(1), 63-68.

This function uses numpy functions, so you can pass arrays and it will return an array of results. The timestamp argument can be either an array/list or a single value. If it is a single value then this will be used for all lat/lon values given.

(as an aside, this is my first time of releasing a conda package, and I think it worked ok!)


Categorised as: Academic, My Software, Previously Unpublicised Code, Programming, Python, Remote Sensing


One Comment

  1. […] only real change that I did this year was to make a conda package for it – see my previous post for […]

Leave a Reply

Your email address will not be published.