Comments (8)
Hi @Johannes-R-Schmid ,
at the moment WebFeatureService
, AwsTileRequest
and AwsProductRequest
work with Sentinel-2 only (WebFeatureSerive._parse_tile_url()
fails due to different name formatting).
A work-around for now would be the following
import requests
wfs_iterator_l8 = WebFeatureService(bbox, time_interval, data_source=DataSource.LANDSAT8, maxcc=1.0)
wfs_iterator_l8.get_dates()
print(wfs_iterator_l8.tile_list)
path_to_a_tile = wfs_iterator_l8.tile_list[0]['properties']['path']
response = requests.get(path_to_a_tile + '_MTL.txt')
text = response.text
print(text[text.find('K1_CONSTANT_BAND_10'):text.find('K1_CONSTANT_BAND_11')])
Alternatively, you could download the metadata from the S3 bucket (more info here) using boto3. Refer to this post for more info.
We'll let you know if we find a better way.
from eo-learn.
You should be able to access all information available through Sentinel Hub. E.g. access to some meta-data is described here:
https://www.sentinel-hub.com/faq/how-can-i-access-meta-data-information-sentinel-2-l2a
(most of these are available for L1C as well).
For meta-data, that are not pixel-based there might be a bit of a trickery required as they could be loaded from AWS, e.g.:
https://roda.sentinel-hub.com/sentinel-s2-l1c/tiles/1/K/AT/2018/7/20/0/metadata.xml
I am not sure if some of the above is already available in eo-learn (others may comment on it) but if not, it should not be too difficult to add. Pull request would certainly be welcome.
from eo-learn.
You can have a look at the AddSen2CorClassificationFeature
task as an example on how to retrieve meta-data using an EVALSCRIPT
request.
Something like the following should work.
from sentinelhub import CustomUrlParam
evalscript = 'return [sunAzimuthAngles]'
custom_url_params = {CustomUrlParam.EVALSCRIPT: evalscript}
eop_l2a = S2L2AWCSInput('BANDS-S2-L2A',
feature='SUN-AZIMUTH-ANGLES',
resx='10m', resy='10m',
maxcc=0.8,
custom_url_params=custom_url_params).execute(time_interval=time_interval,
bbox=bbox)
from eo-learn.
Thank you for your replies.
@devisperessutti , using an EVALSCRIPT
request has been successful in getting hold of sunZenithAngles.
However I am also interested in non-pixel-based metadata, eg. from the MTD_MSIL1C.xml. Following @gmilcinski 's suggestion, I managed to obtain these values using AwsProductRequest
in sentinelhub-py
. However I required a productID in advance and I needlessly downloaded all the other non-metadata files along with it.
Is there a way to easily grab 'U' and 'SOLAR_IRRADIANCE' metadata using eo-learn?
from eo-learn.
hello.
at the moment these features are not exposed by the SH service, so the process to get them is a bit more convoluted. However, the following code should help you set up a Task to retrieve those values querying only the metadata (no other files are downloaded)
# get list of tiles for bbox and time interval
wfs_iterator = WebFeatureService(bbox, time_interval, data_source=DataSource.SENTINEL2_L1C,
maxcc=1.0)
# for each tile retrieve product name and query metadata to retrieve tags of interest
for tile in wfs_iterator.get_tiles():
product_id = AwsTileRequest(tile=tile[0], time=tile[1], aws_index=tile[2], bands=[],
metafiles=['productInfo'],
data_source=DataSource.SENTINEL2_L1C).get_data()[0]['name']
metadata = AwsProductRequest(product_id=product_id, bands=[], metafiles=['metadata']).get_data()
u_branch = metadata[0][0][1][4][0]
solar_irradiance_list = metadata[0][0][1][4][1]
print(f'tile is {tile[0]} {tile[1]} {tile[2]}')
print(f'{u_branch.tag} is {u_branch.text}')
print(f'{solar_irradiance_list.tag} is {solar_irradiance_list[0].text}\n\n')
you would need to be careful though on how extract/combine values for patches at the intersection of different products (this is normally handled by the service)
hope this helps
from eo-learn.
@devisperessutti
what about Landsat8 imagery
I would like to obtain for example "K1_CONSTANT_BAND_10".
There the basic code above does not seem to work after adjusting the DataSource.
from eo-learn.
this works perfectly, thanks!
What about the "pixel_qa" layer as there is no respective predefined script in the WMS configurator. I would like to mask out clouds in LS8 data using that layer.
from eo-learn.
To retrieve data from the QA layer of Landsat-8 please refer to this FAQ.
You would need to add an evalscript definition to the custom_url_params
parameter when making the request.
from eo-learn.
Related Issues (20)
- [BUG] ImportError: cannot import name 'PointSamplingTask' from 'eolearn.geometry' HOT 5
- SI_LULC_pipeline notebook HOT 9
- readthedocs links not working HOT 1
- [FEAT] Enable timestamp filtering from interval end towards interval start HOT 5
- [BUG] SentinelHubInputTask downloads incorrect timestamps HOT 6
- [BUG] Issue with the SpatialResizeTask in ImportTiffPipeline when using the resolution approach HOT 5
- [BUG] eo-learn installation issue due to open-cv latest update on Dec 30, 2022. HOT 2
- Registration HOT 4
- [BUG] Failing tests on MacOS related to lock-related EOExecutor tests HOT 1
- [BUG] Reading EOPatches saved with eo-learn 0.10.1 with eolearn 1.4 HOT 2
- [HELP] Where has eopatch_to_dataset gone? HOT 6
- [FEAT] TDigestTask handle nans HOT 1
- [HELP] Error when I'm trying to run land-cover-map HOT 5
- [HELP] Perform sen2cor atmospheric correction on L1C EOPatch HOT 2
- [HELP] Using eo-learn for the classification of land surface types of Ukraine HOT 23
- Why I have problems with these imports? HOT 3
- ExecutableNotFound: failed to execute WindowsPath('dot'), make sure the Graphviz executables are on your systems' PATH HOT 3
- how do i fix this HOT 2
- CRSError in rasterio when using ExportToTiffTask HOT 6
- `eo-learn` 1.5.0 migration guide
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eo-learn.