[OpenMadrigal-developers] Changes to Madrigal Matlab API and isprint

William Rideout brideout at haystack.mit.edu
Tue Nov 18 11:22:44 EST 2003


The following changes suggested by John Holt were made to the Madrigal 
Matlab API, and have been checked into CVS and installed on hyperion:

1.  A new Matlab method has been added, called isprintWeb, which works 
just like isprint, except it does not require local access to the 
Madrigal files.  Instead it runs isprint over the web, and then parses 
the returned result.  It will not yet work with other Madrigal sites 
until they install the latest version of Madrigal, since it depends on a 
simplified cgi script called isprintService.  It runs more slowly than 
the standard Matlab isprint method, mostly due to the time it takes 
Matlab to parse the returned text report.  If there is a need for better 
performance, I could write the parser in C instead of Matlab.

2. Both the Matlab methods isprint and isprintWeb take three new 
optional arguments: missing, assumed, and knownbad.  These let you set 
the values of these special Cedar values.  By default they are all NaN. 
  The command line version of isprint now also lets you specify a string 
for each of these values (by default they are 'missing', 'assumed' and 
'knownbad').  The web interface only allows you to set the value of 
missing; the values of 'assumed' and 'knownbad' cannot be changed. 
Please let me know if you think we need to let users change these in the 
web interface.  The Fortran interface uses the #define values of 
missing, assumed, and knownbad, so its up to the application to handle 
them as it sees fit.  Note that the C API was not touched - handling 
these special values separately was built in from the beginning.

Full documentation is available either via the Madrigal website, or from 
the standard Matlab help command on hyperion.  To get a list of the 
Madrigal methods, type help madmatlab.

Future plans:

To make a better Matlab interface, we need a better API for accessing 
metadata.  For now, we only have a simple method requested by Shunrong 
that returns all local file names between two dates.  At a minimum we 
need to add a method that gets all instrument names, and a method that 
returns local files names based on instruments and dates.  However, we 
may also want to search for files based on:

1. kind of data code (kindat)
2. experiment name
3. file type (default vs history)

Please let me know if any of these last three would be worthwhile.

Finally, the longer term plan is to make a global search available via 
Matlab.

Again, all the above Matlab methods would be available either locally, 
or more slowly over the web.


Technical notes:

In order to get Matlab to access the web, I imported an external library 
from http://www.rydesater.com.  The present release contains a 
non-standard header ("HTTP1.0" instead of the standard "HTTP/1.0") which 
was accepted on the linux version of apache but not the solaris, so I 
edited the source code and added it to the Madrigal distribution.

Bill

-- 
Bill Rideout
MIT Haystack Observatory
Email: brideout at haystack.mit.edu
Phone: 781 981-5624




More information about the OpenMadrigal-developers mailing list