0
$\begingroup$

I would like to be able to import/read a file into Mathematica from an ftp server that requires explicit TSL security with anonymous connection.

Import["ftp://gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all"] 

In other words, I want to connect to server gdc.cddis.eosdis.nasa.gov, and download, for example, /pub/products/iers/finals2000A.all.

or under https:

Import["https://cddis.nasa.gov/archive/products/iers/finals2000A.all"]

Help on this is provided here: https://cddis.nasa.gov/Data_and_Derived_Products/CDDIS_Archive_Access.html, but unfortunately there is nothing specific for Mathematica.

I can't get it to work with Mathematica (Import/URLRead/Authentication ...). Could anyone give me an idea on how to do it?

$\endgroup$
7
  • $\begingroup$ Why not use curl or wget to download the file and then Import? If you can get either to work then you can call them from WL and Import. $\endgroup$ Dec 18, 2020 at 18:02
  • $\begingroup$ The link you provided has instructions for curl and wget using either https or ftp-ssl. I don't have an Earthdata account so I cannot test them. curl and wget are command line tools. $\endgroup$ Dec 18, 2020 at 18:18
  • $\begingroup$ I was able to download the file without any problems using your Import["ftp://gdc.cddis.eosdis.nasa.gov/pub/products/iers/finals2000A.all"] verbatim. The result was a string of StringLength 3372719. Adding the option "Table" to the Import gave me a list of 17940 sublists. The first sublist was {73, 1, 2, 41684., "I", 0.120733, 0.009786, 0.136966, 0.015902, "I", 0.808418, 0.000271, 0., 0.1916, "P", -0.766, 0.199, -0.72, 0.3, 0.143, 0.137, 0.8075, -18.637, -3.667}, I did not visit the website itself and do not have any account or credentials that I know of. MMA 12.1.0 for Linux. $\endgroup$
    – LouisB
    Dec 18, 2020 at 19:26
  • $\begingroup$ @LouisB Do you have an account to that database, and were you signed in to it? It did not work for me (FetchURL: the connection cannot be opened for ftp; a login page for https). $\endgroup$
    – MarcoB
    Dec 18, 2020 at 19:33
  • $\begingroup$ @MarcoB I do not have an account for the database. I was able to get the "FetchURL: ..." error message using MMA 11.3.0 for Microsoft Windows 10. When I tried to access the FTP server via the Windows FTP command, the server gave me "530 Anonymous sessions must use encryption". I tried curl and wget on my Linux box and both of those got "530 ..." from the server. $\endgroup$
    – LouisB
    Dec 18, 2020 at 20:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.