It has been a few weeks since we have posted our first geophysical challenge. We thought to create a tutorial post for the challenge to help you along! First things first, you will need to download the data for this challenge. Save this data to the same folder you will be saving your python challenge 1 script to. Now open Spyder. We have provided a step-by-step tutorial with information about each step, to help you along.
Following a question asked after our Geolunch session, "What is numpy?" We thought it would be useful to provide a brief overview of python's modules, packages, and libraries: what they are and how they are useful.
Since ArchaeoPy focuses on scientific applications, we often want to reuse the same functions and variables. Luckily for us, python has a great selection of modules and packages that we can use to simplify our projects; instead of having to define our own functions and variables with each project.
A module is a file that contains definitions of functions, variables, and classes that can be imported and run in other modules. A package is a directory of modules. A library is a collection of packages and modules.
Python already has a great standard library with built-in functions, constants, and types that we will regularly use. However, we will often want and need to go beyond the standard library tools, and to that end, there is a range of other powerful numeric and scientific libraries and modules that we can utilise. Below lists just few of which we frequently utilise for our scientific applications (hopefully familiar from the code in our Geolunch presentation and in our ArchaeoPy repository):
NumPy: Numpy is one of our fundamental packages because it handles and processes arrays, which are what we use to structure our geophysical data.
matplotlib: matplotlib is a plotting library. In our examples, we have used matplotlib to produce greyscales.
PyQt: We have used PyQt to create our graphical user interfaces (GUI).
Following on from yesterday's Geolunch, here's the first Applied Geophysical ArchaeoPy challenge:
Load XYZ .CSV file and plot the data within python
You can do this in any way you want but some hints and tips are given below:
- Download the data from http://www.archaeopy.org/wp-content/uploads/2014/04/xyz.csv
- Numpy.loadtxt to load in a CSV file
- Matplotlib.mlab.griddata to grid the XYZ data
- Matplotlib.pyplot to plot the data
- If you get stuck, google is your friend!
Hello! This guide will help you to get started with ArchaeoPY. This will cover installations you will need, how to utilise our repository, and how to get going running code. Stay tuned for Python Basics and Coding Basics guides! We are just in the process of putting them into a more GitHub/external-user-friendly form from our ipython notebook server.
1. Getting Started: Anaconda:
First things first, you will need Python installed on your computer. We recommend running Python 2.7 through Anaconda: http://continuum.io/downloads