This page demonstrates Python tips and tricks that I use in my everyday programming as an atmospheric science graduate student.
-Brian Blaylock

Friday, January 13, 2017

Thursday, January 5, 2017

Simple Basemap Example

You can do a lot with Python basemaps. Here is an example of a few things you can do...

Friday, November 11, 2016

Verifying GFS dewpoint data with MesoWest observations

For a class assignment, I needed to verify GFS model output with MesoWest data. I used pygrib to read in the grib file, then used some custom functions that grab data from the MesoWest API.

Here is the output figures and my code.


The output:







gist:

Friday, October 21, 2016

Adding fields to a structured numpy array created from genfromtxt

Is it possible to add a new field in a numpy.genfromtxt output? Yes it is. I asked this question on stackoverflow and got an answer that works...
http://stackoverflow.com/questions/40182466/is-it-possible-to-add-a-new-field-in-a-numpy-genfromtxt-output/40183748#40183748

The trick is using the numpy.lib.recfunctions library. Use the append_fields function to add a new field to a data structure.