wget not subsetting correctly using NCSS

33 views
Skip to first unread message

Sam Kastner

unread,
Apr 15, 2021, 2:37:26 PM4/15/21
to HYCOM.org Forum
Hello,

I'm trying to download output from expt_53.X in the western Caribbean sea for the entire run of the experiment (1994-2015). I'm doing this one time step and one variable at a time to avoid overly large requests, and then concatenating locally. I'm primarily a Matlab user, so I've used Matlab to generate the list of urls I need to do this. I've tried to do the download two ways: (1) using Matlab's built-in websave function, and (2) using a shell escape and wget. (1) works correctly, but is slow. (2) is fast, but downloads the entire model domain, not just my region of interest, which would create storage problems for me over the entire time period. Here's the url I'm using for an example time step and surface elevation:

Sam Kastner

unread,
Apr 15, 2021, 2:51:49 PM4/15/21
to HYCOM.org Forum, Sam Kastner
To be clear, I'm trying to understand why wget and websave don't produce the same results. I'd prefer to use wget, but not if I have to download the full grid's worth of output.

Michael McDonald

unread,
Apr 16, 2021, 12:53:38 PM4/16/21
to Sam Kastner, HYCOM.org Forum
Sam,

A very common tale. Why didn't you enclose your wget 'URL' in single
quotes as you did with websave in MATLAB?

Several of those characters in the URL (e.g., &) are reserved in UNIX,
therefore the actual equivalent URL you are making with "wget" stops
(likely) after the 1st ampersand is encountered, hence the reason why
you get the entire domain for all time.

e.g.,
wget -O examplefilename_wget.nc
http://ncss.hycom.org/thredds/ncss/GLBv0.08/expt_53.X/data/1994?var=surf_el

should be,

wget 'http://ncss.hycom.org/thredds/ncss/GLBv0.08/expt_53.X/data/1994?var=surf_el&north=18.5&west=276&east=289&south=8&disableProjSubset=off&horizStride=1&time=1995-01-01T09%3A00%3A00Z&vertCoord=&accept=netcdf4'
-O examplefilename_wget.nc
Reply all
Reply to author
Forward
0 new messages