Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
791e2042
Commit
791e2042
authored
Nov 16, 2021
by
Cédric Traizet
Browse files
ENH: add GetJulianDay and GetModifiedJulianDay methods to TimePoint
parent
7345aadd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Modules/Core/Metadata/include/otbDateTime.h
View file @
791e2042
...
...
@@ -121,6 +121,12 @@ public:
return
lhs
.
m_Time
==
rhs
.
m_Time
;
}
/** Return the julian day corresponding to the time point */
double
GetJulianDay
()
const
;
/** Return the modified julian day corresponding to the time point */
double
GetModifiedJulianDay
()
const
;
friend
TimePoint
&
operator
+=
(
TimePoint
&
u
,
Duration
const
&
v
);
friend
TimePoint
&
operator
-=
(
TimePoint
&
u
,
Duration
const
&
v
);
...
...
Modules/Core/Metadata/src/otbDateTime.cxx
View file @
791e2042
...
...
@@ -60,6 +60,16 @@ std::istream & TimePoint::Read(std::istream & is, const std::string & format)
return
is
;
}
double
TimePoint
::
GetJulianDay
()
const
{
return
(
m_Time
.
time_since_epoch
().
count
()
*
details
::
internalPeriod
)
/
86400.0
+
2440587.5
;
}
double
TimePoint
::
GetModifiedJulianDay
()
const
{
return
(
m_Time
.
time_since_epoch
().
count
()
*
details
::
internalPeriod
)
/
86400.0
+
40587
;
}
double
Duration
::
TotalSeconds
()
const
{
return
m_Duration
.
count
()
*
details
::
internalPeriod
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment