To make matlab clients work with DAP

24 views
Skip to first unread message

MuQun Yang

unread,
May 20, 2011, 5:40:13 PM5/20/11
to OPeNDAP Tech, ope...@opendap.org
Hi,

I would like to use MATLAB to access DAP data(mainly HDF data). It
seems to me loaddap is the way to go. I assume if I install loaddap on
the client machine, somehow I can make matlab work with DAP. Is that right?
It is not clear to me why loaddap needs libdap since I think libdap is
on the server-side.

I try installing loaddap but find it fails in the configuration. James
gallagher answered a question at
http://mailman.opendap.org/pipermail/support/2010-November/002580.html .
Say there is a subversion version that one can use. Anyone knows where
is the URL of this svn?

Anyway, I am mainly interested in using matlab to access HDF data via
DAP. I don't need to use loaddap if it is not necessary.

Could anyone describe the procedure on how to do that?

Thanks a lot,

BTW, the matlab tool box link at opendap.org is broken.
http://www.oceanographicdata.org/toolbox no longer exists.

Kent

Schlining, Brian

unread,
May 20, 2011, 7:33:31 PM5/20/11
to MuQun Yang, OPeNDAP Tech, ope...@opendap.org

Hi,

You might want to check out http://code.google.com/p/nctoolbox/. It can access HDF via OpenDAP; it uses netcdf-java instead of libdap. It's pretty simple to use. The download of the stable version is available at http://code.google.com/p/nctoolbox/downloads/list. USGS is doing some work on it to make it a better fit for the modeling communities too. If you want to try USGS's changes you'll have to check it out of source control at http://code.google.com/p/nctoolbox/source/checkout. (to use the latest sources just check it out and run it, being matlab there's no build step.) There hasn't been a release of the latest changes as it's still changing very rapidly.

Cheers
Brian Schlining

--
You received this message because you are subscribed to the Google Groups "OPeNDAP" group.
To post to this group, send email to ope...@opendap.org.
To unsubscribe from this group, send email to opendap+u...@opendap.org.
For more options, visit this group at http://groups.google.com/a/opendap.org/group/opendap/?hl=en.


Daniel Holloway

unread,
May 20, 2011, 7:36:44 PM5/20/11
to MuQun Yang, OPeNDAP Tech, ope...@opendap.org
Hi Kent,

You can download the source tar-distributions from our website,
it'll be the same as our SVN trunk revision (which by the way is at http://scm.opendap.org/svn/trunk/ml-structs/)
.

When you build it remember to add the --with-matlab=<MATLAB_ROOT>
option to configure. That way it will build with the revision of
Matlab on your platform.

The build is pretty straightforward.

One thing to keep in mind, our 'loaddap' client replicates the
DDS structure when interning the data into the workspace. For HDF
data this can get a bit messy, depending on what HDF types were used
when the files were generated. Just a heads up.

Here's what it looks like (for a simple HDF file) in Matlab:
-------------------------------------------------------------------------

Warning: Duplicate directory name: /Users/dan/matlab.
>> version

ans =

7.10.0.499 (R2010a)

>> loaddap('-V')
loaddap: 3.7.0

>> loaddap('http://opendap.jpl.nasa.gov/opendap/allData/modis/L3/aqua/4um/9km/daily/2004/008/A2004008.L3m_DAY_SST4_9.bz2')
Creating matrix l3m_data (2160 x 4320) with 9331200 elements.
Creating matrix l3m_qual (2160 x 4320) with 9331200 elements.

>> DAS = loaddap('-A','http://opendap.jpl.nasa.gov/opendap/allData/modis/L3/aqua/4um/9km/daily/2004/008/A2004008.L3m_DAY_SST4_9.bz2')

DAS =

l3m_data: [1x1 struct]
l3m_qual: [1x1 struct]
Global_Attributes: [1x1 struct]

>> DAS.Global_Attributes

ans =

DODS_ML_Real_Name: 'Global_Attributes'
HDF_GLOBAL: [1x1 struct]

>> DAS.Global_Attributes.HDF_GLOBAL.Title

ans =

MODISA Level-3 Standard Mapped Image\\000

>>
---------------

> --
> You received this message because you are subscribed to the Google

> Groups "OPeNDAP Tech" group.
> To post to this group, send email to openda...@opendap.org.
> To unsubscribe from this group, send email to opendap-tech...@opendap.org
> .
> For more options, visit this group at http://groups.google.com/a/opendap.org/group/opendap-tech/?hl=en
> .
>

John Evans

unread,
May 20, 2011, 6:12:36 PM5/20/11
to MuQun Yang, ope...@opendap.org, OPeNDAP Tech

hi kent, try snctools at http://mexcdf.sourceforge.net

MuQun Yang

unread,
May 23, 2011, 10:52:09 AM5/23/11
to ope...@opendap.org
Hi Dan, Brian and John,

I will try out the options you guys provided. Thanks a lot,

Kent

Reply all
Reply to author
Forward
0 new messages