Jump to content Jump to site navigation
NASA Home Page Goddard Space Flight Center Home Page
NASA Logo - Goddard Space Flight Center + Visit NASA.gov

LAADS Web - Level 1 and Atmosphere Archive and Distribution System

HOME DATA IMAGES TOOLS HELP

MODAPS Web Services Quick Start Guide

  1. Resource Locations
  2. Workflow Synopsis
  3. Example sequences of web service calls
  4. Code Examples
  5. Order Script

Resource Locations

The Web service description language document (WSDL):

http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices?wsdl

This XML document describes the Web Service interface, by describing the operations, parameters, and data structures used in the Web Service.

The Web service access URL:

http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices

This is the location of the actual web service that responds to queries.

The Web Service namespace URN:

http://modapsws.gsfc.nasa.gov

This is not an actual location but is the namespace that SOAP clients generally require that you provide them with before making queries.

Workflow Synopsis

Finding and obtaining data files is generally a three step process: searching, ordering, and then retrieving the files. However, the process will generally require more than three web service calls.

Alternatively, if the files you find (via searching) are already online and available on the FTP server, and you do not require any additional processing (subsetting, reformatting, etc.), you can directly obtain URLs for those files. You can determine whether the files you seek are online by using the getFileProperties method, which contains a boolean field in the results indicating whether the file is currently online.

Example sequences of web service calls

Simple Order (No Post-Processing)

  1. Instruments = listSatelliteInstruments()
  2. Products = listProductsByInstrument( Instrument )
  3. File IDs = searchForFiles( Product, spatial info, temporal info )
  4. Order IDs = orderFiles( File IDs )
  5. getOrderStatus( Order ID )
  6. getOrderUrl( Order ID )

Order With Post-Processing

  1. Products = listProducts()
  2. File IDs = searchForFiles( Product, spatial info, temporal info )
  3. getPostProcessingTypes( Product )
  4. reprojectionNames = listMapProjections( Product )
  5. reprojectionParams = listReprojectionParameters( reprojectionName )
  6. Order IDs = orderFilesProcessed( File IDs, reprojectionName, reprojectionParams, otherProcessingOptions, ... )
  7. getOrderStatus( Order ID )
  8. getOrderUrl( Order ID )

Simple URL Fetching

  1. Products = listProducts()
  2. File IDs = searchForFiles( Product, spatial info, temporal info )
  3. getFileUrls( File IDs )

Code Examples

REST

The web service can be used by executing a series of GET requests to the service. For example, to search and get file URLs:

Here are some more examples.

PHP with REST

<?

$restQuery = 'http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices/
listProductsByInstrument?instrument=AM1M';

$result = new SimpleXMLElement($restQuery,NULL,TRUE);

foreach ( $result as $product ){
  echo "$product\n";
}

?>

Perl with SOAP::Lite

use SOAP::Lite;

my $WS_NAMESPACE = 'http://modapsws.gsfc.nasa.gov';

my $WS_URL = 'http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices';
my $client = SOAP::Lite->uri($WS_NAMESPACE)->proxy($WS_URL);

my $instrument = SOAP::Data->name('instrument')->value('AM1M')->type('string'); 

my $response = $client->listProductsByInstrument($instrument);

if ( $response->fault ) {
    print $response->faultstring;
} else {
    my @products = ();
    push @products, $response->result, $response->paramsout;
    print join("\n", @products);
}

PHP with SOAPClient

<?

$client = new SoapClient("http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices?wsdl");
$client->listProductsByInstrument("AM1M");

?>

Python with SOAPpy

from SOAPpy import SOAPProxy

url = 'http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices';
client = SOAPProxy(url);

response = client.listProductsByInstrument(instrument='AM1M');

for r in response:
  print r;

Order Script

The following script and parameter files allow the user to list, download, and order files using the MODAPS Web Services (MWS).

order_MWS.pl - script which accepts parameters files to list, download, and order files using the MODAPS Web Services (MWS).

list_example.txt - parameter file that searches for and lists URLs to MODIS collection 5 1km L1B files over Indonesia for Aug 1, 2008.

download_example.txt - parameter file that searches for and downloads MODIS collection 5 1km L1B files over Indonesia for Aug 1, 2008.

order_example.txt - parameter file that orders MODIS collection 5 1km L1B files over Indonesia for Aug 1, 2008, subset and mosaicked in geographic lon/lat grid.


+ Privacy Policy and Important Notices NASA logo Webmaster: Karen Horrocks
NASA Official: Ed Masuoka
+ Send Us Your Comments