Sneak preview: Matlab/Java interfaces

Arlindo da Silva dasilva at ALUM.MIT.EDU
Thu Jul 16 09:06:08 EDT 2009


On Thu, Jul 16, 2009 at 2:52 AM, Maat, Herbert ter
<Herbert.termaat at wur.nl>wrote:

>  Dear Arlindo,
>
> You mentioned in an e-mail posted on the GrADS user mailing list that an
> interface is available between GrADS and Matlab. I am interested in this
> interface and my next question is how I can get hold off this interface.
> Note that I am working on a Windows XP machine.
>
>

Untill I have a chance to package it for sf.net you can get a sneak preview
from here:

     http://opengrads.org/devel/jygrads/

Installation instructions are here:


http://opengrads.org/wiki/index.php?title=JyGrADS:_Java_and_Matlab_interface_to_GrADS_through_Jython

This interface is similar to the other python, perl, etc, interfaces. Here
is a quick illustration:

*  ga = grads('gradsnc -bl',0); % start grads
  fh = ga.open('data/model');  % open a file
  qh = ga.query('dims');       % query something
  [ts,g] = ga.expr('ts');      % Get GrADS data
  pcolor(g.lon,g.lat,ts);      % plot in matlab
  shading('interp'); title('Surface Temperature')
  xlabel('Longitude');  ylabel('Latitude');

  ga.cmd('q config');            % send commands,
  fprintf(1,'%s\n',ga.rline(1)); % capture output


*

See file examples.m <http://opengrads.org/devel/jygrads/examples.m> in the
URL above for a more detailed example with annotations.

This interface explores Matlab's Java integration, so it should work under
windows just fine (although I have not tried it myself under Windows --- let
me know if it works).

*Looking for .NET volunteers:*

  This interface is built on top of Jython (Python under Java). There is
something called IronPython which implements the Python under Microsofts
.NET framework. I believe that porting JyGrADS to work under IronPython/.NET
should be relatively straightforward. This would be an interesting OpenGrADS
project, but the OpenGrADS developers are already overextended as it is. So,
if someone out there would like to champion this .NET project, please drop
us a not at opengrads-devel at lists.sf.net. Some familiarity with .NET and
Python (or willingness to learn it) is necessary.

   Cheers!

     Arlindo

--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090716/77c9fdd1/attachment.html 


More information about the gradsusr mailing list