Solar Analysis
1
cp=Point.Origin();
2
rd=3;
3
a1=Line.ByStartPointDirectionLength(Point.ByCoordinates(rd,0,0),Vector.ZAxis(),rd);
4
a2=Arc.ByCenterPointStartPointEndPoint(cp,Point.ByCoordinates(0,0,rd),Point.ByCoordinates(rd,0,0));
5
asrf=Surface.ByRevolve(a2,cp,Vector.ZAxis(),0,360);
6
7
//Solar Study
8
solarstudy=SolarAnalysis.Analyze(Weather.ByLatitudeLongitude
9
(12.9716,77.5946),asrf,[],
10
TimeStudy.FromStartTimeToEndTime(DSCore.DateTime.
11
FromString("April 30, 2016 9:00 AM"),DSCore.DateTime.
12
FromString("April 29, 2017 6:00 PM"),false),0.125,0);
13
cumulative=List.Flatten(solarstudy["Cumulative"],1);
14
average=List.Flatten(solarstudy["Average"],1);
15
peak=List.Flatten(solarstudy["Peak"],1);
16
calculationpoints=List.Flatten(solarstudy["Calculation Points"],1);
17
18
cumPt=List.SortByKey(Flatten(calculationpoints),Flatten(cumulative))["sorted list"];
19
avgPt=List.SortByKey(Flatten(calculationpoints),Flatten(average))["sorted list"];
20
pekPt=List.SortByKey(Flatten(calculationpoints),Flatten(peak))["sorted list"];
21
22
//Colors
23
Color.ByARGB(255,[0,0,255],[0,255,0],[255,0,0]);
24
0..2;
25
0..1..#List.Count(cumPt);
26
27
//Angles
28
cumPhi=(Vector.XAxis()).AngleWithVector(((List.LastItem(cumPt)).Project(Plane.XZ(),Vector.YAxis())).AsVector());
29
cumThe=(Vector.XAxis()).AngleWithVector(((List.LastItem(cumPt)).Project(Plane.XY(),Vector.ByCoordinates(0,0,-1))).AsVector());
30
31
avgPhi=(Vector.XAxis()).AngleWithVector(((List.LastItem(avgPt)).Project(Plane.XZ(),Vector.YAxis())).AsVector());
32
avgThe=(Vector.XAxis()).AngleWithVector(((List.LastItem(avgPt)).Project(Plane.XY(),Vector.ByCoordinates(0,0,-1))).AsVector());
33
34
pekPhi=(Vector.XAxis()).AngleWithVector(((List.LastItem(pekPt)).Project(Plane.XZ(),Vector.YAxis())).AsVector());
35
pekThe=(Vector.XAxis()).AngleWithVector(((List.LastItem(pekPt)).Project(Plane.XY(),Vector.ByCoordinates(0,0,-1))).AsVector());
Copied!
Last modified 1yr ago
Copy link