Initial commit for toolbox library

Add a new directory to hold all the tools, and add
the abstract base class that they will have to subclass.

Also add initial unit tests.
Order images by time

Add ordering to the Image api so we can order by
date, returning a timeseries.
Add intial brdf routines

Add first stages of BRDF tool, based on the
ToolBase class. Methods mMostly taken from
Dan's dimitripy code.

Also add a tool for performing database queries
and use that to return database entries.
(though in final product the web interface should
do this instead)
Add InstrumentWavelength resource

Add InstrumentWavelengthResource to the api, and
add a corresponding url so we can query the
database for all the wavelengths for a given sensor.
Intermediate work on BRDF tool

Refactor run method so it just takes a json format
object as returned from database query.

Add a main() method to test the tool, while we don't
have the web interface ready.

BRDF tool now extracts reflectance arrays from
the returned list of files, and plots a timeseries
with one line per band.

Add new method to libquerydb to perform a query for
the instrument wavelengths, given an instrument to
search for. We use the returned wavelengths to
label the BRDF plot.

libbrdfroujean now
Add time binning

Move the plotting stuff to a new method, and bin
the data in time chunks before calculating BRDF.
Default bin is 5 days (same as DIMITRI).

Also, fix the relative azimuth angle calculation
so it stays in range 0-180
Calculate error estimates

Add calculation of error estimates to the timeseries
method. Then just return the result arrays, and split
out the plotting to a separate method.
Return mean dates from the binned timeseries

Instead of storing the mid point of the bin,
calculate the mean date of the included images.
Do this by converting to unix timestamp, so
they are just integers which we can average.

This gave an error when the bin size was such
that we had some bins with no images found,
leading to an empty timestamps list. So add a
check that we found some images before doing
any of the brdf calculations.
Improve the timeseries plot

Tidy up the plot a bit:
- Make the figure window bigger
- Add (optional) title, xlabel and ylabel
  arguments, and use instrument and region
  in our title.
- Move the legend box outside the plot area,
  and add a title to it
Add some tests for the BRDF code
Add MERIS correction

The MERIS reflectance files had incorrect magnitudes.
Add the solar irradiance correction, following what
DIMITRI does. It reads in a solar irradiance model
from an external text file, applies a date
correction, and then use this solar model to correct
the MERIS reflectance values.

Add an aux_files directory where we can keep any
external files that are required for the ingestion
(such as the solar irradiance model that is needed
here).
Write BRDF output to csv file

Add method to write the BRDF output arrays
to a csv file. File name includes the sensor
name, region and the date range.

The arrays are written with dates along the
columns, and with all bands for first variable
as rows, then all bands for next variable etc
(following DIMITRI output format)
Add more unit tests for BRDF module
Update tools documentation

Update the docstrings in the tools libraries,
and add a new page to the web documentation to
display them.
Separate the AATSR directions

We previously had separate database entries for
the two AATSR directions (forward looking and
nadir looking). This meant the geotiff had
2 x nbands arrays in it, but with no way of
labelling which order they come in.

Change so that we create separate geotiff files
(and quicklooks) for each direction, so that
the files are then consistent with other sensors
and have the expected number of arrays inside.

This also means we now use the correct array
of flag values, rather than the using nadir
flags for both directions.
Add AATSR corrections

Following the DIMITRI code, add corrections to
the AATSR reflectance and viewing angles:

- Convert elevation angles (ie zenith==90) to
  zenith angles (ie zenith==0)

- Correct reflectance for solar angle

- Correct band 3 (1600nm) reflectance for non-
  linearity (if required, based on value of GC1
  filename)

- Remove drift correction, and re-apply using
  look up table. (And add this look up table to
  the aux_files directory)

NB these corrections are only applied to the
reflectance wavelengths and not the brightness
temperature ones.
Rebuild docs to include new correction methods
BRDF updates

- k coefficients only calculated once, for some given
  date range. Then these values are used to calculate
  BRDF for the entire timeseries.
  (If no date range given, it defaults to using the
   whole timeseries)

- Plot (reflectance - BRDF)/BRDF * 100 (ie the error
  as a percentage of modelled BRDF)

- Before plotting, remove (by setting to nan) values
  that are more than two standard deviations away from
  mean

- Add option to save the plot, if a filename is passed
  to plot_timeseries(). Amend the plot unit test so that
  no file is created there.

- Add measured reflectance to the output csv file. This
  means also re-sampling into the time bins as with BRDF.

- Re-build the html docs to reflect the changes
Merge in BRDF branch

Adds new "tools" folder which we will use to
hold all the tools libraries.

Set up an abstract base class which the tools
will subclass (and must override the "run"
method.)

Add first tool to compute Roujean BRDF and create
a plot and csv file. Also add a library for
database queries (but we should use the user
interface instead when it's ready.

Update html docs to include a new page for the
tools