In the process of working on Kalpana, one of the deliverables was to clean the code, where possible. The following improvements were made as part of this deliverable.
Tag Archives: Rosemary Cyriac
Notes on the Development of Kalpana
This document describes the methodology followed in kalpana.py
for the creation of shape file and kml files. The sequence of steps involved has been grouped under related sub-headings for better comprehension. The terms in fixed width font refer to variable names in the code.
Installing Python Modules for Kalpana
The actual script kalapana.py
does not require installation, it is merely executed. However, it relies on several Python modules that most users (or their IT supporters) will need to install before working with Kalpana. These modules are:
matplotlib
– main python module used for data visualization.pylab
– Imports plotting and numerics libraries in a single name space.shapely
– used to construct geometric objects like Points, Polygons and LineStrings.fiona
– for writing .shp files.netCDF4
– reading and writing netCDF files.datetime
– dates and time calculation, manipulation, and formatting.time
– contains time related functions for measuring the performance of the code itself.numpy
– to facilitate scientific computing; used primarily in Kalpana for working with n-dimensionalnumpy
arrays, which are ideal for storing large amounts of data.collections
– accessing OrderedDict, which is a dictionary subclass that remembers the order in which entries were added, whereas an ordinary dictionary does not do so).simplekml
– writing kml (Google Earth) files.
In the process of installing Python modules on a desktop platform, as well as an HPC platform, I’ve found that the process can be very challenging. The biggest issue is conflicting module version dependencies, which can be handled by the use of virtual execution environments for Python (explained below).