📄 loadsimulationparameters.m
字号:
%*******************************************************
% function simulation = loadSimulationParameters(filename)
%
% DESCRIPTION:
%
% This function compiles all needed information to simulate the orbits of
% the GPS satellites. The information is organized into a struct for ease
% of data passing.
%
% ARGUMENTS:
%
% filename - file of user inputs for location, date, and simulation (see
% user_input.m for example of inputs)
% *can also call skyplotGUI.m for user-friendly input
%
% OUTPUT:
%
% simulation - struct of all pertinent information for simulation
% .location - struct of user location (LLA and xyz)
% .date - struct of date information (YMDhms)
% .mask - struct of elevation mask information
% .time - vector of time values at which to perform calculations
% .PRN - vector list of PRNs to simulate
% .almanac - struct of almanac values from YUMA file
%
% CALLED BY:
%
% GPSVisibilityTool
%
% FUNCTIONS CALLED:
%
% loadInput
% getYUMAFileName
% readYUMAfile
% trimAlmanac
%
% MODIFICATIONS:
%
% 02-01-02 : Lisa Reeh - Original
% 03-10-02 : Lisa Reeh
% 09-02-03 : P. Axelrad for use in ASEN 5190
% 03-04-04 : Stephen Russell - changed from script based execution
% to function based
% 07-21-04 : Stephen Russell - made this into its own function,
% independent from position calculations or plotting
% 09-07-06: Jan Weiss - Cleanup for ASEN5090 Fall 2006 assignment.
%
%
% Colorado Center for Astrodynamics Research
% Copyright 2006 University of Colorado, Boulder
%*******************************************************
function simulation = loadSimulationParameters(filename)
% Load input and simulation
[location, dateStructure, mask, duration, dt, PRN] = loadInput(filename);
% Compute vector of time values
stop_time = dateStructure.TOW + duration(1) * 3600 + duration(2) * 60;
timeVector = [dateStructure.TOW:dt:stop_time]';
% Load almanac data
almanac = getYumaAlmanac(dateStructure);
% Trim PRN list to pertinent values
[PRN, almanac] = trimAlmanac(PRN, almanac);
if isempty(PRN)
errordlg('Almanac data not available for selected PRNs', 'Error');
error('Almanac data not available for selected PRNs');
end
% Populate simulation struct
simulation.location = location;
simulation.dateStructure = dateStructure;
simulation.mask = mask;
simulation.timeVector = timeVector;
simulation.PRN = PRN;
simulation.almanac = almanac;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -