urlwrite("https://celestrak.org/NORAD/elements/stations.txt","iss_orbit.tle");
startTime = datetime(2023,3,5,22,49,45); % startTime = datetime(2022,12,08,00,00,0);
stopTime = startTime + minutes(3); % stopTime = startTime + hours(12);
sampleTime = 5; % sampleTime = 5;
sc = satelliteScenario(startTime,stopTime,sampleTime);
sat = satellite(sc,"iss_orbit.tle");
sat(1).MarkerColor = [255/255 1/255 1/255];
names = sat.Name + " Camera";
cam = conicalSensor(sat,"Name",names,"MaxViewAngle",90);
groundTrack(sat(1), LeadTime=200, TrailTime=100, ...
LineWidth=3, LeadLineColor=[0 1 0], TrailLineColor=[1 0 1]);
ele1 = orbitalElements(sat(1));
ele2 = orbitalElements(sat(2));
ele3 = orbitalElements(sat(3));
[pos, vel] = states(sat(1),"CoordinateFrame","geographic");
name = ["Madrid Deep Space Communications Complex", ...
"Canberra Deep Space Communications Complex"];
lat = [40.43139, -35.40139];
lon = [-4.24806, 148.98167];
gs = groundStation(sc,"Name",name,"Latitude",lat, ...
"Longitude", lon, "minElevationAngle", 0);
%access setting
ac1 = access(gs(1), sat);
ac2 = access(gs(2), sat);
% ac = access(gs(2), sat(1));
%interval status
intvls = accessIntervals(ac1);
disp(intvls);
%display FOV of camera
fieldOfView(cam);
time = datetime(2020,6,02,12,30,0);
[az,elev,r] = aer(gs(1),sat(1),time);