Skip to content

Commit

Permalink
v2.2: debugging; better handling of myAntex.atx; better colors in mul…
Browse files Browse the repository at this point in the history
…ti plots; VMF FC; convergence/accuracy plot
  • Loading branch information
mfglaner committed Oct 6, 2023
1 parent 1fd740b commit e420e91
Show file tree
Hide file tree
Showing 106 changed files with 31,815 additions and 5,504 deletions.
Binary file added CODE/ATMOSPHERE/gpt3_5.mat
Binary file not shown.
File renamed without changes.
4 changes: 2 additions & 2 deletions CODE/ATMOSPHERE/v3gr_grid_adapted.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

% check if the file is available or if it has to be downloaded first, then open it
if ~exist([indir_V3GR_grid '/' num2str(year(1)) '/' filename(1,:)],'file')
mkdir([indir_V3GR_grid '/' num2str(year(1))]);
[~, ~] = mkdir([indir_V3GR_grid '/' num2str(year(1))]);
websave([indir_V3GR_grid '/' num2str(year(1)) '/' filename(1,:)], [url_V3GR_grid '/' num2str(year(1)) '/' filename(1,:)]);
end
dat = fopen([indir_V3GR_grid '/' num2str(year(1)) '/' filename(1,:)]);
Expand All @@ -210,7 +210,7 @@

% check if the file is available or if it has to be downloaded first, then open it
if ~exist([indir_V3GR_grid '/' num2str(year(i_file+1)) '/' filename(i_file,:)],'file')
mkdir([indir_V3GR_grid '/' num2str(year(i_file+1))]);
[~, ~] = mkdir([indir_V3GR_grid '/' num2str(year(i_file+1))]);
websave([indir_V3GR_grid '/' num2str(year(i_file+1)) '/' filename(i_file,:)], [url_V3GR_grid '/' num2str(year(i_file+1)) '/' filename(i_file,:)]);
end
dat = fopen([indir_V3GR_grid '/' num2str(year(i_file+1)) '/' filename(i_file,:)]);
Expand Down
12 changes: 8 additions & 4 deletions CODE/ATMOSPHERE/vmf1_grid_adapted.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [ah, aw, zhd, zwd, VMF1_grid_file] = ...
vmf1_grid_adapted(indir_VMF1_grid, indir_orography, VMF1_grid_file, mjd, lat, lon, h_ell)
vmf1_grid_adapted(indir_VMF1_grid, indir_orography, url_VMF1_grid, VMF1_grid_file, mjd, lat, lon, h_ell)
%
% vmf1_grid_adapted.m
% ATTENTION: This is an adapted version of vmf1_grid.m! It outputs ah and
Expand Down Expand Up @@ -32,6 +32,7 @@
% INPUT:
% o indir_VMF1_grid ... input directory where the yearly subdivided VMF1 gridded files are stored
% o indir_orography ... input directory where the orography_ell file is stored
% o url_V3GR_grid ..... URL from where the gridded VMF1 files are downloaded
% o VMF1_grid_file: ... cell containing filenames, VMF1 data and the orography, which is always passed with the function, must be set to '[]' by the user in the initial run
% o mjd ............... modified Julian date
% o lat ............... ellipsoidal latitude in radians
Expand Down Expand Up @@ -192,12 +193,15 @@

% read the files and collect the data
if length(mjd_all)==1 % if the observation epoch coincides with an NWM epoch
path_file = [indir_VMF1_grid '/' num2str(year(1)) '/' filename(1,:)];
folder = [indir_VMF1_grid num2str(year(1))];
path_file = [folder '/' filename(1,:)];
else
path_file = [indir_VMF1_grid '/' num2str(year(i_file+1)) '/' filename(i_file,:)];
folder = [indir_VMF1_grid num2str(year(i_file+1))];
path_file = [folder '/' filename(i_file,:)];
end
if ~isfile(path_file) % download if not existing
url_file = ['https://vmf.geo.tuwien.ac.at/trop_products/GRID/2.5x2/VMF1/VMF1_OP/' num2str(2023) '/' filename(i_file,:)];
url_file = [url_VMF1_grid num2str(year) '/' filename(i_file,:)];
[~, ~] = mkdir(folder);
websave(path_file, url_file);
end

Expand Down
2 changes: 1 addition & 1 deletion CODE/COMMON/CopyData2Folders.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
% create full path of target folder
target = [datafolder tfolder '/' subf_1 '/' subf_2];
% copy file
mkdir(target);
[~, ~] = mkdir(target);
[success, mess, messID] = copyfile(curr_path, target);
% check if moving was successful
if success
Expand Down
6 changes: 6 additions & 0 deletions CODE/COMMON/DEF.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
% default leap seconds
LEAP_SEC = 18;

% maximal number of inner-epoch iterations
ITERATION_MAX_NUMBER = 15;

% threshold for norm of coordinates to stop inner-epoch iteration
ITERATION_THRESHOLD = 1e-3; % [m]

Expand Down Expand Up @@ -80,6 +83,9 @@
% default processing name
proc_name = 'noname';

% define resolution of gridwise VMF3 (1°x1° or 5°x5°)
VMF3_grid_resolution = 5;

