Errors accessing HLS data

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
griegodc
Posts: 1
Joined: Thu Feb 15, 2024 6:42 pm America/New_York
Answers: 0

Errors accessing HLS data

by griegodc » Thu Feb 15, 2024 6:54 pm America/New_York

Hello, I am currently trying to access HLS data for a watershed boundary to make a cloudmask in python and am getting file not supported for the .tif files returned by the earthacess.search function. This is for a class and multiple students are having the same issue. The professor has old code that is successfully running but the environment she is using seems to have slight differences in versions and modules, so it appears this may be an issue with package versions. Would just like some feedback on what possibly might be wrong

This is the login codeblock:
eta.login(persist=True)

results = eta.search_data(
short_name="HLSL30",
cloud_hosted=True,
bounding_box=tuple(watershed.total_bounds),
temporal=("2023-05-01", "2023-10-01"),
)


This is the codeblock used to retrieve the url:
processed_data = {}

# Open the Fmask band and compute the quality mask
fmask_da = rioxarray.open_rasterio(granule_info['fmask_path'])
bits = np.unpackbits(fmask_da.astype(np.uint8)).reshape(fmask_da.shape + (-1,))
mask = np.prod(bits[..., mask_bits] == 0, axis=-1)



This is the error
{
"name": "RasterioIOError",
"message": "'/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T15RYN.2023124T163132.v2.0/HLS.L30.T15RYN.2023124T163132.v2.0.Fmask.tif' not recognized as a supported file format.",
"stack": "---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\xarray\\backends\\file_manager.py:211, in CachingFileManager._acquire_with_cache_info(self, needs_lock)
210 try:
--> 211 file = self._cache[self._key]
212 except KeyError:

File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\xarray\\backends\\lru_cache.py:56, in LRUCache.__getitem__(self, key)
55 with self._lock:
---> 56 value = self._cache[key]
57 self._cache.move_to_end(key)

KeyError: [<function open at 0x000001D4523AF910>, ('https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T15RYN.2023124T163132.v2.0/HLS.L30.T15RYN.2023124T163132.v2.0.Fmask.tif',), 'r', (('sharing', False),), 'd323ca66-cd72-462d-a349-cb24cecda6b5']

During handling of the above exception, another exception occurred:

CPLE_OpenFailedError Traceback (most recent call last)
File rasterio\\\\_base.pyx:310, in rasterio._base.DatasetBase.__init__()

File rasterio\\\\_base.pyx:221, in rasterio._base.open_dataset()

File rasterio\\\\_err.pyx:221, in rasterio._err.exc_wrap_pointer()

CPLE_OpenFailedError: '/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T15RYN.2023124T163132.v2.0/HLS.L30.T15RYN.2023124T163132.v2.0.Fmask.tif' not recognized as a supported file format.

During handling of the above exception, another exception occurred:

RasterioIOError Traceback (most recent call last)
Cell In[8], line 64
58 granule_info = {
59 'fmask_path': fmask_path,
60 'bands': band_paths
61 }
63 # Process the granule
---> 64 processed_data = process_granule(granule_info, mask_bits, scale_factor)
65 # ... (rest of your processing code)
66
67
68 # Example: Print the processed data for the first granule to check
69 if granule_id == group.iloc[0]['granule_id']:

Cell In[8], line 26, in process_granule(granule_info, mask_bits, scale_factor)
23 processed_data = {}
25 # Open the Fmask band and compute the quality mask
---> 26 fmask_da = rioxarray.open_rasterio(granule_info['fmask_path'])
27 bits = np.unpackbits(fmask_da.astype(np.uint8)).reshape(fmask_da.shape + (-1,))
28 mask = np.prod(bits[..., mask_bits] == 0, axis=-1)

File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\rioxarray\\_io.py:1124, in open_rasterio(filename, parse_coordinates, chunks, cache, lock, masked, mask_and_scale, variable, group, default_name, decode_times, decode_timedelta, band_as_variable, **open_kwargs)
1122 else:
1123 manager = URIManager(file_opener, filename, mode=\"r\", kwargs=open_kwargs)
-> 1124 riods = manager.acquire()
1125 captured_warnings = rio_warnings.copy()
1127 # raise the NotGeoreferencedWarning if applicable

File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\xarray\\backends\\file_manager.py:193, in CachingFileManager.acquire(self, needs_lock)
178 def acquire(self, needs_lock=True):
179 \"\"\"Acquire a file object from the manager.
180
181 A new file is only opened if it has expired from the
(...)
191 An open file object, as returned by ``opener(*args, **kwargs)``.
192 \"\"\"
--> 193 file, _ = self._acquire_with_cache_info(needs_lock)
194 return file

File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\xarray\\backends\\file_manager.py:217, in CachingFileManager._acquire_with_cache_info(self, needs_lock)
215 kwargs = kwargs.copy()
216 kwargs[\"mode\"] = self._mode
--> 217 file = self._opener(*self._args, **kwargs)
218 if self._mode == \"w\":
219 # ensure file doesn't get overridden when opened again
220 self._mode = \"a\"

File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\rasterio\\env.py:451, in ensure_env_with_credentials.<locals>.wrapper(*args, **kwds)
448 session = DummySession()
450 with env_ctor(session=session):
--> 451 return f(*args, **kwds)

File c:\\Users\\Degg\\miniconda3\\envs\\earth-analytics-python\\lib\\site-packages\\rasterio\\__init__.py:304, in open(fp, mode, driver, width, height, count, crs, transform, dtype, nodata, sharing, **kwargs)
301 path = _parse_path(raw_dataset_path)
303 if mode == \"r\":
--> 304 dataset = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
305 elif mode == \"r+\":
306 dataset = get_writer_for_path(path, driver=driver)(
307 path, mode, driver=driver, sharing=sharing, **kwargs
308 )

File rasterio\\\\_base.pyx:312, in rasterio._base.DatasetBase.__init__()

RasterioIOError: '/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T15RYN.2023124T163132.v2.0/HLS.L30.T15RYN.2023124T163132.v2.0.Fmask.tif' not recognized as a supported file format."
}

Tags:

LP DAAC - dgolon
User Services
User Services
Posts: 296
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 18 times
Been thanked: 2 times
Contact:

Re: Errors accessing HLS data

by LP DAAC - dgolon » Fri Feb 16, 2024 11:45 am America/New_York

Hello @griegodc Thanks for writing in! One thing we noticed missing is the gdal configuration options.

Code: Select all

# Required GDAL Options
gdal.SetConfigOption('GDAL_HTTP_COOKIEFILE','~/cookies.txt')
gdal.SetConfigOption('GDAL_HTTP_COOKIEJAR', '~/cookies.txt')
gdal.SetConfigOption('GDAL_DISABLE_READDIR_ON_OPEN','EMPTY_DIR')
gdal.SetConfigOption('CPL_VSIL_CURL_ALLOWED_EXTENSIONS','TIF')
gdal.SetConfigOption('GDAL_HTTP_UNSAFESSL', 'YES')

Typically you will see that error without them because the code is not passing the authentication information from earthaccess. You mentioned your professor is using an older code that still works for them but not for you, we have recently updated our HLS tutorial. The most recent versions of HLS examples can always be found here: https://github.com/nasa/HLS-Data-Resources. For your use case I think you would be most interested in starting with https://github.com/nasa/HLS-Data-Resources/blob/main/python/tutorials/HLS_Tutorial.ipynb. Also, sometimes connection issue can cause that error. We recommend adding a try loop, like in the tutorial. If you are still having issues after using the updated code, please reply to this thread. Thanks - Danielle
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

kongstad_dk
Posts: 7
Joined: Wed Dec 27, 2023 3:47 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by kongstad_dk » Tue Mar 19, 2024 9:48 am America/New_York

Hi,

I am struggling with some similar issues here and I am not sure what to do about it. Essentially I have a class that uses earthaccess and a set of gdal commands, then proceeds to obtain information about the granules. I can access the information from a search query and get a URL to a geotif file for download. But the vsicurl continous fails despite trying all of your above answers. I was hoping you could take a look at my code.

I have a .netrc file with a server address and my login details in my Google Cloud Virtual Machine home folder (Linux). I am running VS code on a windows laptop that then SSH's into the GC VM.

Here are parts and snippets of my code. The entire thing is long and contains some IP, so I cannot supply the whole thing:

class HLSNASA(xxxxx):

def __init__(self):
self.configure_gdal()
self.earth_access()
#earthaccess.login(persist=True)

@staticmethod
def earth_access():
earthaccess.login(persist=True)

@staticmethod
def configure_gdal():

# Set GDAL configuration options for HTTP handling and file extensions
#gdal.SetConfigOption("GDAL_HTTP_COOKIEFILE", "../cookies.txt") # I have tried this being commented in and out
#gdal.SetConfigOption("GDAL_HTTP_COOKIEJAR", "../cookies.txt")
gdal.SetConfigOption("GDAL_DISABLE_READDIR_ON_OPEN", "EMPTY_DIR")
gdal.SetConfigOption("CPL_VSIL_CURL_ALLOWED_EXTENSIONS", "TIF")
gdal.SetConfigOption("GDAL_HTTP_UNSAFESSL", "YES")
gdal.SetConfigOption('CPL_DEBUG', 'ON')
gdal.SetConfigOption('CPL_CURL_VERBOSE', 'ON')

[cut out part of the code: Here I basically create meta data based on file url, reformatting bounding box coordinate format etc]

hls_out = earthaccess.search_data(
short_name=["HLSL30", "HLSS30"],
bounding_box=bbox_coords,
temporal=(start_temporal, end_temporal),
count=count,
cloud_cover=cloud_cover_range,
)

[cut out code that parses this output]

which brings and output like this when I call the class and function in a jupyter notebook

Granules found: 1
2024-03-19T13:25:15-INFO-xxxxxx:iter_items:593 Found 1 items matching the search query.

and i can iterate over it and get feedback like this:

for item in item_iterator:
print(item)
break

https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.VZA.tif

Now this link I can open in my browser on my windows laptop and it immediatedly downloads the geotiff file.

But when I try to run this code in GC VM to iterate over the images I want to download (or in this case 1 as the search only returned 1):

def iter_images(
self,
start_date: str,
end_date: str,
geometry: BaseGeometry,
bands: list,
count: int = 500,
min_cloud: float = 0,
cloud_cover: float = 25,
access_type: str = "external",
clip_method: str = "window",
pixels: int = 1024,
sort: bool = True,
):
links = self.iter_items(
start_date=start_date,
end_date=end_date,
geometry=geometry,
count=count,
min_cloud=min_cloud,
cloud_cover=cloud_cover,
access_type=access_type,
sort=sort,
)

# Convert links to items with metadata
items_with_metadata = [(link, self._parse_granule_url(link)) for link in links]

# Filter for specified bands
filtered_items = [
item for item in items_with_metadata if item[1] and item[1]["band"] in bands
]

# Use concurrent futures to read and process images in parallel
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [
executor.submit(self._process_image, item, geometry, clip_method, pixels)
for item in filtered_items
]

# Wait for all futures to complete and retrieve results
results = [future.result() for future in concurrent.futures.as_completed(futures)]

# Return an iterator over the results
return iter(results)

def _process_image(self, item_metadata, geometry, clip_method, pixels):
url, metadata = item_metadata
max_retries = 3
retry_delay = 5 # seconds to wait between retries

for attempt in range(max_retries):
try:
with rasterio.open(url) as src:
if clip_method:
clipper = ImageClipper.create_clipper(method=clip_method, pixels=pixels)
data, _, transform = clipper.clip_dataset(src=src, geometry=geometry)
else:
data = src.read()
transform = src.transform

# Successfully read the data, so break out of the retry loop
return data, transform, src.profile
except rasterio.errors.RasterioIOError as e:
print(f"Attempt {attempt+1}/{max_retries} failed with error: {e}. Retrying...")
time.sleep(retry_delay)
except Exception as e:
print(f"An unexpected error occurred: {e}. Aborting...")
break
else:
print(f"Failed to process {url} after {max_retries} retries. Check authentication.")
return None

I get this onslaught of errors
Granules found: 1
2024-03-19T13:25:18-INFO-skylens.stac_client:iter_items:593 Found 1 items matching the search query.
2024-03-19T13:25:25-INFO-rasterio._env:open:304 GDAL signalled an error: err_no=4, msg="`/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B04.tif' not recognized as a supported file format."
Attempt 1/3 failed with error: '/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B04.tif' not recognized as a supported file format.. Retrying...
2024-03-19T13:25:25-INFO-rasterio._env:open:304 GDAL signalled an error: err_no=4, msg="`/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif' not recognized as a supported file format."
2024-03-19T13:25:25-INFO-rasterio._env:open:304 GDAL signalled an error: err_no=4, msg="`/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B02.tif' not recognized as a supported file format."
Attempt 1/3 failed with error: '/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif' not recognized as a supported file format.. Retrying...
Attempt 1/3 failed with error: '/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B02.tif' not recognized as a supported file format.. Retrying...

So I figured I'd try something a little more basic, so I opened a terminal, loaded in my environment that has gdal 3.7.3 and entered the followed command with debug on:

gdalinfo --config CPL_VSIL_CURL_ALLOWED_EXTENSIONS ".tif" --config CPL_DEBUG "ON" /vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif
HTTP: libcurl/8.5.0 OpenSSL/3.2.1 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
HTTP: Using HTTP/2 for HTTPS when possible
VSICURL: Effective URL: https://d1nklfio7vscoe.cloudfront.net/head-2d2df3a34830d5223d1e9547cd713408/lp-prod-protected.s3.us-west-2.amazonaws.com/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif?Expires=1710858430&Signature=retRYPRFfuYR8YfaaDSXemEVUovyyXjmXGY4D0K0~9dBSwkkqE7Qnm~OgvD0WbqyKCdqACARmCLRITYv~~-SVGBH9xZDcxdFcWG8kMkWgXru4IBvvyJMnx2k7SBVNN3egRmAcfUpaOEaC0jvYiLHYd9yGT3NeNx4tNIwNSIIhFMk0uMSlVl0929BmtTw4PzYmzWcpqa2WHcMOld4mJAcpgLnqd-wigx5D5rIDNWvDEtI6EGrMU65IztahZ45NXWZ7GCjM15wRn2mJFmb3Ul1-maHdDUUV2IjppmHIMbH17d2GbGw7VpDut9FEe3wsa7q~HO67WU6VZfQbq2xrYL8kA__&Key-Pair-Id=K3SSHANJGSH7G9
VSICURL: Will use redirect URL for the next 3598 seconds
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif)=24650960 response_code=200
VSICURL: Using redirect URL as it looks to be still valid (3598 seconds left)
VSICURL: Downloading 0-16383 (https://d1nklfio7vscoe.cloudfront.net/head-2d2df3a34830d5223d1e9547cd713408/lp-prod-protected.s3.us-west-2.amazonaws.com/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif?Expires=1710858430&Signature=retRYPRFfuYR8YfaaDSXemEVUovyyXjmXGY4D0K0~9dBSwkkqE7Qnm~OgvD0WbqyKCdqACARmCLRITYv~~-SVGBH9xZDcxdFcWG8kMkWgXru4IBvvyJMnx2k7SBVNN3egRmAcfUpaOEaC0jvYiLHYd9yGT3NeNx4tNIwNSIIhFMk0uMSlVl0929BmtTw4PzYmzWcpqa2WHcMOld4mJAcpgLnqd-wigx5D5rIDNWvDEtI6EGrMU65IztahZ45NXWZ7GCjM15wRn2mJFmb3Ul1-maHdDUUV2IjppmHIMbH17d2GbGw7VpDut9FEe3wsa7q~HO67WU6VZfQbq2xrYL8kA__&Key-Pair-Id=K3SSHANJGSH7G9)...
VSICURL: Got response_code=403
VSICURL: Got an error with redirect URL. Retrying with original one
VSICURL: Downloading 0-16383 (https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif)...
VSICURL: DownloadRegion(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif): response_code=302, msg=Maximum (10) redirects followed
VSICURL: Got response_code=302
VSICURL: Effective URL: https://urs.earthdata.nasa.gov/oauth/authorize?client_id=FtSFfbOeuxDcdf4px-elGw&response_type=code&redirect_uri=https://data.lpdaac.earthdatacloud.nasa.gov/login&state=%2Flp-prod-protected%2FHLSS30.020%2FHLS.S30.T30UXD.2022026T111331.v2.0%2FHLS.S30.T30UXD.2022026T111331.v2.0.B03.tif&app_type=401
VSICURL: GetFileList(/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0)
ERROR 4: `/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif' not recognized as a supported file format.
gdalinfo failed - unable to open '/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif'.

It seems to me it is an authorisation problem where GDAL is lacking the access to retrieve the images on my GC VM. The fact that I can click the link and download it without logging in is probably because its on my windows laptop. So my Google Cloud VM seems unable to grant GDAL the required permissions, despite the .netrc being in the home directory of my GC VM.
I understand I can define the access manually by defining the cookies.txt file. But I cannot find any information of what that file should specifically contain. I tried copy pasting the .netrc file content (1. server, 2. user, 3. pass) into a cookies.txt file and specifically hard linked its path to the GDAL_HTTP_COOKIEFILE and JAR. But that did not work either.

So I am at my wits end here. Any help is much appreciated

matthew_cox_omnia
Posts: 8
Joined: Thu Sep 21, 2023 4:40 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by matthew_cox_omnia » Thu Mar 21, 2024 10:19 am America/New_York

I hear you - GDAL authentication errors are a real pain to debug. Since you can download the file manually, it would be good to check if your VM is properly set up with the required credentials. Please ssh into your VM and execute the following command:

`gdalinfo /vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif --debug ON --config GDAL_HTTP_COOKIEFILE ./cookies.txt --config GDAL_HTTP_COOKIEJAR ./cookies.txt`

If this command fails, the issue likely lies with authentication on the VM, possibly related to your `.netrc` file setup. The debug output should provide more insight into what's going wrong. If the command succeeds, then the issue might be with how your script interacts with the VM's environment.

kongstad_dk
Posts: 7
Joined: Wed Dec 27, 2023 3:47 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by kongstad_dk » Thu Mar 21, 2024 10:34 am America/New_York

Thank you for the reply!

I will try it out as soon as I get near my workstation. Just one quick question though, do I need to already have a cookie.txt file, or is it auto generated based on the .netrc content? If not and I have to create it myself, then what would the file look like? Is it a complete copy of .netrc, i.e. server, login and password on three lines?

matthew_cox_omnia
Posts: 8
Joined: Thu Sep 21, 2023 4:40 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by matthew_cox_omnia » Thu Mar 21, 2024 11:35 am America/New_York

Good question. No need to create a cookies.txt file - it just needs to be a path that GDAL can write to and it will create the file for you.

kongstad_dk
Posts: 7
Joined: Wed Dec 27, 2023 3:47 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by kongstad_dk » Fri Mar 22, 2024 5:19 am America/New_York

Well that certainly did something.

gdalinfo /vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.202 2026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif --debug ON --config GDAL_HTTP_COOKIEFILE ./cookies.txt --config GDAL_HTTP_COOKIEJAR ./cookies.txt
HTTP: libcurl/8.5.0 OpenSSL/3.2.1 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
HTTP: Using HTTP/2 for HTTPS when possible
VSICURL: Effective URL: https://d1nklfio7vscoe.cloudfront.net/head-2d2df3a34830d5223d1e9547cd713408/lp-prod-protected.s3.us-west-2.amazonaws.com/HLSS30.020/HLS.S30. T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif?Expires=1711101491&Signature=Y0WUvmYrriHIemWOliCmlpAjLpotR9pcHM2YLfH47rUnj0dDoL20dy8gKsGRuHMic YqCUFWwI4jm~7EtEcclllB3AdXsbsREbwCixDia9ihzRy1XrQ3dHeHeHzoOMp3OHn2DoRxFe9hNi3QGM65E4I4wn9p-afSsk4UhpljXhBlL8n~32qgQjU8t18C6aFQkOrdWJ2Xr0-0qnqz5seMtbY9z7RE3U83yW2nSJ c4YtAp2M5QeXabTQ3jEBPYVxrPIR3~CqdGlW6AttWOHM5f8lZlMvfxTWfrOn76~HgeOeXmLYzlWPVIrAj~ubv-jzxAlt2RuObuu26M9pB7qJUkE9A__&Key-Pair-Id=K3SSHANJGSH7G9
VSICURL: Will use redirect URL for the next 3598 seconds
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif)=24650960 response_code=200
VSICURL: Using redirect URL as it looks to be still valid (3598 seconds left)
VSICURL: Downloading 0-16383 (https://d1nklfio7vscoe.cloudfront.net/head-2d2df3a34830d5223d1e9547cd713408/lp-prod-protected.s3.us-west-2.amazonaws.com/HLSS30.020/HL S.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif?Expires=1711101491&Signature=Y0WUvmYrriHIemWOliCmlpAjLpotR9pcHM2YLfH47rUnj0dDoL20dy8gKsG RuHMicYqCUFWwI4jm~7EtEcclllB3AdXsbsREbwCixDia9ihzRy1XrQ3dHeHeHzoOMp3OHn2DoRxFe9hNi3QGM65E4I4wn9p-afSsk4UhpljXhBlL8n~32qgQjU8t18C6aFQkOrdWJ2Xr0-0qnqz5seMtbY9z7RE3U83 yW2nSJc4YtAp2M5QeXabTQ3jEBPYVxrPIR3~CqdGlW6AttWOHM5f8lZlMvfxTWfrOn76~HgeOeXmLYzlWPVIrAj~ubv-jzxAlt2RuObuu26M9pB7qJUkE9A__&Key-Pair-Id=K3SSHANJGSH7G9)...
VSICURL: Got response_code=403
VSICURL: Got an error with redirect URL. Retrying with original one
VSICURL: Downloading 0-16383 (https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111 331.v2.0.B03.tif)...
VSICURL: Got response_code=206
VSICURL: Effective URL: https://d1nklfio7vscoe.cloudfront.net/s3-2d2df3a34830d5223d1e9547cd713408/lp-prod-protected.s3.us-west-2.amazonaws.com/HLSS30.020/HLS.S30.T3 0UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif?A-userid=kongstad_dk&Expires=1711101495&Signature=OLA2ujCsS~rWWs-X~6V99iaKk1vcpFsITJQqerDEmLxiVZ 5FBrTmF-fmcK~w2F0oaTE0LPz5Fb7LDLSV62wTT2lELJ1aHGgHGOdWtKTxX5PpRp1oB1Go~Hpjx7PieMASbp-WHFa9Ypl~X3C~ga8-BD-~7NeHatQgAO2q5TfXQyNjosv1pXpe2JN4VPBNd4bnsOqqOIsxFJsDxrmrH0 6G4A93s~k9OoLdELK4IVQPNVVwu9mSSua-xJZIzE9Ne3qYUb9kJJVVpzLRLWBs30tyt3wcTgKrSha5ffGv7TaBVBLZzhL7rRXhthEJySMX-Vh9aa6YUM015X4OJ-HBW4-4Dg__&Key-Pair-Id=K3SSHANJGSH7G9
VSICURL: Will use redirect URL for the next 3598 seconds
GDAL: GDALOpen(/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2 .0.B03.tif, this=0x5602deb8fcf0) succeeds as GTiff.
Driver: GTiff/GeoTIFF
VSICURL: GetFileList(/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0)
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.aux.xml)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.aux)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.AUX)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.aux)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.AUX)=0 response_code=404
GDAL: GDALDefaultOverviews::OverviewScan()
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.ovr)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.OVR)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.msk)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.tif.MSK)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.XML)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.xml)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.IMD)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.imd)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.RPB)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.rpb)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.PVL)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.pvl)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_rpc.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_RPC.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_metadata.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_METADATA.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_MTL.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_MTL.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/METADATA.DIM)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/metadata.dim)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_metadata.xml)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03_METADATA.XML)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.RPC)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.rpc)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.pass)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.PASS)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.pass)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.PASS)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.pass)=0 response_co de=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.PASS)=0 response_co de=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.pass) =0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.PASS) =0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.pa ss)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.PA SS)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. pass)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. PASS)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.pass)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0. B03.PASS)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/summary.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/SUMMARY.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HDR0.T30UXD.2022026T111331.v2.0.B03.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HDR0.T30UXD.2022026T111331.v2.0.B03.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HDR.S30.T30UXD.2022026T111331.v2.0.B03.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HDR.S30.T30UXD.2022026T111331.v2.0.B03.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/RPC0.T30UXD.2022026T111331.v2.0.B03.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/RPC0.T30UXD.2022026T111331.v2.0.B03.TXT)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/RPC.S30.T30UXD.2022026T111331.v2.0.B03.txt)=0 response_code=404
VSICURL: GetFileSize(https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/RPC.S30.T30UXD.2022026T111331.v2.0.B03.TXT)=0 response_code=404
Files: /vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif
Size is 3660, 3660
Coordinate System is:
PROJCRS["UTM Zone 30, Northern Hemisphere",
BASEGEOGCRS["Unknown datum based upon the WGS 84 ellipsoid",
DATUM["Not specified (based on WGS 84 spheroid)",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1],
ID["EPSG",7030]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433,
ID["EPSG",9122]]]],
CONVERSION["Transverse Mercator",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",-3,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["easting",east,
ORDER[1],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]],
AXIS["northing",north,
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]]
Data axis to CRS axis mapping: 1,2
Origin = (600000.000000000000000,5900040.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
ACCODE=LaSRC
add_offset=0.0
AREA_OR_POINT=Area
arop_ave_xshift(meters)=0
arop_ave_yshift(meters)=0
arop_ncp=0
arop_rmse(meters)=0
arop_s2_refimg=NONE
cloud_coverage=4
DATASTRIP_ID=S2A_OPER_MSI_L1C_DS_VGS1_20220128T113108_S20220126T111332_N04.00
HLS_PROCESSING_TIME=2022-02-04T18:15:51Z
HORIZONTAL_CS_CODE=EPSG:32630
HORIZONTAL_CS_NAME=WGS84 / UTM zone 30N
L1C_IMAGE_QUALITY=NONE
L1_PROCESSING_TIME=2022-01-28T12:21:36.459794Z
long_name=Green
MEAN_SUN_AZIMUTH_ANGLE=165.404109021274
MEAN_SUN_ZENITH_ANGLE=72.5043332820925
MEAN_VIEW_AZIMUTH_ANGLE=126.995223350377
MEAN_VIEW_ZENITH_ANGLE=3.31858227739848
MSI band 01 bandpass adjustment slope and offset=0.995900, -0.000200
MSI band 02 bandpass adjustment slope and offset=0.977800, -0.004000
MSI band 03 bandpass adjustment slope and offset=1.005300, -0.000900
MSI band 04 bandpass adjustment slope and offset=0.976500, 0.000900
MSI band 11 bandpass adjustment slope and offset=0.998700, -0.001100
MSI band 12 bandpass adjustment slope and offset=1.003000, -0.001200
MSI band 8a bandpass adjustment slope and offset=0.998300, -0.000100
NBAR_SOLAR_ZENITH=72.8997096121134
NCOLS=3660
NROWS=3660
OVR_RESAMPLING_ALG=NEAREST
PROCESSING_BASELINE=04.00
PRODUCT_URI=S2A_MSIL1C_20220126T111331_N0400_R137_T30UXD_20220128T113108.SAFE
scale_factor=0.0001
SENSING_TIME=2022-01-26T11:16:34.303369Z
SPACECRAFT_NAME=Sentinel-2A
spatial_coverage=99
SPATIAL_RESOLUTION=30
TILE_ID=S2A_OPER_MSI_L1C_TL_VGS1_20220128T113108_A034454_T30UXD_N04.00
ULX=600000
ULY=5900040
_FillValue=-9999
Image Structure Metadata:
COMPRESSION=DEFLATE
INTERLEAVE=BAND
PREDICTOR=2
GTiff: ScanDirectories()
GTiff: Opened 1830x1830 overview.
GTiff: Opened 915x915 overview.
GTiff: Opened 458x458 overview.
GTiff: Opened 229x229 overview.
Corner Coordinates:
Upper Left ( 600000.000, 5900040.000) ( 1d30' 5.54"W, 53d14'24.75"N)
Lower Left ( 600000.000, 5790240.000) ( 1d32' 6.07"W, 52d15'12.44"N)
Upper Right ( 709800.000, 5900040.000) ( 0d 8'30.37"E, 53d12'29.52"N)
Lower Right ( 709800.000, 5790240.000) ( 0d 4'18.04"E, 52d13'21.24"N)
Center ( 654900.000, 5845140.000) ( 0d42'20.80"W, 52d44' 2.09"N)
Band 1 Block=256x256 Type=Int16, ColorInterp=Gray
Description = Green
NoData Value=-9999
Overviews: 1830x1830, 915x915, 458x458, 229x229
Offset: 0, Scale:0.0001
GDAL: GDALClose(/vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif, this=0x5602deb8fcf0)


And I see a cookie.txt file in my home folder now.

However, the same issue still persist with my code. So I believe something else is also at play. But thank you for the help!

matthew_cox_omnia
Posts: 8
Joined: Thu Sep 21, 2023 4:40 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by matthew_cox_omnia » Fri Mar 22, 2024 12:27 pm America/New_York

Given that the command works from within the VM, this suggests that the issue like between your code and the VM. Are you loading your script onto the VM and running from there or are you running it locally? If the latter, that could be the issue because GDAL is being executed locally and is thus looking for the .netrc file to be on your local machine.

kongstad_dk
Posts: 7
Joined: Wed Dec 27, 2023 3:47 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by kongstad_dk » Mon Mar 25, 2024 7:28 am America/New_York

So I got it worked out now. The issue was that the function of which the rasterio.open(url) call was made, needed to have the gdal configuration options set in the same function. Calling it as a separate function in the same class should work, but doesnt. So doing like this works

def _process_image(self, item_metadata, geometry, clip_method, pixels):
# Set GDAL configuration options
cookie_file_path = os.path.expanduser("~/cookies.txt")
gdal.SetConfigOption("GDAL_HTTP_COOKIEFILE", cookie_file_path)
gdal.SetConfigOption("GDAL_HTTP_COOKIEJAR", cookie_file_path)
gdal.SetConfigOption("GDAL_DISABLE_READDIR_ON_OPEN", "EMPTY_DIR")
gdal.SetConfigOption("CPL_VSIL_CURL_ALLOWED_EXTENSIONS", "TIF")
gdal.SetConfigOption("GDAL_HTTP_UNSAFESSL", "YES")

url, metadata = item_metadata
max_retries = 3
retry_delay = 5 # seconds to wait between retries

for attempt in range(max_retries):
try:
with rasterio.open(url) as src:


I found it curious that this works

gdalinfo /vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif --config GDAL_HTTP_COOKIEFILE ~/cookies.txt --config GDAL_HTTP_COOKIEJAR ~/cookies.txt

But this doesnt

gdalinfo /vsicurl/https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T30UXD.2022026T111331.v2.0/HLS.S30.T30UXD.2022026T111331.v2.0.B03.tif

So it clearly needs to be very specifically shown where the access file is in this case.

Thanks again for your time in helping me out with this

kongstad_dk
Posts: 7
Joined: Wed Dec 27, 2023 3:47 pm America/New_York
Answers: 0

Re: Errors accessing HLS data

by kongstad_dk » Mon Mar 25, 2024 9:47 am America/New_York

This actually turned out to be the best working solution for me

gdal_config = {
"GDAL_HTTP_COOKIEFILE": gdal_cookiefile,
"GDAL_HTTP_COOKIEJAR": gdal_cookiejar,
"GDAL_DISABLE_READDIR_ON_OPEN": gdal_disable_read,
"CPL_VSIL_CURL_ALLOWED_EXTENSIONS": gdal_curl_extensions,
"GDAL_HTTP_UNSAFESSL": gdal_unsafessl,
}

for attempt in range(max_retries):
try:
with rasterio.Env(**gdal_config): # Setting up GDAL environment
with rasterio.open(url) as src:

Setting up the rasterio.Env and parsing the information in as a kwarg results in full access.

Post Reply