As far as I know, using custom scripts with 3 different products in EO Browser is not possible yet.
If you really need the products as a layer stack, you could use the process API and specify three datasets in the request like shown in this example:
{
"input": {
"bounds": {
"properties": {
"crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
},
"bbox": [13, 45, 15, 47]
},
"data": [{"id": "s5_no2",
"type": "S5PL2",
"dataFilter": {"timeRange": {"from": "2020-05-26T00:00:00Z",
"to": "2020-05-27T00:00:00Z"},
"mosaickingOrder": "mostRecent"}
},
{"id": "s5_co",
"type": "S5PL2",
"dataFilter": {"timeRange": {"from": "2020-05-26T00:00:00Z",
"to": "2020-05-27T00:00:00Z"},
"mosaickingOrder": "mostRecent"}
},
{"id": "s5_o3",
"type": "S5PL2",
"dataFilter": {"timeRange": {"from": "2020-05-26T00:00:00Z",
"to": "2020-05-27T00:00:00Z"},
"mosaickingOrder": "mostRecent"}
}
]
},
"output": {
"width": 512,
"height": 512,
"responses": [
{
"format": {
"type": "image/tiff"
}
}
]
}
}
And then retrieve the different products (NO2, CO and O3) as datasources from the three datasets specified in your request (note the dataset IDs):
//VERSION=3
function setup (){
return {
input: [
{datasource: "s5_no2", bands:["NO2"]},
{datasource: "s5_co", bands:["CO"]},
{datasource: "s5_o3", bands:["O3"]}],
output: [
{id: "default", bands: 3, sampleType: SampleType.UINT16}
]
}
}
var f = 10000
function evaluatePixel(samples) {
var S5_1 = samples.s5_no2[0]
var S5_2 = samples.s5_co[0]
var S5_3 = samples.s5_o3[0]
//To save processing units, we return the data as integers multiplied by 10000. In order to retrieve the actual values, divide the resulting bands in the response tiff by 10000.
return{default: [S5_1.SO2*f, S5_2.CO*f, S5_3.O3*f]}
}
I specified the response as a TIFF file with 16 bit depth, using "responses": [ { "format": { "type": "image/tiff" } } ]
in the request and output: [ {id: "default", bands: 3, sampleType: SampleType.UINT16} ]
in the evalscript (note the comment in the evalscript above the return statement). Of course you will need to adjust the request to your needs. I hope this helps.
Cheers, Max