Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

ADAM Reflectance Database Toolkit

Project description

Some words about the ADAM Tools here.

More info can be found at the ADAM website here: . The API documentation is available here: .


The ADAM-Tools are implemented in pure python, meaning there is no need to ‘install’ them as such, they can be simply imported into your Python scripts and used. This may be the best option if you plan on modifying the ADAM-Tools source code yourself for example, as you can store the code wherever you like.

If you do not intend to make modifications to the tools the best option is to let Python install them in a central location so all your scripts will be able to import them without specifying where they are.

To install using the Python module manager “easy_install”, issue from the command line (linux users may need to preceed command with “sudo”):

$ easy_install -U ADAM-Tools

The -U switch means that easy_install will try to install the latest available version, overwriting any existing versions on your computer.

Note this assumes that easy_install is in your path. If you are using windows and the result of the above is “Bad command or file name” you need to include the specific path to easy_install, something like this:

# windows with no python in path:
c:\python26\scripts\easy_install ADAM-Tools

If for some reason easy_install does not work, ADAM-Tools can be installed manually. To do this, download and unzip the source package below. Start a command prompt in the install directory, and issue:

$ python install



The configuration parameters of the ADAM Tools can be supplied as parameters when instantiating a new job. This allows the entire ADAM codebase to be replaced during an upgrade without losing site-specific config information.

For example, we start all ADAM scripts like this:

import adam
import adam_config

my_path_data       = 'c://ADAM-data/'
my_output_root_dir = 'c://ADAM-output/'
# get an instance of an adam 'config' object, this will be attached to any jobs we run
my_config = adam_config.adam_config(path_data = my_path_data, output_root_dir = my_output_root_dir)


Once created, the config is then used as a parameter for all the jobs that follow.

For example, a spectrum graph can be generated like this (note the cfg = my_config):

request_dict = {'fieldOperationType': 'spectrum',
                'fieldMonth'        : 'jan',
                'fieldSunZenith'    : 40,
                'fieldViewZenith'   : 30,
                'fieldRelAzimuth'   : 0,
                'fieldLatMax'       : 36.2,
                'fieldLonMax'      : -5.2,
                'fieldLonMin'       : -5.5,
                'fieldLatMin'       : 36
job = adam.adam_job( cfg = my_config )
if not job.validate_input(request_dict):
    raise Exception('request input invalid !')
# make graph of land pixels (stored in the output directory specified in our configuration)
job.graph_main_ref_spectra(case='pixels',['idx_land'], title='Land pixel statistics')
# save results to a netCDF (stored in the output directory specified in our configuration)

Command Line Example

An example of launching an ADAM calculation from the command line is provided,

An example of its usage is given here:

$ python --sza 30.0 --vza 40.0 --phi 0.0 --latMin 36.0 --lonMin 5.2 --latMax 36.2 --lonMax 5.5 \
                             --wave-min 437 --wave-max 437 --month jan --operation-type brdf --beyond_za_limit nan --sza_max_limit 30 --netcdf-output ~/

More information about the commandline tool can be had by viewing the help:

$ python --help
usage: [-h] [--sza SZA] [--vza VZA]
                                 [--phi PHI] --latMin LATMIN --lonMin LONMIN
                                 --latMax LATMAX --lonMax LONMAX
                                 [--wave-min WAVE_MIN]
                                 [--wave-max WAVE_MAX]
                                 [--month {jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec}]
                                 --operation-type {brdf,spectrum}
                                 [--netcdf-output NETCDF_OUTPUT]

ADAM commandline options

optional arguments:
  -h, --help            show this help message and exit
  --sza SZA             Sun Zenith Angle (default 45)
  --vza VZA             View Zenith Angle (default 45)
  --phi PHI             Relative Azimuth Angle (default 0)
  --latMin LATMIN       Latitude Min
  --lonMin LONMIN       Longitude Min
  --latMax LATMAX       Latitude Max
  --lonMax LONMAX       Longitude Max
  --wave-min WAVE_MIN   Wavelength min
  --wave-max WAVE_MAX   Wavelength max
  --month {jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec}
  --operation-type {brdf,spectrum}
                        Type of operation to perform
  --netcdf-output NETCDF_OUTPUT
                        Name of netcdf output filename

Other Examples

There are a collection of example scripts using the toolkit provided in the test/ folder in the downloadable.

More info can be found at the ADAM website here:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ADAM-API-0.5.tar.gz (69.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page