ShadeScene
Create/upload a shade scene from PVJ data
This request accepts the response of the /ShadeScene/ConvertPVCtoPVJ endpoint in its body, and creates the initial 3D Shade Scene with default settings.
PUT
/
Project
/
{projectId}
/
Prediction
/
{predictionId}
/
ShadeScene
/
PVJData
Create/upload a shade scene from PVJ data
curl --request PUT \
--url https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"name": "<string>",
"createdDateUTC": "<string>",
"createdById": 123,
"sceneSurfaceArea": 123,
"dcFieldSurfaceArea": 123,
"collectorCount": 123,
"objectCount": 123,
"orientationTargetDCField": 123,
"calculationSettingsTargetDCField": 123,
"siteTableCount": 123,
"rotation": 123,
"fractionalShadingPercentage": 123,
"numberOfModuleFractions": 123
}
'import requests
url = "https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData"
payload = {
"id": 123,
"name": "<string>",
"createdDateUTC": "<string>",
"createdById": 123,
"sceneSurfaceArea": 123,
"dcFieldSurfaceArea": 123,
"collectorCount": 123,
"objectCount": 123,
"orientationTargetDCField": 123,
"calculationSettingsTargetDCField": 123,
"siteTableCount": 123,
"rotation": 123,
"fractionalShadingPercentage": 123,
"numberOfModuleFractions": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 123,
name: '<string>',
createdDateUTC: '<string>',
createdById: 123,
sceneSurfaceArea: 123,
dcFieldSurfaceArea: 123,
collectorCount: 123,
objectCount: 123,
orientationTargetDCField: 123,
calculationSettingsTargetDCField: 123,
siteTableCount: 123,
rotation: 123,
fractionalShadingPercentage: 123,
numberOfModuleFractions: 123
})
};
fetch('https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 123,
'name' => '<string>',
'createdDateUTC' => '<string>',
'createdById' => 123,
'sceneSurfaceArea' => 123,
'dcFieldSurfaceArea' => 123,
'collectorCount' => 123,
'objectCount' => 123,
'orientationTargetDCField' => 123,
'calculationSettingsTargetDCField' => 123,
'siteTableCount' => 123,
'rotation' => 123,
'fractionalShadingPercentage' => 123,
'numberOfModuleFractions' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData"
payload := strings.NewReader("{\n \"id\": 123,\n \"name\": \"<string>\",\n \"createdDateUTC\": \"<string>\",\n \"createdById\": 123,\n \"sceneSurfaceArea\": 123,\n \"dcFieldSurfaceArea\": 123,\n \"collectorCount\": 123,\n \"objectCount\": 123,\n \"orientationTargetDCField\": 123,\n \"calculationSettingsTargetDCField\": 123,\n \"siteTableCount\": 123,\n \"rotation\": 123,\n \"fractionalShadingPercentage\": 123,\n \"numberOfModuleFractions\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 123,\n \"name\": \"<string>\",\n \"createdDateUTC\": \"<string>\",\n \"createdById\": 123,\n \"sceneSurfaceArea\": 123,\n \"dcFieldSurfaceArea\": 123,\n \"collectorCount\": 123,\n \"objectCount\": 123,\n \"orientationTargetDCField\": 123,\n \"calculationSettingsTargetDCField\": 123,\n \"siteTableCount\": 123,\n \"rotation\": 123,\n \"fractionalShadingPercentage\": 123,\n \"numberOfModuleFractions\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 123,\n \"name\": \"<string>\",\n \"createdDateUTC\": \"<string>\",\n \"createdById\": 123,\n \"sceneSurfaceArea\": 123,\n \"dcFieldSurfaceArea\": 123,\n \"collectorCount\": 123,\n \"objectCount\": 123,\n \"orientationTargetDCField\": 123,\n \"calculationSettingsTargetDCField\": 123,\n \"siteTableCount\": 123,\n \"rotation\": 123,\n \"fractionalShadingPercentage\": 123,\n \"numberOfModuleFractions\": 123\n}"
response = http.request(request)
puts response.read_body{
"name": "Custom Shade Scene",
"sceneSurfaceArea": 34952.621141703195,
"dcFieldSurfaceArea": 14461.598249999997,
"collectorCount": 177,
"objectCount": 0,
"orientationTargetDCField": 3387869,
"calculationSettingsTargetDCField": 3387869,
"rotation": false,
"customTableRotationScheduleName": null,
"customTableRotationUploadDate": null,
"binType": 2,
"collectorType": 0,
"trackerRotationModel": 0,
"shadingModel": 5,
"fractionalShadingPercentage": 100,
"numberOfModuleFractions": null,
"shadeObjectType": 1
}{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}Project not found.An error has occurred.Authorizations
Body
application/json
Response
Created shade scene
⌘I
Create/upload a shade scene from PVJ data
curl --request PUT \
--url https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": 123,
"name": "<string>",
"createdDateUTC": "<string>",
"createdById": 123,
"sceneSurfaceArea": 123,
"dcFieldSurfaceArea": 123,
"collectorCount": 123,
"objectCount": 123,
"orientationTargetDCField": 123,
"calculationSettingsTargetDCField": 123,
"siteTableCount": 123,
"rotation": 123,
"fractionalShadingPercentage": 123,
"numberOfModuleFractions": 123
}
'import requests
url = "https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData"
payload = {
"id": 123,
"name": "<string>",
"createdDateUTC": "<string>",
"createdById": 123,
"sceneSurfaceArea": 123,
"dcFieldSurfaceArea": 123,
"collectorCount": 123,
"objectCount": 123,
"orientationTargetDCField": 123,
"calculationSettingsTargetDCField": 123,
"siteTableCount": 123,
"rotation": 123,
"fractionalShadingPercentage": 123,
"numberOfModuleFractions": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 123,
name: '<string>',
createdDateUTC: '<string>',
createdById: 123,
sceneSurfaceArea: 123,
dcFieldSurfaceArea: 123,
collectorCount: 123,
objectCount: 123,
orientationTargetDCField: 123,
calculationSettingsTargetDCField: 123,
siteTableCount: 123,
rotation: 123,
fractionalShadingPercentage: 123,
numberOfModuleFractions: 123
})
};
fetch('https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => 123,
'name' => '<string>',
'createdDateUTC' => '<string>',
'createdById' => 123,
'sceneSurfaceArea' => 123,
'dcFieldSurfaceArea' => 123,
'collectorCount' => 123,
'objectCount' => 123,
'orientationTargetDCField' => 123,
'calculationSettingsTargetDCField' => 123,
'siteTableCount' => 123,
'rotation' => 123,
'fractionalShadingPercentage' => 123,
'numberOfModuleFractions' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData"
payload := strings.NewReader("{\n \"id\": 123,\n \"name\": \"<string>\",\n \"createdDateUTC\": \"<string>\",\n \"createdById\": 123,\n \"sceneSurfaceArea\": 123,\n \"dcFieldSurfaceArea\": 123,\n \"collectorCount\": 123,\n \"objectCount\": 123,\n \"orientationTargetDCField\": 123,\n \"calculationSettingsTargetDCField\": 123,\n \"siteTableCount\": 123,\n \"rotation\": 123,\n \"fractionalShadingPercentage\": 123,\n \"numberOfModuleFractions\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 123,\n \"name\": \"<string>\",\n \"createdDateUTC\": \"<string>\",\n \"createdById\": 123,\n \"sceneSurfaceArea\": 123,\n \"dcFieldSurfaceArea\": 123,\n \"collectorCount\": 123,\n \"objectCount\": 123,\n \"orientationTargetDCField\": 123,\n \"calculationSettingsTargetDCField\": 123,\n \"siteTableCount\": 123,\n \"rotation\": 123,\n \"fractionalShadingPercentage\": 123,\n \"numberOfModuleFractions\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Project/{projectId}/Prediction/{predictionId}/ShadeScene/PVJData")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 123,\n \"name\": \"<string>\",\n \"createdDateUTC\": \"<string>\",\n \"createdById\": 123,\n \"sceneSurfaceArea\": 123,\n \"dcFieldSurfaceArea\": 123,\n \"collectorCount\": 123,\n \"objectCount\": 123,\n \"orientationTargetDCField\": 123,\n \"calculationSettingsTargetDCField\": 123,\n \"siteTableCount\": 123,\n \"rotation\": 123,\n \"fractionalShadingPercentage\": 123,\n \"numberOfModuleFractions\": 123\n}"
response = http.request(request)
puts response.read_body{
"name": "Custom Shade Scene",
"sceneSurfaceArea": 34952.621141703195,
"dcFieldSurfaceArea": 14461.598249999997,
"collectorCount": 177,
"objectCount": 0,
"orientationTargetDCField": 3387869,
"calculationSettingsTargetDCField": 3387869,
"rotation": false,
"customTableRotationScheduleName": null,
"customTableRotationUploadDate": null,
"binType": 2,
"collectorType": 0,
"trackerRotationModel": 0,
"shadingModel": 5,
"fractionalShadingPercentage": 100,
"numberOfModuleFractions": null,
"shadeObjectType": 1
}{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}Project not found.An error has occurred.