gunzip(url) function not downloading archived file properly.

1 view (last 30 days)
I am attemping to download a RINEX file from NASA's CDDIS website that contains archived text files with .rnx file extension. The files are GNU compressed. If I manually download the file, gunzip(fname) unzips the file and I can open it with any text editor and see the contents. If I pass the URL to the function, gunzip(url), it successfully downloads and unzips the file, however when I open the file with a text editor, I only see HTML code and not the data I was expecting. I want to automate this download so everytime the script gets run, it is pulling the latest archive file from the website. Here is my code:
% Getting current date and time
dt = datetime('now',TimeZone='UTC');
year = char(string(dt.Year));
dayofyear = char(num2str(day(dt,'dayofyear'),'%03d'));
hour = char(num2str(dt.Hour-2,'%02d')); % -2 to enusure webpage has full uploads
% Assembling name of archived file
fname = ['AMC400USA_R_' year dayofyear hour '00_01H_GN.rnx.gz'];
% URL
url = ['https://cddis.nasa.gov/archive/gnss/data/hourly/' year '/' dayofyear '/' hour '/' fname];
gunzip(url)
This is an example of what the unzipped .rnx file contents look like when opened with Notepad:
Nothing special just normal text.
3.04 N: GNSS NAV DATA G: GPS RINEX VERSION / TYPE
sbf2rin-15.6.1 20230108 200620 UTC PGM / RUN BY / DATE
GPSA 2.4214E-08 7.4506E-09 -1.1921E-07 5.9605E-08 IONOSPHERIC CORR
GPSB 1.4746E+05 -1.9661E+05 0.0000E+00 2.6214E+05 IONOSPHERIC CORR
GPUT 0.0000000000E+00-7.105427358E-15 233472 2244 TIME SYSTEM CORR
18 LEAP SECONDS
AMC4 MARKER NAME COMMENT
40472S005 MARKER NUMBER COMMENT
-1248596.2520 -4819428.2840 3976506.0340 COMMENT
This data is provided as a public service by NASA/JPL. COMMENT
No warranty is expressed or implied regarding suitability COMMENT
for use. For further information, contact: COMMENT
ggnops at jpl dot nasa dot gov COMMENT
END OF HEADER
G01 2023 01 08 18 00 00 2.269432879984E-04-4.774847184308E-12 0.000000000000E+00
2.900000000000E+01 4.018750000000E+01 3.951950328880E-09-3.037220366774E+00
2.095475792885E-06 1.217927131802E-02 8.475035429001E-07 5.153651306152E+03
6.480000000000E+04 8.195638656616E-08-1.509571007875E+00-1.080334186554E-07
9.889937496165E-01 3.783125000000E+02 9.376707754201E-01-7.857470152314E-09
1.428630936784E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 4.656612873077E-09 2.900000000000E+01
5.761800000000E+04 4.000000000000E+00
G03 2023 01 08 20 00 00-3.732382319868E-04 1.932676241267E-12 0.000000000000E+00
4.600000000000E+01-1.154687500000E+02 3.944092858727E-09-3.129129603894E+00
-5.917623639107E-06 4.432332352735E-03 5.209818482399E-06 5.153748886108E+03
7.200000000000E+04-2.048909664154E-08-4.775174641877E-01-3.166496753693E-08
9.772793892093E-01 2.865312500000E+02 1.030595609770E+00-7.814611224210E-09
-1.725071856167E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 1.862645149231E-09 4.600000000000E+01
6.481800000000E+04 4.000000000000E+00
G04 2023 01 08 20 00 00-5.264999344945E-05 7.617018127348E-12 0.000000000000E+00
1.900000000000E+01-3.784375000000E+01 4.232676307958E-09-1.412220360647E-01
-1.963227987289E-06 2.259276807308E-03 1.011602580547E-05 5.153726356506E+03
7.200000000000E+04 4.284083843231E-08 6.032464502417E-01 5.587935447693E-09
9.623705174978E-01 1.847187500000E+02-3.090559612202E+00-7.769966507436E-09
4.600191616446E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-4.656612873077E-09 1.900000000000E+01
6.481800000000E+04 4.000000000000E+00
G06 2023 01 08 18 00 00 5.551935173571E-04 6.366462912410E-12 0.000000000000E+00
5.400000000000E+01 4.975000000000E+01 4.078027009051E-09-2.760084318808E+00
2.624467015266E-06 2.848691423424E-03 6.891787052155E-07 5.153588459015E+03
6.480000000000E+04 3.352761268616E-08-1.517872509140E+00 3.725290298462E-09
9.882564023316E-01 3.825937500000E+02-8.877240370180E-01-8.114980878669E-09
1.264338379054E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 3.725290298462E-09 5.400000000000E+01
5.776800000000E+04 4.000000000000E+00
G07 2023 01 08 19 59 44 2.619638107717E-04-6.025402399246E-12 0.000000000000E+00
1.300000000000E+01 1.215625000000E+01 5.105212652599E-09-2.595804698394E+00
4.079192876816E-07 1.658227364533E-02 5.299225449562E-06 5.153594608307E+03
7.198400000000E+04 2.328306436539E-07 1.619514604610E+00-1.750886440277E-07
9.499521745782E-01 2.705625000000E+02-2.230961573807E+00-7.994618722245E-09
3.718012012981E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-1.117587089539E-08 1.300000000000E+01
6.481800000000E+04 4.000000000000E+00
G08 2023 01 08 19 59 44-1.026229001582E-04-1.818989403546E-12 0.000000000000E+00
1.000000000000E+01 9.496875000000E+01 4.335180577672E-09 2.656750722846E-01
4.975125193596E-06 8.120059035718E-03 8.963048458099E-06 5.153643884659E+03
7.198400000000E+04 1.229345798492E-07-2.597766832879E+00 5.774199962616E-08
9.609109304830E-01 2.030312500000E+02 1.883581226261E-01-7.968546207649E-09
-1.264338379054E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 5.122274160385E-09 1.000000000000E+01
6.481800000000E+04 4.000000000000E+00
G09 2023 01 08 20 00 00-2.398374490440E-04 6.480149750132E-12 0.000000000000E+00
3.000000000000E+01-4.075000000000E+01 4.381968240852E-09 5.944089240890E-01
-2.186745405197E-06 2.604041947052E-03 1.032836735249E-05 5.153696584702E+03
7.200000000000E+04 1.862645149231E-09 5.476788967730E-01-4.097819328308E-08
9.556106436933E-01 1.755937500000E+02 1.952867406663E+00-7.852112786301E-09
4.310893851747E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 9.313225746155E-10 3.000000000000E+01
6.481800000000E+04 4.000000000000E+00
G16 2023 01 08 20 00 00-5.243951454759E-04 1.023181539495E-12 0.000000000000E+00
5.600000000000E+01-1.000000000000E+00 4.506973447820E-09 1.094280522616E+00
2.514570951462E-07 1.327870972455E-02 9.169802069664E-06 5.153765914917E+03
7.200000000000E+04-1.452863216400E-07 2.752326952848E+00 1.080334186554E-07
9.667313855912E-01 2.094062500000E+02 7.517317385186E-01-7.974260731396E-09
-7.157440993290E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-1.024454832077E-08 5.600000000000E+01
6.481800000000E+04 4.000000000000E+00
G20 2023 01 08 20 00 00 4.583057016134E-04-2.387423592154E-12 0.000000000000E+00
8.200000000000E+01-1.158750000000E+02 4.831986985939E-09-1.038675762752E+00
-5.982816219330E-06 4.591808072291E-03 3.127381205559E-06 5.153726360321E+03
7.200000000000E+04 6.332993507385E-08-6.422051582855E-01-7.264316082001E-08
9.466461728243E-01 3.110937500000E+02-2.957719211666E+00-8.407135905242E-09
-1.739358165535E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
4.000000000000E+00 0.000000000000E+00-8.381903171539E-09 8.200000000000E+01
6.703200000000E+04 4.000000000000E+00
G21 2023 01 08 18 00 00 1.532975584269E-04 3.410605131648E-13 0.000000000000E+00
9.700000000000E+01 4.946875000000E+01 4.668408743677E-09-8.414928618411E-01
2.583488821983E-06 2.477301552426E-02 1.899898052216E-06 5.153659669876E+03
6.480000000000E+04-3.594905138016E-07-1.609438490088E+00-1.266598701477E-07
9.610671906147E-01 3.494062500000E+02-8.416073556616E-01-8.617858968417E-09
3.989451890970E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-1.024454832077E-08 9.700000000000E+01
5.761800000000E+04 4.000000000000E+00
G22 2023 01 08 20 00 00 4.017879255116E-04 7.958078640513E-12 0.000000000000E+00
9.400000000000E+01-3.421875000000E+01 4.415541067866E-09-2.118205607766E-02
-1.803040504456E-06 1.371596322861E-02 9.998679161072E-06 5.153772060394E+03
7.200000000000E+04-1.657754182816E-07 6.517049035651E-01 1.285225152969E-07
9.622823971644E-01 1.917187500000E+02-1.838940572193E+00-8.011405135752E-09
4.835915721015E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-8.381903171539E-09 9.400000000000E+01
6.481800000000E+04 4.000000000000E+00
G25 2023 01 08 18 00 00 4.095206968486E-04 3.410605131648E-12 0.000000000000E+00
8.100000000000E+01-7.750000000000E+00 4.738411659579E-09 1.775618661987E+00
-5.718320608139E-07 1.108056842349E-02 8.532777428627E-06 5.153561996460E+03
6.480000000000E+04-2.421438694000E-07 2.653360497972E+00-1.862645149231E-07
9.544903307878E-01 2.126250000000E+02 1.014524098544E+00-7.978189466472E-09
-5.828814222080E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 5.587935447693E-09 8.100000000000E+01
5.761800000000E+04 4.000000000000E+00
G26 2023 01 08 20 00 00 2.399771474302E-04 6.821210263297E-13 0.000000000000E+00
2.500000000000E+01-1.434375000000E+01 5.312006980698E-09 2.030777275556E+00
-6.705522537231E-07 7.743391557597E-03 8.001923561096E-06 5.153616672516E+03
7.200000000000E+04-1.844018697739E-07 2.600249366823E+00 5.587935447693E-08
9.352284878147E-01 2.144375000000E+02 4.292807512092E-01-8.245343451651E-09
-5.610948004220E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 6.984919309616E-09 2.500000000000E+01
6.481800000000E+04 4.000000000000E+00
G27 2023 01 08 20 00 00 1.319670118392E-04-9.663381206337E-12 0.000000000000E+00
5.000000000000E+01 1.005312500000E+02 4.170530862208E-09 2.625583384830E-01
5.435198545456E-06 1.108152372763E-02 8.910894393921E-06 5.153665655136E+03
7.200000000000E+04 7.450580596924E-09-2.575605455551E+00 1.955777406693E-07
9.697387370080E-01 2.102187500000E+02 6.875991200747E-01-7.931758961027E-09
-1.275053111080E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 1.396983861923E-09 5.000000000000E+01
6.481800000000E+04 4.000000000000E+00
G29 2023 01 08 18 00 00-5.792183801532E-04-2.273736754432E-12 0.000000000000E+00
8.800000000000E+01 1.229375000000E+02 3.794800925833E-09-8.294955555223E-01
6.273388862610E-06 2.121797413565E-03 9.246170520782E-06 5.153604839325E+03
6.480000000000E+04-6.519258022308E-08-2.497096760160E+00-1.676380634308E-08
9.784991542117E-01 2.099687500000E+02 2.432915094462E+00-7.666033606785E-09
2.142946405177E-12 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-1.024454832077E-08 8.800000000000E+01
5.986200000000E+04 4.000000000000E+00
G30 2023 01 08 20 00 00-5.337372422218E-04 9.094947017729E-13 0.000000000000E+00
5.400000000000E+01 1.215625000000E+01 5.522015728406E-09-2.724416775603E+00
5.438923835754E-07 6.013748468831E-03 5.358830094337E-06 5.153646984100E+03
7.200000000000E+04-2.048909664154E-08 1.627727880211E+00-1.024454832077E-07
9.350848629065E-01 2.664375000000E+02-2.664397522920E+00-8.330704150124E-09
2.789401904071E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 3.725290298462E-09 5.400000000000E+01
6.715200000000E+04 4.000000000000E+00
G31 2023 01 08 20 00 00-2.057449892163E-04-1.136868377216E-12 0.000000000000E+00
6.200000000000E+01 7.937500000000E+00 5.035924052165E-09 3.113065468701E+00
3.390014171600E-07 1.078395056538E-02 5.679205060005E-06 5.153630708694E+03
7.200000000000E+04-1.229345798492E-07 1.638929035790E+00-1.322478055954E-07
9.540775669888E-01 2.677500000000E+02 4.903104136139E-01-7.968903365383E-09
2.428672592533E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-1.350417733192E-08 6.200000000000E+01
6.481800000000E+04 4.000000000000E+00
G32 2023 01 08 18 00 00-3.574439324439E-04-1.250555214938E-11 0.000000000000E+00
2.800000000000E+01-4.187500000000E+01 4.419112645208E-09-8.968024589650E-02
-2.168118953705E-06 6.420318037271E-03 1.017190515995E-05 5.153697257996E+03
6.480000000000E+04-3.725290298462E-09 5.603148897185E-01 8.568167686462E-08
9.592914655400E-01 1.851250000000E+02-2.281100857098E+00-7.891042979328E-09
4.243033882249E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00 4.656612873077E-10 2.800000000000E+01
5.761800000000E+04 4.000000000000E+00
G14 2023 01 08 20 00 00-5.324603989720E-05 7.389644451905E-12 0.000000000000E+00
5.300000000000E+01-3.125000000000E+00 4.795199739317E-09 2.945500358107E+00
-1.136213541031E-07 2.535751904361E-03 8.491799235344E-06 5.153660301208E+03
7.200000000000E+04-4.656612873077E-08 2.697500781392E+00 1.117587089539E-08
9.502735381815E-01 2.111250000000E+02-3.073293467443E+00-7.950688320939E-09
-5.257361847366E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-7.916241884232E-09 5.650000000000E+02
6.961800000000E+04 4.000000000000E+00
G20 2023 01 08 19 59 44 4.583089612424E-04-2.387423592154E-12 0.000000000000E+00
9.000000000000E+00-1.158750000000E+02 4.831986985939E-09-1.041009124403E+00
-5.982816219330E-06 4.591815290041E-03 3.127381205559E-06 5.153726354599E+03
7.198400000000E+04 6.332993507385E-08-6.422050236970E-01-7.264316082001E-08
9.466461830647E-01 3.110937500000E+02-2.957719442807E+00-8.407135905242E-09
-1.739358165535E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-8.381903171539E-09 9.000000000000E+00
7.029600000000E+04 4.000000000000E+00
G05 2023 01 08 20 00 00-1.112320460379E-04-1.477928890381E-12 0.000000000000E+00
7.400000000000E+01-1.256562500000E+02 4.352681306648E-09 5.729200048521E-01
-6.390735507011E-06 5.806059460156E-03 4.827976226807E-06 5.153597463608E+03
7.200000000000E+04-1.098960638046E-07-5.222455788132E-01 1.303851604462E-08
9.642761891967E-01 2.900937500000E+02 1.135858622054E+00-8.203555996750E-09
-2.546534644818E-10 1.000000000000E+00 2.244000000000E+03 0.000000000000E+00
2.000000000000E+00 0.000000000000E+00-1.117587089539E-08 7.400000000000E+01
7.167600000000E+04 4.000000000000E+00
Here's what the contents look like when I pass the url to gunzip() and open the file with Notepad:
<!DOCTYPE html>
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--><html lang="en" class="no-js"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Earthdata Login</title>
<meta name="description" content="Earthdata Login">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push(
{'gtm.start': new Date().getTime(),event:'gtm.js'}
);var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WNP7MLF');</script>
<!-- End Google Tag Manager -->
<link href="https://cdn.earthdata.nasa.gov/eui/1.1.3/stylesheets/application.css" rel="stylesheet" />
<link rel="stylesheet" media="all" href="/assets/application-432b3917d4a41042c0fd963eba859548ef2993f5ed7a0dca4bdb446fdf807556.css" />
<!--[if IE 7]>
<link rel="stylesheet" href="/assets/font-awesome-ie7.min.css">
<![endif]-->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,700' rel='stylesheet' type='text/css'>
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="cXkD8SIkCpqYRK6xX5JU8NOoVxrxMF6h3wI6nr45iHCkgHgXdoUdq/z2vMqazXZ6XbN1cCXbGIFtwLddd6UG4w==" />
<!-- Grid background: http://subtlepatterns.com/graphy/ -->
</head>
<body class="oauth authorize" data-turbolinks-eval=false>
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WNP7MLF"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
<header id="earthdata-tophat2" style="height: 32px;"></header>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<div class="container">
<header role="banner">
<div id="masthead-logo">
<h1><a class="ir" href="/">Earthdata Login</a></h1>
<span class="eui-badge badge daac">Earthdata Login</span>
</div>
<a id="hamburger" href="#"><img title="Mobile Menu" alt="Three horizontal lines stacked" src="/assets/hamburger-68c8505066427f3e3f6ee40b24cfd3c9f7c0fe93ee298b9046564637262115fa.png" /></a>
<nav role="navigation" class="masthead">
<div id="hide">
<ul>
<li><strong><a href="/documentation">Documentation</a></strong></li>
</ul>
</div>
</nav>
</header>
<section id="callout-login">
<div class="client-login">
<img class="client-image" border="1" src="/app_image_image/897511" />
<br>
<h3 class="client-description">
</h3>
</div>
<form id="login" action="/login" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" autocomplete="off" /><input type="hidden" name="authenticity_token" value="CiMFoqrYYxPKr947gp5pH/GckoP8p4NsgxjobMXyofDf2n5E/nl0Iq4dzEBHwUuVf4ew6ShMxUwx2mWvDG4vYw==" autocomplete="off" />
<p><label for="username">Username</label><i class="fa fa-question-circle fa-question-circle--blue user-name" title="Login using either your Username or Email Address"></i><input type="text" name="username" id="username" autofocus="autofocus" class="default" /></p>
<p><label for="password">Password</label><br /><input type="password" name="password" id="password" /></p>
<p><input type="hidden" name="client_id" id="client_id" value="gDQnv1IO0j9O2xXdwS8KMQ" autocomplete="off" /></p>
<p><input type="hidden" name="redirect_uri" id="redirect_uri" value="https://cddis.nasa.gov/proxyauth" autocomplete="off" /></p> <p><input type="hidden" name="response_type" id="response_type" value="code" autocomplete="off" /></p>
<p><input type="hidden" name="state" id="state" value="aHR0cDovL2NkZGlzLm5hc2EuZ292L2FyY2hpdmUvZ25zcy9kYXRhL2hvdXJseS8yMDIzLzAwOC8xOS9BTUM0MDBVU0FfUl8yMDIzMDA4MTkwMF8wMUhfR04ucm54Lmd6" autocomplete="off" /></p>
<p><input type="checkbox" name="stay_in" id="stay_in" value="1" checked="checked" /> <label for="stay_in">Stay signed in (this is a private workstation)</label></p>
<p class="button-with-notes">
<input type="submit" name="commit" value="Log in" class="eui-btn--round eui-btn--green" data-disable-with="Log in" />
<a class="eui-btn--round eui-btn--blue" href="/users/new?client_id=gDQnv1IO0j9O2xXdwS8KMQ&amp;redirect_uri=https%3A%2F%2Fcddis.nasa.gov%2Fproxyauth&amp;response_type=code&amp;state=aHR0cDovL2NkZGlzLm5hc2EuZ292L2FyY2hpdmUvZ25zcy9kYXRhL2hvdXJseS8yMDIzLzAwOC8xOS9BTUM0MDBVU0FfUl8yMDIzMDA4MTkwMF8wMUhfR04ucm54Lmd6">Register</a>
</p>
<p class="form-instructions">
<em class="icon-question-sign"></em>
<a class="" href="/retrieve_info">I don&rsquo;t remember my username</a>
<br /><em class="icon-question-sign"></em>
<a class="" href="/reset_passwords/new">I don&rsquo;t remember my password</a>
<br />
<em class="icon-question-sign"></em>
<a href="javascript:feedback.showForm();" title = 'Need Help? Click on the Feedback button to request help'>Help</a>
</p>
</form>
<aside class="govt-msg">
<div class="nasa-logo"></div>
<p><strong>Why must I register?</strong></p>
<p>
The Earthdata Login provides a single mechanism for user registration and profile management for all EOSDIS system components (DAACs, Tools, Services).
Your Earthdata login also helps the EOSDIS program better understand the usage of EOSDIS services to improve user experience through customization of tools and improvement of services.
EOSDIS data are openly available to all and free of charge except where governed by international agreements.
</p>
</aside>
</section>
<section id="cta">
<h3>Get single sign-on access to all your favorite EOSDIS sites</h3>
<a class="eui-btn--round eui-btn--blue" href="/users/new?client_id=gDQnv1IO0j9O2xXdwS8KMQ&amp;redirect_uri=https%3A%2F%2Fcddis.nasa.gov%2Fproxyauth&amp;response_type=code&amp;state=aHR0cDovL2NkZGlzLm5hc2EuZ292L2FyY2hpdmUvZ25zcy9kYXRhL2hvdXJseS8yMDIzLzAwOC8xOS9BTUM0MDBVU0FfUl8yMDIzMDA4MTkwMF8wMUhfR04ucm54Lmd6">Register for a Profile</a>
</section>
<div class="govt-warning eui-info-box">
<div class="warning-desktop">
<p><strong>By accessing and using this information system, you acknowledge and consent to the following:</strong></p>
You are accessing a U.S. Government information system, which includes:
(1) this computer;
(2) this computer network;
(3) all computers connected to this network including end user systems;
(4) all devices and storage media attached to this network or to any computer on this network; and
(5) cloud and remote information services. This information system is provided for U.S. Government-authorized use only.
You have no reasonable expectation of privacy regarding any communication transmitted through or data stored on this
information system. At any time, and for any lawful purpose, the U.S. Government may monitor, intercept, search, and
seize any communication or data transiting, stored on, or traveling to or from this information system. You are
NOT authorized to process classified information on this information system. Unauthorized or improper use of this
system may result in suspension or loss of access privileges, disciplinary action, and civil and/or criminal penalties.
</div>
<div class="warning-mobile">
<p><strong>By accessing and using this information system, you acknowledge and consent to the following:</strong></p>
You are accessing a U.S. Government information system, which includes:
(1) this computer;
(2) this computer network;
(3) all computers connected to this network including end user systems;
(4) all devices and storage media attached to this network or to any computer on this network; and
(5) cloud and remote information services. This information system is provided for U.S. Government-authorized use only.
Unauthorized or improper use of this system may result in suspension or loss of access privileges, disciplinary action,
and civil and/or criminal penalties. By using this information system, you acknowledge and consent to the terms
and conditions established in NASA policy and regulatory guidance for NASA IT Systems.
</div>
<div class="warning-mobile-mini">
<strong>
US Govt Property. Unauthorized use subject to prosecution. Use subject to monitoring per
<a href="https://nodis3.gsfc.nasa.gov/displayDir.cfm?t=NPD&c=2810&s=1E">NPD2810</a>.
</strong>
</div>
</div>
</div>
<footer role="contentinfo">
<h3>For questions regarding the EOSDIS Earthdata Login, please contact <a href="javascript:feedback.showForm();" title="Earthdata Support form">Earthdata Support</a></h3>
<ul>
<li class="version badge eui-badge--md">V URSFOUR-1901
</li>
<li><a href="/">Home</a></li>
<li><a href="/users/new">Register</a></li>
<li><a title="NASA Home" href="http://www.nasa.gov">NASA</a></li>
</ul>
<p>NASA Official: Stephen Berrick</p>
</footer>
<script src="/assets/application-15d4faf28e91715dccccf34f3e808b7a348298fb623e29d09281b30cc1f87492.js"></script>
<script type="text/javascript">
$(window).scroll(function(e){
parallax();
});
function parallax(){
var scrolled = $(window).scrollTop();
$('#content').css('background-position', 'right ' + -(scrolled*0.25)+'px ');
}
</script>
<script src="https://cdn.earthdata.nasa.gov/tophat2/tophat2.js" id="earthdata-tophat-script" data-show-fbm="true" data-show-status="true" data-status-api-url="https://status.earthdata.nasa.gov/api/v1/notifications"></script>
<script type="text/javascript" src="https://fbm.earthdata.nasa.gov/for/URS4/feedback.js"></script>
<script type="text/javascript">
feedback.init();
</script>
<script type="text/javascript">
setTimeout(function()
{var a=document.createElement("script"); var b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0013/2090.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}
, 1);
</script>
<!-- BEGIN: DAP Google Analytics -->
<script language="javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=NASA&subagency=GSFC&dclink=true"></script>
<!-- END: DAP Google Analytics -->
</body>
</html>
I know the url variable in my code is correct because I can copy the string, paste it in a web browser, and it will prompt me to select a download folder. Applying the gunzip() function on this correctly unzips the file.
Also, if you go to the website by removing the filename from the url, it will ask for credentials. However, it is really public access because anyone can create an account.

Answers (1)

Rik
Rik on 9 Jan 2023
The file itself is not publicly available without a login, and that is what matters. Using websave will not help, nor will using the Wayback Machine as an intermediary.
You will have to find a way to transmit your credentials along with the URL and hope this website allows that syntax and doesn't rely on cookies. See the documentation for websave for the syntax of adding username and password.

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!