Skip to content

Instantly share code, notes, and snippets.

Avatar

ICT4EO Research Group ict4eo

View GitHub Profile
@ict4eo
ict4eo / python_resources.md
Created Mar 19, 2014 — forked from jookyboi/python_resources.md
Python-related modules and guides.
View python_resources.md

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@ict4eo
ict4eo / 0_reuse_code.js
Created Mar 19, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ict4eo
ict4eo / wiki_google2rst.py
Last active Aug 29, 2015
Convert a document in Google Code wiki page format to reStructuredText (reST)
View wiki_google2rst.py
"""
Convert a wikipage in Google wiki format to reStructuredText
Version 1.0.2
19 March 2014
Derek Hohls, Meraka, CSIR
Handles
=======
* internal comments (#name - no space)
* bold / italics text
@ict4eo
ict4eo / Dockerfile
Created Feb 28, 2014
Dockerfile for SVN
View Dockerfile
FROM ubuntu
MAINTAINER Derek Hohls <dhohls@csir.co.za>
# make sure the package repository is up to date
RUN apt-get update
# general
RUN apt-get install -y gcc patch wget curl nano
# Install Subversion 1.8 and Apache
@ict4eo
ict4eo / sos_to_wfs.py
Created Jan 17, 2014
Create a view for a 52N SOS, so that it can be accessed as a WFS from, for example, QGIS or GeoServer
View sos_to_wfs.py
"""
Create a view for a 52N SOS, so that it can be accessed as a WFS from,
for example, QGIS or GeoServer
Version: 0.1
Author: Derek Hohls, Meraka, CSIR
"""
import psycopg2 as psy
@ict4eo
ict4eo / serviceProvider.xml
Created Jan 14, 2014
Service Provider XML configuration for 52N SOS at Meraka
View serviceProvider.xml
<?xml version="1.0" encoding="UTF-8"?>
<ows:ServiceProvider xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
<ows:ProviderName>Meraka</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.meraka.org" />
<ows:ServiceContact>
<ows:IndividualName>TBA</ows:IndividualName>
<ows:PositionName>TBA</ows:PositionName>
<ows:ContactInfo>
<ows:Phone>
<ows:Voice>+27 12 8412911</ows:Voice>
@ict4eo
ict4eo / Dockerfile
Last active Aug 31, 2016
Dockerfile: geoserver+geonode+postgresql+52NSOS
View Dockerfile
# GeoNode / GeoServer install for Docker
# Save file as Dockerbuild; run sudo
# VERSION 0.0.1
# TEST = 'foo'
FROM ubuntu
MAINTAINER Derek Hohls <dhohls@csir.co.za>
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
@ict4eo
ict4eo / profile.xml
Last active Jan 3, 2016
profile.xml for 52N SOS
View profile.xml
<profile>
<id>52n-start</id>
<repositories>
<repository>
<id>n52-releases</id>
<name>52n Releases</name>
<url>http://52north.org/maven/repo/releases</url>
<releases>
<enabled>true</enabled>
</releases>
@ict4eo
ict4eo / docker_geonode
Created Jan 8, 2014
Docker install script for GeoServer/GeoNode
View docker_geonode
# GeoNode / GeoServer install for Docker
# Save file as Dockerbuild; sudo docker build -t ubuntu/testgeo3 .
# VERSION 1.0.0
FROM ubuntu
MAINTAINER Derek Hohls <dhohls@csir.co.za>
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
@ict4eo
ict4eo / nc-quick_view
Last active Dec 31, 2015
Quick view of netCDF file (param/lat/lon type)
View nc-quick_view
import gdal
import netCDF4
import sys
import matplotlib.pyplot as plt
def plot(file_path, title=""):
gdal_data = gdal.Open(file_path)
arr = gdal_data.ReadAsArray()
#print "shapes", arr.shape, arr.dtype