I have made some progress here, but not necessarily the good kind.
I have set up my .dodsrc file as recommended, and have set a .netrc to supply username/password to
urs.earthdata.nasa.gov. I have also upgraded to netCDF 4.4.1. I can get curl to download a data variable:
curl -k -n -c ursCookies -b ursCookies -L --url
http://airsl2.gesdisc.eosdis.nasa.gov/opendap/Aqua_AIRS_Level2/AIRX2RET.006/2003/003/AIRS.2003.01.03.003.L2.RetStd.v6.0.7.0.G13186000743.hdf.ascii?satheight
Dataset: AIRS.2003.01.03.003.L2.RetStd.v6.0.7.0.G13186000743.hdf
satheight, 705.263, 705.348, 705.435, 705.525, 705.618, 705.713, 705.811, 705.912, 706.015, 706.12, 706.228, 706.338, 706.451, 706.566, 706.683, 706.803, 706.925, 707.05, 707.177, 707.306, 707.438, 707.571, 707.707, 707.846, 707.986, 708.129, 708.273, 708.42, 708.569, 708.72, 708.873, 709.027, 709.184, 709.343, 709.504, 709.666, 709.83, 709.997, 710.164, 710.334, 710.505, 710.678, 710.853, 711.029, 711.207
And I can get ncdump to dump the header:
ncdump -h
http://airsl2.gesdisc.eosdis.nasa.gov/opendap/Aqua_AIRS_Level2/AIRX2RET.006/2003/003/AIRS.2003.01.03.003.L2.RetStd.v6.0.7.0.G13186000743.hdf
But I cannot get ncdump to fetch a data variable:
~/bin/ncdump -v satheight
http://airsl2.gesdisc.eosdis.nasa.gov/opendap/Aqua_AIRS_Level2/AIRX2RET.006/2003/003/AIRS.2003.01.03.003.L2.RetStd.v6.0.7.0.G13186000743.hdf
<lots of header stuff>
satheight = CURL Error: Couldn't connect to server
curl error details:
NetCDF: I/O failure
Location: file vardata.c; line 473
And no way for me to tell if the problem is in the netcdf build I have, the elderly curl library, the URS configuration, the .dodsrc, or what. Can anyone reproduce this with ncdump, or give me some things to try for diagnostics?
> On Sep 19, 2016, at 3:58 PM, Peter Smith <
sup...@earthdata.nasa.gov> wrote:
>
> Chris
>
> I've not used ncks, but it is similar to ncdump in that it is built on top of netCDF. We should therefore be able to configure it in the same way. The OPeNDAP group has provided some documentation for this:
>
>
http://docs.opendap.org/index.php/DAP_Clients_-_Authentication#ncdump
>
> Let me know if you have any problems making this work.
>
> Embedding your username and password into the URL will not work because even if the client supports the syntax, it will send the credentials only to the data server from which you are downloading data - it will not send them to Earthdata Login when the client is redirected for user authentication.
>
> Thanks,
> Peter Smith
>
>
>
> Ticket History
> Chris Lynnes (Client) Posted On: 19 September 2016 12:17 PM
>
> ~>wget --no-check-certificate
http://airsl2.gesdisc.eosdis.nasa.gov:80/opendap/Aqua_AIRS_Level2/AIRX2RET.006/2003/003/AIRS.2003.01.03.003.L2.RetStd.v6.0.7.0.G13186000743.hdf.nc
> --2016-09-19 12:02:53--
http://airsl2.gesdisc.eosdis.nasa.gov/opendap/Aqua_AIRS_Level2/AIRX2RET.006/2003/003/AIRS.2003.01.03.003.L2.RetStd.v6.0.7.0.G13186000743.hdf.nc
> Resolving airsl2.gesdisc.eosdis.nasa.gov... 198.118.197.66, 2001:4d0:241a:4041::66
> Connecting to
airsl2.gesdisc.eosdis.nasa.gov|198.118.197.66|:80... connected.
> HTTP request sent, awaiting response... 302 Found
> Location:
https://urs.earthdata.nasa.gov/oauth/authorize/?scope=uid&app_type=401&client_id=e2WVk8Pw6weeLUKZYOxvTQ&response_type=code&redirect_uri=http%3A%2F%2Fairsl2.gesdisc.eosdis.nasa.gov%2Fdata-redirect&state=aHR0cDovL2FpcnNsMi5nZXNkaXNjLmVvc2Rpcy5uYXNhLmdvdi9vcGVuZGFwL0FxdWFfQUlSU19MZXZlbDIvQUlSWDJSRVQuMDA2LzIwMDMvMDAzL0FJUlMuMjAwMy4wMS4wMy4wMDMuTDIuUmV0U3RkLnY2LjAuNy4wLkcxMzE4NjAwMDc0My5oZGYubmM [following]
> --2016-09-19 12:02:53--
https://urs.earthdata.nasa.gov/oauth/authorize/?scope=uid&app_type=401&client_id=e2WVk8Pw6weeLUKZYOxvTQ&response_type=code&redirect_uri=http%3A%2F%2Fairsl2.gesdisc.eosdis.nasa.gov%2Fdata-redirect&state=aHR0cDovL2FpcnNsMi5nZXNkaXNjLmVvc2Rpcy5uYXNhLmdvdi9vcGVuZGFwL0FxdWFfQUlSU19MZXZlbDIvQUlSWDJSRVQuMDA2LzIwMDMvMDAzL0FJUlMuMjAwMy4wMS4wMy4wMDMuTDIuUmV0U3RkLnY2LjAuNy4wLkcxMzE4NjAwMDc0My5oZGYubmM
> Resolving urs.earthdata.nasa.gov... 198.118.243.33, 2001:4d0:241a:4081::89
> Connecting to
urs.earthdata.nasa.gov|198.118.243.33|:443... connected.
> WARNING: cannot verify
urs.earthdata.nasa.gov's certificate, issued by `/C=US/O=Entrust, Inc./OU=See
www.entrust.net/legal-terms/OU=(c) 2014 Entrust, Inc. - for authorized use only/CN=Entrust Certification Authority - L1M':
> Unable to locally verify the issuer's authority.
> HTTP request sent, awaiting response... 401 Unauthorized
> Authorization failed.
>
> Peter Smith (Staff) Posted On: 19 September 2016 12:32 PM
>
> Hi Chris
>
> When wget exits upon receiving a HTTP 401 status, it usually indicates that it cannot find suitable credentials to authenticate with. Can you please verify that your .netrc file located in your home directory contains a line of the form:
>
> machine
urs.earthdata.nasa.gov login <username> password <password>
>
> where <uid> and <password> are your Earthdata Login username and password.
>
> If your .netrc file is correct, can you please run a test by adding in the following options to your wget command line:
>
> --http-user=<username> --ask-password
>
> where <username> is your Earthdata Login username.
>
> Thank you,
> Peter Smith
> Earthdata Login Suport
>
>
>
>
> Lynnes Christopher S. (GSFC-6102) (Recipient (CC)) Posted On: 19 September 2016 02:37 PM
>
>
> On Sep 19, 2016, at 12:32 PM, Peter Smith <
sup...@earthdata.nasa.gov<mailto:
sup...@earthdata.nasa.gov>> wrote:
>
> Hi Chris
>
> When wget exits upon receiving a HTTP 401 status, it usually indicates that it cannot find suitable credentials to authenticate with. Can you please verify that your .netrc file located in your home directory contains a line of the form:
>
> machine
urs.earthdata.nasa.gov<
http://urs.earthdata.nasa.gov> login <username> password <password>
>
> where <uid> and <password> are your Earthdata Login username and password.
>
> If your .netrc file is correct, can you please run a test by adding in the following options to your wget command line:
>
> --http-user=<username> --ask-password
>
> where <username> is your Earthdata Login username.
>
> Thank you,
> Peter Smith
> Earthdata Login Suport
>
> Ah, I see my mistake; I had a GES DISC address in .netrc instead of URS. Must have been left over from URS3.
>
> Unfortunately, other command line tools, like ncks, do not appear to know how to login with .netrc...
>
>
>
>
>
> Ticket History
> Chris Lynnes (Client) Posted On: 19 September 2016 12:17 PM
>
>
> Lynnes Christopher S. (GSFC-6102) (Recipient (CC)) Posted On: 19 September 2016 02:54 PM
>
>
> On Sep 19, 2016, at 2:37 PM, Lynnes, Christopher S. (GSFC-5860) <
christophe...@nasa.gov<mailto:
christophe...@nasa.gov>> wrote:
>
>
> On Sep 19, 2016, at 12:32 PM, Peter Smith <
sup...@earthdata.nasa.gov<mailto:
sup...@earthdata.nasa.gov>> wrote:
>
> Hi Chris
>
> When wget exits upon receiving a HTTP 401 status, it usually indicates that it cannot find suitable credentials to authenticate with. Can you please verify that your .netrc file located in your home directory contains a line of the form:
>
> machine
urs.earthdata.nasa.gov<
http://urs.earthdata.nasa.gov/> login <username> password <password>
>
> where <uid> and <password> are your Earthdata Login username and password.
>
> If your .netrc file is correct, can you please run a test by adding in the following options to your wget command line:
>
> --http-user=<username> --ask-password
>
> where <username> is your Earthdata Login username.
>
> Thank you,
> Peter Smith
> Earthdata Login Suport
>
> Ah, I see my mistake; I had a GES DISC address in .netrc instead of URS. Must have been left over from URS3.
>
> Unfortunately, other command line tools, like ncks, do not appear to know how to login with .netrc...
>
> Should embedding username and password in the URL work? http://username:password@host/etc. I can't seem to make it work...
>
>
>
>
>
>
> Ticket History
> Chris Lynnes (Client) Posted On: 19 September 2016 12:17 PM
>
>
> Ticket Details
> Ticket ID: 63481
> Department: URS
> Type: Data/Science
> Status: Closed
> Priority: Normal
>
> Helpdesk:
https://support.earthdata.nasa.gov/index.php?
--
Christopher Lynnes NASA/GSFC
301-614-5185
“Don't loaf and invite inspiration; light out after it with a club..." - J. London