Import Packages¶
In [1]:
Copied!
from pathlib import Path
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from s3lst_ds.data_download.download_sentinel3 import download_products
from s3lst_ds.data_download.download_sentinel3_config import Sentinel3Config
from s3lst_ds.data_reading.s3_reader import Sen3Loader
from pathlib import Path
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from s3lst_ds.data_download.download_sentinel3 import download_products
from s3lst_ds.data_download.download_sentinel3_config import Sentinel3Config
from s3lst_ds.data_reading.s3_reader import Sen3Loader
Download Products¶
Configure¶
With the configuration below, one intends to:
- donwload NT (Non-Time Critical) Sentinel-3 Level-2LST and SYN products;
- to directory
./data; - for two date-ranges - from
2020-07-18to2020-07-19, and from2021-07-16to2021-07-26; - for the Lisbon metropolitan area (represented by a WKT string);
- solely products with a cloud cover fraction not larger than 30 % are to be considered;
- the products are to be processed, that is, georeferenced and subset to the bands and
area of interest - using
esa-snappy; - the clouds are to be masked out;
- the whole procedure is to be logged into the terminal.
In [2]:
Copied!
download_config = Sentinel3Config(
out_dir=Path("./data"),
timeliness="NT",
start_sensing_dates=["2020-07-18", "2021-07-16"],
end_sensing_dates=["2020-07-19", "2021-07-26"],
geometry_aoi=(
"POLYGON ((-9.53 38.57, -9.05 38.57, -9.05 38.92, -9.53 38.92, -9.53 38.57))"
),
cloud_cover_max_aoi=30,
process=True,
process_engine="snappy",
mask_clouds=True,
log_mode="console",
)
download_config = Sentinel3Config(
out_dir=Path("./data"),
timeliness="NT",
start_sensing_dates=["2020-07-18", "2021-07-16"],
end_sensing_dates=["2020-07-19", "2021-07-26"],
geometry_aoi=(
"POLYGON ((-9.53 38.57, -9.05 38.57, -9.05 38.92, -9.53 38.92, -9.53 38.57))"
),
cloud_cover_max_aoi=30,
process=True,
process_engine="snappy",
mask_clouds=True,
log_mode="console",
)
Download¶
To download the products through OData's API, the function below is used.
In [3]:
Copied!
download_products(download_config)
download_products(download_config)
INFO Downloading Sentinel-3 products for dates - 2020-07-18 to 2020-07-19, - 2021-07-16 to 2021-07-26. ⠋ Querying Sentinel-3 LST products...0m INFO 37 Sentinel-3 LST products have been found in the query: S3A_SL_2_LST____20200718T105333_20200718T105633_20200719T154051_0179_060_322_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20200718T221028_20200718T221328_20200720T040806_0179_060_329_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20200719T102722_20200719T103022_20200720T150613_0179_060_336_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20200719T112855_20200719T113155_20200720T163511_0180_041_194_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20200719T214417_20200719T214717_20200721T050102_0179_060_343_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20200719T224549_20200719T224849_20200721T035752_0179_041_201_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210716T104226_20210716T104526_20210820T155455_0179_074_108_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210716T215920_20210716T220220_20210718T081623_0179_074_115_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210717T111751_20210717T112051_20210718T213734_0179_054_365_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210717T223445_20210717T223745_20210719T101448_0180_054_372_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210718T105140_20210718T105440_20210719T233645_0180_054_379_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210718T220834_20210718T221134_20210720T102217_0179_055_001_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210718T224757_20210718T225057_20210720T105212_0179_074_144_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210719T102529_20210719T102829_20210720T202149_0179_055_008_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210719T110452_20210719T110752_20210720T201749_0179_074_151_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210719T214223_20210719T214523_20210721T081754_0179_055_015_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210719T222146_20210719T222446_20210721T085322_0179_074_158_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210720T103841_20210720T104141_20210721T221822_0179_074_165_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210720T215535_20210720T215835_20210722T091603_0180_074_172_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210721T111406_20210721T111706_20210723T002903_0179_055_037_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210721T223101_20210721T223401_20210723T100247_0179_055_044_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210722T104755_20210722T105055_20210723T220732_0179_055_051_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210722T112718_20210722T113018_20210723T222415_0179_074_194_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210722T220450_20210722T220750_20210724T082039_0179_055_058_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210722T224412_20210722T224712_20210724T091915_0179_074_201_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210723T102145_20210723T102445_20210724T194234_0179_055_065_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210723T110107_20210723T110407_20210724T205159_0179_074_208_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210723T221801_20210723T222101_20210725T073347_0179_074_215_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210724T103456_20210724T103756_20210725T215425_0179_074_222_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210724T215150_20210724T215450_20210726T082532_0180_074_229_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210724T225328_20210724T225628_20210726T100401_0179_055_087_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210725T111022_20210725T111322_20210726T235742_0179_055_094_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210725T222717_20210725T223017_20210727T102957_0179_055_101_05 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210726T104411_20210726T104711_20210727T190942_0180_055_108_23 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210726T112333_20210726T112633_20210727T225648_0179_074_251_23 40_LN2_O_NT_004.SEN3 S3B_SL_2_LST____20210726T220106_20210726T220406_20210728T114831_0179_055_115_05 40_LN2_O_NT_004.SEN3 S3A_SL_2_LST____20210726T224027_20210726T224327_20210728T084718_0179_074_258_05 40_LN2_O_NT_004.SEN3 ⠼ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20200718T105333_20200718T105633_20200719T210456_0179_060_322_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20200718T105333_20200718T105633_20200719T154051_0179_060_322_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 14.68 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠦ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20200718T221028_20200718T221328_20200720T040806_0179_060_329_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠙ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20200719T102722_20200719T103022_20200720T224945_0179_060_336_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20200719T102722_20200719T103022_20200720T150613_0179_060_336_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 [ 0:00:23 < 0:00:00 , ? file/s ] INFO Product downloaded. INFO Product will now be unzipped. INFO Product unzipped. INFO Product will now be reprojected and subsetted. ⠼ Reprojecting and subsetting the LST product...0m INFO Product reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... WARNING Cloud cover fraction in the AOI for LST product 'S3A_SL_2_LST____20200719T102722_20200719T103022_20200720T150613_0179_060_336_2 340_LN2_O_NT_004.SEN3' is 35.83 %, which exceeds the issued limit, 30 %. This case will not be considered. The LST product will be deleted as well as its subfolder if it only contained that product, and the companion SYN product will not be downloaded. The run will advance to the processing of the next LST product. WARNING LST product 'S3A_SL_2_LST____20200719T102722_20200719T103022_20200720T150613_0179_060_336_2 340_LN2_O_NT_004.SEN3.nc' was deleted. WARNING Subfolder '20200719T102722' was deleted. ⠹ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20200719T112855_20200719T113155_20200720T163511_0180_041_194_2 340_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20200719T214417_20200719T214717_20200721T050102_0179_060_343_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20200719T224549_20200719T224849_20200721T035752_0179_041_201_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20210716T104226_20210716T104526_20210823T233422_0179_074_108_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20210716T104226_20210716T104526_20210820T155455_0179_074_108_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 26.86 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210716T215920_20210716T220220_20210718T081623_0179_074_115_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210717T111751_20210717T112051_20210719T162736_0179_054_365_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210717T111751_20210717T112051_20210718T213734_0179_054_365_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 17.10 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠏ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210717T223445_20210717T223745_20210719T101448_0180_054_372_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210718T105140_20210718T105440_20210720T213740_0179_054_379_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210718T105140_20210718T105440_20210719T233645_0180_054_379_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 23.93 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210718T220834_20210718T221134_20210720T102217_0179_055_001_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠦ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210718T224757_20210718T225057_20210720T105212_0179_074_144_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠼ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210719T102529_20210719T102829_20210721T160329_0179_055_008_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210719T102529_20210719T102829_20210720T202149_0179_055_008_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 [ 0:00:10 < 0:00:00 , ? file/s ] INFO Product downloaded. INFO Product will now be unzipped. INFO Product unzipped. INFO Product will now be reprojected and subsetted. ⠧ Reprojecting and subsetting the LST product...0m INFO Product reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... WARNING Cloud cover fraction in the AOI for LST product 'S3B_SL_2_LST____20210719T102529_20210719T102829_20210720T202149_0179_055_008_2 340_LN2_O_NT_004.SEN3' is 34.21 %, which exceeds the issued limit, 30 %. This case will not be considered. The LST product will be deleted as well as its subfolder if it only contained that product, and the companion SYN product will not be downloaded. The run will advance to the processing of the next LST product. WARNING LST product 'S3B_SL_2_LST____20210719T102529_20210719T102829_20210720T202149_0179_055_008_2 340_LN2_O_NT_004.SEN3.nc' was deleted. WARNING Subfolder '20210719T102529' was deleted. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20210719T110452_20210719T110752_20210721T062942_0179_074_151_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20210719T110452_20210719T110752_20210720T201749_0179_074_151_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 29.00 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210719T214223_20210719T214523_20210721T081754_0179_055_015_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210719T222146_20210719T222446_20210721T085322_0179_074_158_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20210720T103841_20210720T104141_20210722T124536_0179_074_165_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20210720T103841_20210720T104141_20210721T221822_0179_074_165_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 [ 0:00:05 < 0:00:00 , ? file/s ] INFO Product downloaded. INFO Product will now be unzipped. INFO Product unzipped. INFO Product will now be reprojected and subsetted. ⠸ Reprojecting and subsetting the LST product...0m INFO Product reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... WARNING Cloud cover fraction in the AOI for LST product 'S3A_SL_2_LST____20210720T103841_20210720T104141_20210721T221822_0179_074_165_2 340_LN2_O_NT_004.SEN3' is 32.49 %, which exceeds the issued limit, 30 %. This case will not be considered. The LST product will be deleted as well as its subfolder if it only contained that product, and the companion SYN product will not be downloaded. The run will advance to the processing of the next LST product. WARNING LST product 'S3A_SL_2_LST____20210720T103841_20210720T104141_20210721T221822_0179_074_165_2 340_LN2_O_NT_004.SEN3.nc' was deleted. WARNING Subfolder '20210720T103841' was deleted. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210720T215535_20210720T215835_20210722T091603_0180_074_172_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210721T111406_20210721T111706_20210723T092510_0179_055_037_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210721T111406_20210721T111706_20210723T002903_0179_055_037_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 6.83 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠹ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210721T223101_20210721T223401_20210723T100247_0179_055_044_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210722T104755_20210722T105055_20210724T135757_0179_055_051_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210722T104755_20210722T105055_20210723T220732_0179_055_051_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 28.23 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210722T112718_20210722T113018_20210723T222415_0179_074_194_2 340_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210722T220450_20210722T220750_20210724T082039_0179_055_058_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠦ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210722T224412_20210722T224712_20210724T091915_0179_074_201_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠇ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210723T102145_20210723T102445_20210725T083336_0179_055_065_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210723T102145_20210723T102445_20210724T194234_0179_055_065_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 18.82 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠙ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20210723T110107_20210723T110407_20210725T090123_0179_074_208_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20210723T110107_20210723T110407_20210724T205159_0179_074_208_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 16.83 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠦ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210723T221801_20210723T222101_20210725T073347_0179_074_215_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠼ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3A_SY_2_SYN____20210724T103456_20210724T103756_20210726T104248_0179_074_222_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3A_SL_2_LST____20210724T103456_20210724T103756_20210725T215425_0179_074_222_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 9.16 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210724T215150_20210724T215450_20210726T082532_0180_074_229_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210724T225328_20210724T225628_20210726T100401_0179_055_087_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠦ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210725T111022_20210725T111322_20210727T070346_0179_055_094_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210725T111022_20210725T111322_20210726T235742_0179_055_094_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 [ 0:00:05 < 0:00:00 , ? file/s ] INFO Product downloaded. INFO Product will now be unzipped. INFO Product unzipped. INFO Product will now be reprojected and subsetted. ⠦ Reprojecting and subsetting the LST product...0m INFO Product reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... WARNING Cloud cover fraction in the AOI for LST product 'S3B_SL_2_LST____20210725T111022_20210725T111322_20210726T235742_0179_055_094_2 340_LN2_O_NT_004.SEN3' is 35.32 %, which exceeds the issued limit, 30 %. This case will not be considered. The LST product will be deleted as well as its subfolder if it only contained that product, and the companion SYN product will not be downloaded. The run will advance to the processing of the next LST product. WARNING LST product 'S3B_SL_2_LST____20210725T111022_20210725T111322_20210726T235742_0179_055_094_2 340_LN2_O_NT_004.SEN3.nc' was deleted. WARNING Subfolder '20210725T111022' was deleted. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210725T222717_20210725T223017_20210727T102957_0179_055_101_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m INFO Singular companion Sentinel-3 SYN product 'S3B_SY_2_SYN____20210726T104411_20210726T104711_20210728T175922_0179_055_108_2 340_LN2_O_NT_002.SEN3' was found in the SYN query for LST's 'S3B_SL_2_LST____20210726T104411_20210726T104711_20210727T190942_0180_055_108_2 340_LN2_O_NT_004.SEN3'. LST product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠋ Checking if AOI's cloud cover fraction in the LST product is smaller than the configured 30 %... INFO Product is already masked out with respect to clouds. INFO Cloud cover fraction in the AOI for LST product is 19.11 %, not exceeding issued maximum limit, 30 %. The companion SYN product will now be downloaded. INFO Product was already downloaded. INFO Product is already unzipped. INFO Product is already reprojected and subsetted. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210726T112333_20210726T112633_20210727T225648_0179_074_251_2 340_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠼ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3B_SL_2_LST____20210726T220106_20210726T220406_20210728T114831_0179_055_115_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one. ⠸ Querying Sentinel-3 SYN product...0m WARNING No companion Sentinel-3 SYN product was found in the SYN query for LST's 'S3A_SL_2_LST____20210726T224027_20210726T224327_20210728T084718_0179_074_258_0 540_LN2_O_NT_004.SEN3'. The LST product will not be downloaded and the process will advance to the next one.
Read Products¶
In [4]:
Copied!
# Get path to the first directory containing the LST and SYN products in the data folder
path_lst_syn = next(dir for dir in Path("./data").iterdir() if dir.is_dir())
# Read the LST and NDVI (from SYN) data
sen3_loader = Sen3Loader(path=path_lst_syn)
data_lst = next(iter(sen3_loader.get_var_by_name("LST").data_vars.values()))
data_ndvi = sen3_loader.get_var_by_name("NDVI")
# Extract the timestamp from the data
timestamp = sen3_loader.timestamp
# Get path to the first directory containing the LST and SYN products in the data folder
path_lst_syn = next(dir for dir in Path("./data").iterdir() if dir.is_dir())
# Read the LST and NDVI (from SYN) data
sen3_loader = Sen3Loader(path=path_lst_syn)
data_lst = next(iter(sen3_loader.get_var_by_name("LST").data_vars.values()))
data_ndvi = sen3_loader.get_var_by_name("NDVI")
# Extract the timestamp from the data
timestamp = sen3_loader.timestamp
Plot LST and NDVI Data¶
In [5]:
Copied!
# Define the coordinate reference system to use in the plot
crs = ccrs.PlateCarree()
# Initialise figure and axes using a given CRS
fig, axs = plt.subplots(
nrows=1,
ncols=2,
figsize=(12, 5),
subplot_kw={"projection": crs},
)
fig.suptitle(
"Downloaded LST and NDVI Data"
"\n"
f"(Timestamp {timestamp.strftime('%Y-%m-%d %H:%M:%S')})",
fontsize=16,
y=1.05,
)
for ax, data, var in zip(axs, [data_lst, data_ndvi], ["LST", "NDVI"]):
img = data.plot(
ax=ax,
cmap="Spectral_r",
alpha=0.8,
cbar_kwargs={
"orientation": "horizontal",
"pad": 0.05,
"label": None,
},
# Project the data to the given CRS if it is not already in that CRS
transform=crs,
) # type: ignore
ax.set_title(var, fontsize=14)
plt.show()
# Define the coordinate reference system to use in the plot
crs = ccrs.PlateCarree()
# Initialise figure and axes using a given CRS
fig, axs = plt.subplots(
nrows=1,
ncols=2,
figsize=(12, 5),
subplot_kw={"projection": crs},
)
fig.suptitle(
"Downloaded LST and NDVI Data"
"\n"
f"(Timestamp {timestamp.strftime('%Y-%m-%d %H:%M:%S')})",
fontsize=16,
y=1.05,
)
for ax, data, var in zip(axs, [data_lst, data_ndvi], ["LST", "NDVI"]):
img = data.plot(
ax=ax,
cmap="Spectral_r",
alpha=0.8,
cbar_kwargs={
"orientation": "horizontal",
"pad": 0.05,
"label": None,
},
# Project the data to the given CRS if it is not already in that CRS
transform=crs,
) # type: ignore
ax.set_title(var, fontsize=14)
plt.show()