Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gfr-functions
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mdc
gfr-functions
Commits
f05c8202
Commit
f05c8202
authored
8 years ago
by
Axel Schnitger
Browse files
Options
Downloads
Patches
Plain Diff
Added two new m-files.
parent
b8b5d734
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Ri2e.m
+34
-0
34 additions, 0 deletions
Ri2e.m
Ri2srf.m
+38
-0
38 additions, 0 deletions
Ri2srf.m
with
72 additions
and
0 deletions
Ri2e.m
0 → 100644
+
34
−
0
View file @
f05c8202
function
RotMati2e
=
Ri2e
(
grace_gps_time
)
% This function returns the rotation matrix from a (pseudo) inertial frame
% to an Earth-fixed Earth-centered coordinate system. The rotation matrix
% is a simple Z-rotation, in which the rotation axes of the inertial and
% the Earth-fixed frames coincide. It is an approximation of the realistic
% rotation matrix, by neglecting the contribuiton of the Precession,
% Nutation and polar motion.
% INPUT arguments:
% time in GRACE GPS seconds, with size N*1 in which N is the number of time stamps.
% OUTPUT:
% N*3*3 array
% Example:
% grace_gps_time = 281361600
% RotMati2e = 0.341262285804206 0.939968112378121 0
% -0.939968112378121 0.341262285804206 0
% 0 0 1
% Written by Majid Naeimi, August 2015, IfE, Germany
% Contact: naeimi@ife.uni-hannover.de
% Caution: This matrix shall be used only for simulation purposes, in
% particular along with the simulated data available at:
% https://www.geoq.uni-hannover.de/mock.html
Tjd
=
grace_gps_time
/
86400
+
2451545
;
sdt
=
(
Tjd
-
2453491.5
)
*
86400
*
7.29211514670698e-05
-
2.46276246875459
;
rot_mat
=
[
cos
(
sdt
)
-
sin
(
sdt
)
zeros
(
length
(
sdt
),
1
)
...
sin
(
sdt
)
cos
(
sdt
)
zeros
(
length
(
sdt
),
1
)
...
zeros
(
length
(
sdt
),
1
)
zeros
(
length
(
sdt
),
1
)
ones
(
length
(
sdt
),
1
)];
RotMati2e
=
reshape
(
rot_mat
'
,
3
,
3
,[]);
This diff is collapsed.
Click to expand it.
Ri2srf.m
0 → 100644
+
38
−
0
View file @
f05c8202
function
RotMat_i2srf
=
Ri2srf
(
Q
)
% this function computes the rotation matrix from inertial frame to
% satellite reference frame (SRF) based on the given quatrnions Q.
%
% INPUT:
% quaterninons Q = [Q1, Q2, Q3, Q4] ... where Q4 = Q0 = cos(phi/2)
% ... size(Q) = n x 4
% OUTPUT:
% rotation matrix RotMat_i2srf = [3 x 3 x n]
% Written at IfE, Hannover, Germany, April 2010.
% Contact: naeimi@ife.uni-hannover.de
[
a
,
~
]
=
size
(
Q
);
q
=
Q
'
;
AA11
=
q
(
1
,:)
.^
2
-
q
(
2
,:)
.^
2
-
q
(
3
,:)
.^
2
+
q
(
4
,:)
.^
2
;
AA12
=
2
*
(
q
(
1
,:)
.*
q
(
2
,:)
+
q
(
3
,:)
.*
q
(
4
,:));
AA13
=
2
*
(
q
(
1
,:)
.*
q
(
3
,:)
-
q
(
2
,:)
.*
q
(
4
,:));
AA21
=
2
*
(
q
(
1
,:)
.*
q
(
2
,:)
-
q
(
3
,:)
.*
q
(
4
,:));
AA22
=
-
q
(
1
,:)
.^
2
+
q
(
2
,:)
.^
2
-
q
(
3
,:)
.^
2
+
q
(
4
,:)
.^
2
;
AA23
=
2
*
(
q
(
2
,:)
.*
q
(
3
,:)
+
q
(
1
,:)
.*
q
(
4
,:));
AA31
=
2
*
(
q
(
1
,:)
.*
q
(
3
,:)
+
q
(
2
,:)
.*
q
(
4
,:));
AA32
=
2
*
(
q
(
2
,:)
.*
q
(
3
,:)
-
q
(
1
,:)
.*
q
(
4
,:));
AA33
=
-
q
(
1
,:)
.^
2
-
q
(
2
,:)
.^
2
+
q
(
3
,:)
.^
2
+
q
(
4
,:)
.^
2
;
RotMat_i2srf
=
zeros
(
3
,
3
,
a
);
RotMat_i2srf
(
1
,
1
,:)
=
AA11
;
RotMat_i2srf
(
1
,
2
,:)
=
AA12
;
RotMat_i2srf
(
1
,
3
,:)
=
AA13
;
RotMat_i2srf
(
2
,
1
,:)
=
AA21
;
RotMat_i2srf
(
2
,
2
,:)
=
AA22
;
RotMat_i2srf
(
2
,
3
,:)
=
AA23
;
RotMat_i2srf
(
3
,
1
,:)
=
AA31
;
RotMat_i2srf
(
3
,
2
,:)
=
AA32
;
RotMat_i2srf
(
3
,
3
,:)
=
AA33
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment