NOAA 6-min ver water levels

53 views
Skip to first unread message

Kelly Legault

unread,
Dec 30, 2013, 2:31:22 PM12/30/13
to ncto...@googlegroups.com

I'm doing something VERY simple, and I am trying to download NOAA WLs (6-min) for a multi-year time period.  It would be much better if I could batch this work. I have NCTOOLBOX for matlab.  It seems that cannot use LOADDAP right now because I have 64-bit R2011b for Matlab -- and I cannot find a compatible script. In any case, I am not very good at figuring out the structure.  So far, I have:


> nc=ncdataset('http://opendap.co-ops.nos.noaa.gov/dods/IOOS/SixMin_Verified_Water_Level')


> nc.netcdf

> ans =

> netcdf dods://opendap.co-ops.nos.noaa.gov/dods/IOOS/SixMin_Verified_Water_Level {
>  variables:
>
>    Structure {
>      String _STATION_ID;
>      String _DATUM;
>      String _BEGIN_DATE;
>      String _END_DATE;
>      String DATE_TIME;
>      double WL_VALUE;
>      double SIGMA;
>      byte I;
>        :_Unsigned = "true";
>      byte F;
>        :_Unsigned = "true";
>      byte R;
>        :_Unsigned = "true";
>      byte T;
>        :_Unsigned = "true";
>    } WATERLEVEL_6MIN_VFD_PX(*);
>

I cannot seem to get the syntax correct  (version released 04/05/2012) to download data for:

Sequence {
        String _8726724;
        String _NAVD;
        String _20050201;
        String _20050301;
        String DATE_TIME;
        Float64 WL_VALUE;
        Float64 SIGMA;
        Byte I;
        Byte F;
        Byte R;
        Byte T;
    } WATERLEVEL_6MIN_VFD_PX;

 


Any help would be appreciated!  -- Kelly

Richard Signell

unread,
Dec 30, 2013, 3:30:45 PM12/30/13
to ncto...@googlegroups.com, Mohamed Chaouchi
Kelly,

I don't think you can access the NOAA CO-OPS water level data using
NCTOOLBOX because the data via OPeNDAP is not CF-Compliant.
(Hopefully Brian will correct me if I'm wrong!)

Luckily, NOAA CO-OPS serves their data using other web services also,
and the SOAP/WSDL service is rather straightforward to access using
Matlab.

I have wiki page that shows how to access the tidal constituent data
and water level data using SOAP/WSDL from CO-OPS:

http://bit.ly/coops_wsdl

-Rich
> --
> You received this message because you are subscribed to the Google Groups
> "nctoolbox" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nctoolbox+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Rich Signell
81 Queen St
Falmouth, MA

Brian Schlining

unread,
Dec 30, 2013, 5:57:22 PM12/30/13
to ncto...@googlegroups.com, Kelly Legault
Hi Kelly,


I'm doing something VERY simple, and I am trying to download NOAA WLs (6-min) for a multi-year time period.  It would be much better if I could batch this work. I have NCTOOLBOX for matlab.  It seems that cannot use LOADDAP right now because I have 64-bit R2011b for Matlab -- and I cannot find a compatible script. In any case, I am not very good at figuring out the structure.  So far, I have:


> nc=ncdataset('http://opendap.co-ops.nos.noaa.gov/dods/IOOS/SixMin_Verified_Water_Level')



Yikes, that’s  a funky dataset. (I hate NetCDF structures). I tried hacking around with the NetCDF-Java API a little and tried this:

s = nc.netcdf.getVariables().get(0) % A pointer to structure WATERLEVEL_6MIN_VFD_PX
s0 = s.findVariable('SIGMA’)        % A pointer to the sigma variable
s0.read                             

opendap.dap.DAP2Exception: com.sybase.jdbc3.jdbc.SybSQLException: Procedure odap_waterlevel_6min_vfd_sp expects parameter @STATION_ID, which was not supplied.

So it looks like you need to provide a station parameter in order to read anything. How do you normally read that dataset?

Cheers
Brian

Rich Signell

unread,
Apr 16, 2014, 11:29:15 AM4/16/14
to ncto...@googlegroups.com, Kelly Legault
Brian,
This OpenDAP ASCII URL works when dropped into the browser:
dap_ascii_url=(['http://opendap.co-ops.nos.noaa.gov/dods/IOOS/SixMin_Verified_Water_Level.ascii?&WATERLEVEL_6MIN_VFD_PX._STATION_ID=%228729210%22&WATERLEVEL_6MIN_VFD_PX._DATUM=%22MSL%22&WATERLEVEL_6MIN_VFD_PX._BEGIN_DATE=%2220131001%22&WATERLEVEL_6MIN_VFD_PX._END_DATE=%2220131020%22'])

Does that contain enough clues to say how we could use ncdataset to read this?

-Rich
> --
> You received this message because you are subscribed to the Google Groups
> "nctoolbox" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nctoolbox+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Rich Signell
81 Queen St
Falmouth, MA 02540

Brian Schlining

unread,
Apr 16, 2014, 11:51:52 AM4/16/14
to ncto...@googlegroups.com, Rich Signell, Kelly Legault

Hmmm,

I tried the following:

')    
s = nc.netcdf.getVariables().get(0)   
sv = s.findVariable('SIGMA')   
sgm = sv.read().copyToNDJavaArray()   

But that throws:

opendap.dap.DAP2Exception: com.sybase.jdbc3.jdbc.SybSQLException: Procedure odap_waterlevel_6min_vfd_sp expects parameter @STATION_ID, which was not supplied.

    at opendap.dap.DConnect2.openConnection(DConnect2.java:282)
    at opendap.dap.DConnect2.getData(DConnect2.java:826)
    at opendap.dap.DConnect2.getData(DConnect2.java:1116)
    at ucar.nc2.dods.DODSNetcdfFile.readDataDDSfromServer(DODSNetcdfFile.java:1447)
    at ucar.nc2.dods.DODSNetcdfFile.readData(DODSNetcdfFile.java:1618)
    at ucar.nc2.Variable.reallyRead(Variable.java:859)
    at ucar.nc2.Variable._read(Variable.java:831)
    at ucar.nc2.Variable.read(Variable.java:709)
    at ucar.nc2.Variable.reallyRead(Variable.java:854)
    at ucar.nc2.Variable._read(Variable.java:831)
    at ucar.nc2.Variable.read(Variable.java:709)
    at ucar.nc2.dataset.VariableDS.reallyRead(VariableDS.java:518)
    at ucar.nc2.dataset.VariableDS._read(VariableDS.java:502)
    at ucar.nc2.Variable.read(Variable.java:709)

Does anyone know how to read that structure using the NetCDF-Java API? I have no idea where to pass in the station ID (which is 228729210)



On April 16, 2014 at 8:29:16 AM, Rich Signell (ri...@signell.us) wrote:

-- 
Brian Schlining

Reply all
Reply to author
Forward
0 new messages