This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VERSION=3 | |
function setup (){ | |
return { | |
input: [ | |
{datasource: "s1grd", bands:["VV", "VH"]}, | |
{datasource: "s2l2a", bands:["B04", "B08", "CLM"], units:"REFLECTANCE"}], | |
output: [ | |
{id: "default", bands: 3, sampleType: SampleType.AUTO} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --location --request POST 'https://services.sentinel-hub.com/api/v1/process' \ | |
--header 'Authorization: Bearer <your-token-here>' \ | |
--form 'request={ | |
"input": { | |
"bounds": { | |
"bbox": [ | |
2.1421623229980464, | |
41.37796785471600, | |
2.2084236145019527, | |
41.40784461738553 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def skyview(horz_data, slp, asp): | |
""" Compute the sky view factor. | |
Compute the sky view factor for every pixel, i.e. the ratio between diffuse | |
irradiance received to that on unobstructed surface according to its slope, | |
aspect and horizon. Algorithm by Dozier et al. 1981, 1990. | |
Args: | |
horz_data (ndarray): horizon elevation data computed from the DEM | |
slp (ndarray): slope calculated from the DEM | |
asp (ndarray): aspect calculated from the DEM | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VERSION=3 | |
// Calculate number of bands needed for all intervals | |
// Initialise dates and interval | |
// Beware: in JS months are 0 indexed | |
var start_date = new Date(2019, 3, 1, 0, 0, 0); | |
var end_date = new Date(2019, 9, 31, 0, 0, 0); | |
var sampled_dates = sample_timestamps(start_date, end_date, 15, 'day').map(d => withoutTime(d)); | |
var nb_bands = sampled_dates.length; | |
var n_valid = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Evaluate pixels in the bands | |
function evaluatePixel(samples, scenes) { | |
// Initialise arrays | |
var valid_samples = {'B02':[], 'B03':[], 'B04':[], 'B08':[], 'B11':[], 'B12':[]}; | |
var valid_dates = [] | |
// Loop over samples. | |
for (var i = samples.length-1; i >= 0; i--){ | |
if (is_valid(samples[i])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make class to convert Batch to EOPatches | |
batch2eolearn = ImportFromAWS(aws_access_key_id, aws_secret_access_key, aws_bucket_name, | |
batch_request_id, band_names, timestamps, is_data=is_data_band, | |
out_path=save_folder) | |
# Convert Batch results in the Amazon Bucket to EOPatches | |
batch2eolearn.convert_to_EOPatches() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
order = { | |
"processRequest": { | |
"input": { | |
"bounds": { | |
"geometry": { | |
"type": "Polygon", | |
"coordinates": AOI_bounds | |
}, | |
"properties": { | |
"crs": "http://www.opengis.net/def/crs/EPSG/0/32632" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VERSION=3 | |
// Calculate number of bands needed for all intervals | |
// Initialise dates and interval | |
// Beware: in JS months are 0 indexed | |
var start_date = new Date(2019, 3, 1, 0, 0, 0); | |
var end_date = new Date(2019, 9, 31, 0, 0, 0); | |
var sampled_dates = sample_timestamps(start_date, end_date, 15, 'day').map(d => withoutTime(d)); | |
var nb_bands = sampled_dates.length; | |
var n_valid = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For requests | |
import requests | |
from oauthlib.oauth2 import BackendApplicationClient | |
from requests_oauthlib import OAuth2Session | |
from sentinelhub import SHConfig | |
config = SHConfig() | |
# Set up credentials for use with batch | |
client = BackendApplicationClient(client_id=config.sh_client_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name | Description | Range | |
---|---|---|---|
UINT8 | unsigned 8-bit integer | 0-255 |
OlderNewer