Page 1 of 1

Error authenticating to NASA EarthData for downloading ancillary data. (Sentinel-2)

Posted: Thu Jan 11, 2024 12:50 pm
by kolleandro
Hello, I am trying to run an atmospheric correction on a Sentinel-2 product based on example.py provided by polymer-4.16.1.

When I try,

Code: Select all

run_atm_corr(
            Level1_MSI('/content/drive/MyDrive/Imagem L1C/S2B_MSIL1C_20231202T131239_N0509_R138_T23KKQ_20231202T134142.SAFE/GRANULE/L1C_T23KKQ_A035199_20231202T131238',
                       resolution='60' 
                       ),
            Level2_NETCDF('/content')  
            )
It raises the error:

Code: Select all

Initialize MSI projection EPSG:32723
/usr/local/lib/python3.10/dist-packages/pyproj/crs/crs.py:141: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  in_crs_string = _prepare_from_proj_string(in_crs_string)
Trying to download https://oceandata.sci.gsfc.nasa.gov/cgi/getfile/GMAO_FP.20231202T120000.MET.NRT.nc ... 

AssertionError: Error authenticating to NASA EarthData for downloading ancillary data. Please provide authentication through .netrc. See more information on https://support.earthdata.nasa.gov/index.php?/Knowledgebase/Article/View/43/21/how-to-access-urs-gated-data-with-curl-and-wget

The support link provided is not working currently. Is there any way to solve this? Where in the code can I provide the .netrc file with authentication?

(If I click on "Trying to download https://oceandata.sci.gsfc.nasa.gov/cgi ... MET.NRT.nc ... " the file is downloaded.)

Thank you very much.

Re: Error authenticating to NASA EarthData for downloading ancillary data. (Sentinel-2)

Posted: Thu Jan 18, 2024 2:27 pm
by fsteinmetz
Hello,
An update regarding ancillary data access is now available on the latest version of Polymer, now available on github.
https://github.com/hygeos/polymer
Please also check section 2.2.1 of the readme for setting up the .netrc file.