[OpenMadrigal-developers] Isprint from Matlab via the web
William Rideout
brideout at haystack.mit.edu
Thu Nov 13 09:07:01 EST 2003
John Holt suggested to me that is would be nice to be able to run
isprint from Matlab without local access to the Madrigal files. This
means that Matlab would really just go through the web browser the way a
user would to create a isprint report.
The new method would be similar to the present Matlab isprint method:
[records] = isprint(file, parms, filters)
and would only have one additional argument, a url:
[records] = isprintWeb(url, file, parms, filters)
Implementation details:
1. Matlab does not have built in tcp/ip support. There is a contributed
tcp/ip module available at:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=345&objectType=FILE
This would need to be installed as part of the madmatlab installation,
but it is open source and freely-distributable.
2. Madrigal does not hard-code the url of the cgi-bin directory, so just
knowing that our site is www.haystack.mit.edu/madrigal does not tell me
how to find the cgi-directory. One approach would be to parse the home
page and get the information from the "Access Data" link. This is what
I think is best, but here are two other approaches: 1. make the user
pass in the cgi-bin url (this would be faster), or 2. make the
madrigal.cfg file available via the web. Note I cannot solve this
problem with a script to get this info, since scripts must run in the
script directory, whose location is what I don't yet know. Let me know
if you disagree with my parsing the home page approach.
3. The code to generate the correct url given the isprint arguments
will be made part of the C API so that this technique can be easily
implemented in other scripting languages such as tcl or python.
4. To support this method, clearly there will need to be discovery
methods that list files given certain criteria, just as the web site
does now. Right now there is a very simple madmatlab method that
Shunrong requested called madsearchfiles that simply returns all local
file names between two times. This method uses local file access.
Rather than using existing cgi scripts to implement this on the web, it
would be simpler to create a new cgi script that calls my python method
that creates a file list based on almost any information available as
metadata. This cgi script would not be part of the user interface, but
would exist as a "web service" implemented as standard cgi. This again
would allow this functionality to easily be accesses from tcl or python.
So basically my approach would be to put as much functionality in cgi
and the C API as possible, and as little in Matlab as possible, so that
I only need to do it once.
Let me know your thoughts.
Bill
--
Bill Rideout
MIT Haystack Observatory
Email: brideout at haystack.mit.edu
Phone: 781 981-5624
More information about the OpenMadrigal-developers
mailing list