end

methods (Access = public)
Expand Down
4 changes: 2 additions & 2 deletions CODE/OBSERVATIONS/ObservationDownload/DownloadDaily30sEUREF.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
targets = cell(no_days, no_stations);

% Prepare waitbar and print out of epochs to command window
WBAR = waitbar(0, 'Creating list do download data.', 'Name', 'Downloading EUREF Data');
WBAR = waitbar(0, 'Creating list to download data.', 'Name', 'Downloading EUREF Data');

% loop over stations and doys to create the needed variables for the download
for d = 1:no_days
Expand All @@ -80,7 +80,7 @@
targets{d,n} = target;

% create target folder
mkdir(target);
[~, ~] = mkdir(target);

end
end
Expand Down
6 changes: 3 additions & 3 deletions CODE/OBSERVATIONS/ObservationDownload/DownloadDaily30sIGS.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

switch host
case 1
URL_host = 'igs.bkg.bund.de:21';
URL_host = 'igs-ftp.bkg.bund.de:21';
case 2
URL_host = 'https://cddis.nasa.gov'; % typically very complete
case 3
Expand Down Expand Up @@ -74,7 +74,7 @@
targets = cell(no_days, no_stations);

% Prepare waitbar and print out of epochs to command window
WBAR = waitbar(0, 'Creating list do download data.', 'Name', 'Downloading IGS Data');
WBAR = waitbar(0, 'Creating list to download data.', 'Name', 'Downloading IGS Data');

% loop over stations and doys to create the needed variables for the download
for d = 1:no_days
Expand All @@ -100,7 +100,7 @@
targets{d,n} = target;

% create target folder
mkdir(target);
[~, ~] = mkdir(target);

end
end
Expand Down
4 changes: 2 additions & 2 deletions CODE/OBSERVATIONS/ObservationDownload/DownloadHourly01sIGS.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
targets = cell(no_download,1);

% Prepare waitbar and print out of epochs to command window
WBAR = waitbar(0, 'Creating list do download data.', 'Name', 'Downloading IGS Data');
WBAR = waitbar(0, 'Creating list to download data.', 'Name', 'Downloading IGS Data');

% loop over stations and doys to create the needed variables for the download
i = 1;
Expand Down Expand Up @@ -117,7 +117,7 @@
i = i + 1;

% create target folder
mkdir(target);
[~, ~] = mkdir(target);
end
end
end
Expand Down
38 changes: 38 additions & 0 deletions CODE/OBSERVATIONS/ObservationDownload/DownloadRinexFiles.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
function [] = DownloadRinexFiles(rinexfiles)
% This function downloads specified RINEX files from IGS stations.
%
% INPUT:
% rinexfiles cell, each row = RINEX file from IGS station, long filename
% OUTPUT:
% []
%
% Revision:
% ...
%
% This function belongs to raPPPid, Copyright (c) 2023, M.F. Glaner
% *************************************************************************


n = numel(rinexfiles); % number of files to download

% loop over all files to download data
for i = 1:n
curr_file = rinexfiles{i}; % current RINEX file

% extract information from file name
station = curr_file(1:4); % short station name
interval = str2double(curr_file(29:30)); % observation interval
year = str2double(curr_file(13:16)); % year
doy = str2double(curr_file(17:19)); % day of year

% download this file
if interval == 30
DownloadDaily30sIGS(station, doy, year)
elseif interval == 1
DownloadHourly01sIGS.m(station, [], doy, year)
else
% ||| not implemented
end
end


11 changes: 7 additions & 4 deletions CODE/OBSERVATIONS/PhaseWindUp.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@
D_sat = a_sat - los0*dot2(los0,a_sat) - cross2(los0,b_sat);

% Windup of this epoch in [rad]
cosphi = dot2(D_sat,D_rec) / (norm(D_sat)*norm(D_rec));
if cosphi > 1; cosphi = 1; end % occured in PALM1/021/2020, Epoch 2359, prn 221
y = dot2(los0,cross2(D_sat,D_rec));
dphi = sign(y)*acos(cosphi);
cosphi = dot2(D_sat,D_rec) / (norm(D_sat)*norm(D_rec)); % [08]: (14), term of cos^-1
if abs(cosphi) > 1
% occured 2x in my PPP life (e.g., PALM1/021/2020, Epoch 2359, prn 221)
cosphi = sign(cosphi);
end
y = dot2(los0, cross2(D_sat, D_rec)); % [08]: (15)
dphi = sign(y)*acos(cosphi); % [08]: (14), 3rd part (1st and 2nd are added in the following)
DPhi_prev = delta_windup_old*2*pi;
N = round((DPhi_prev - dphi)/(2*pi)); % to avoid jumps
if DPhi_prev == 0; N = 0; end
Expand Down
2 changes: 1 addition & 1 deletion CODE/OBSERVATIONS/calc_GDV.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% n number of processed frequencies
%
% OUTPUT:
% dX_GDV Group Delay Variation correction, add to code observation
% dX_GDV Group Delay Variation correction, add to code observation [m]
%
% Revision:
% ...
Expand Down
8 changes: 3 additions & 5 deletions CODE/OBSERVATIONS/model_observations.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@


%% PHASE
phase_model = [];
if contains(settings.PROC.method,'+ Phase')
idx = (NO_PARAM+1):(NO_PARAM+no_sats*num_freq);
ambig = param(idx);
ambig = reshape(ambig, [length(ambig)/num_freq , num_freq, 1]); % convert to vector
phase_model = model.rho... % theoretical range
- Const.C * model.dT_sat_rel... % satellite and receiver clock
+ model.dt_rx_clock - model.dcbs ... % receiver clock and DCBs
+ model.dt_rx_clock - model.dcbs ... % receiver clock and DCBs
+ model.trop + model.mfw*zwd - iono ... % atmosphere
- model.dX_solid_tides_corr ... % solid tides
- model.dX_ocean_loading ... % ocean loading
Expand All @@ -81,13 +82,12 @@

% eliminate phase observations because of, for example, cutoff angle:
phase_model = phase_model .* ~exclude .* ~Epoch.cs_found;
else
phase_model = [];
end



%% DOPPLER
doppler_model = [];
if contains(settings.PROC.method, 'Doppler') && ~strcmp(settings.PROC.method, 'Code (Doppler Smoothing)')
% get receiver and satellite position and velocity (in ECEF)
rec_p = param(1:3);
Expand All @@ -105,7 +105,5 @@

% exclude satellites because of, for example, cutoff angle:
doppler_model(exclude) = 0;
else
doppler_model = [];
end

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
URL_folder = ['/pub/igs/products/', gpsweek_str, '/'];
URL_file = ['igs' yyyy_str(3:4), 'P', gpsweek_str, dow_str, '.ssc.Z'];
target = pwd;
mkdir(target)
[~, ~] = mkdir(target)
file_status = ftp_download(URL_host, URL_folder, URL_file, target, true);
if file_status == 0
errordlg('Download of IGS coordinates failed', 'Error')
Expand Down
4 changes: 2 additions & 2 deletions CODE/PPP_main.m
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,11 @@


% create results folder
mkdir(settings.PROC.output_dir);
[~, ~] = mkdir(settings.PROC.output_dir);

% write settings from GUI into settings_summary.txt and settings.mat
if settings.EXP.settings_summary
settings2txt(settings, obs, input.OTHER.PCO.rec_error, input.OTHER.PCV.rec_error, tStart);
settings2txt(settings, obs, input, input.OTHER.PCO.rec_error, input.OTHER.PCV.rec_error, tStart);
end
if settings.EXP.settings
save(fullfile(settings.PROC.output_dir, 'settings.mat'),'settings')
Expand Down
9 changes: 5 additions & 4 deletions CODE/PROCESSING/ApproximatePositionFromSats.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
function xyz = ApproximatePositionFromSats(Epoch, input, settings)
% This function calculates an approximate position from the visible
% satellites. Therefore some kind of orbit data is needed. The region where
% the observed satellites are visible is identified and the middle point of
% this region is taken as approximate position.
% satellites (without actual GNSS observations). Therefore some kind of
% orbit data is needed. The region where the observed satellites are
% visible is identified and the middle point ofthis region is taken as
% approximate position.
%
% INPUT:
% Epoch struct, epoch-specific data
% Epoch struct, epoch-specific data
% input struct, input data for processing
% settings struct, settings for processing from GUI
% OUTPUT:
Expand Down
5 changes: 3 additions & 2 deletions CODE/PROCESSING/Designmatrix_ZD.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@
A_iono = [A_iono; A_iono_3];
end
end
A_iono = kron(A_iono,ones(2,1)); % duplicate for phase observation
phase_rows = 2:2:size(A_iono,1); % rows of phase observations
A_iono(Epoch.exclude(:), :) = 0; % remove iono estimation of excluded satellites
A_iono = kron(A_iono,ones(2,1)); % duplicate for phase observation
phase_rows = 2:2:size(A_iono,1); % rows of phase observations
A_iono(phase_rows,:) = -A_iono(phase_rows,:); % change sign for phase observations
% Put Design-Matrix together
A = [A, A_iono];
Expand Down
3 changes: 2 additions & 1 deletion CODE/PROCESSING/Designmatrix_code_ZD.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
A_iono_3 = diag(dR_diono_code_f3);
A_iono = [A_iono; A_iono_3];
end
end
end
A_iono(Epoch.exclude(:), :) = 0; % remove iono estimation of excluded satellites
% Put Design-Matrix together
A = [A, A_iono];
if strcmpi(settings.IONO.model,'Estimate with ... as constraint') && Adjust.constraint
Expand Down
1 change: 1 addition & 0 deletions CODE/PROCESSING/Designmatrix_code_doppler_ZD.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
A_iono = [A_iono; A_iono_3];
end
end
A_iono(Epoch.exclude(:), :) = 0; % remove iono estimation of excluded satellites
% Put Design-Matrix together
A = [A, A_iono];
if strcmpi(settings.IONO.model,'Estimate with ... as constraint') && Adjust.constraint
Expand Down
Loading

0 comments on commit e420e91

Please sign in to comment.