Skip to content

Commit

Permalink
Merge 0eee8c7 into c2b6ad4
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriaenvc authored Nov 30, 2018
2 parents c2b6ad4 + 0eee8c7 commit f4ac042
Show file tree
Hide file tree
Showing 4 changed files with 607 additions and 2 deletions.
40 changes: 39 additions & 1 deletion src/e.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export eul2m
export
eul2m,
et2utc

"""
eul2m(angle3, angle2, angle1, axis3, axis2, axis1)
Expand Down Expand Up @@ -26,3 +28,39 @@ function eul2m(angle3, angle2, angle1, axis3, axis2, axis1)
handleerror()
permutedims(r)
end

"""
et2utc(et, format, prec)
Convert an input time from ephemeris seconds past J2000
to Calendar, Day-of-Year, or Julian Date format, UTC.
### Arguments ###
- `et`: Input epoch, given in ephemeris seconds past J2000
- `format`: Format of output epoch. It may be any of the following:
- `:C`: Calendar format, UTC
- `:D`: Day-of-Year format, UTC
- `:J`: Julian Date format, UTC
- `:ISOC`: ISO Calendar format, UTC
- `:ISOD`: ISO Day-of-Year format, UTC
- `prec`: Digits of precision in fractional seconds or days
### Output ###
Returns an output time string equivalent to the input
epoch, in the specified format.
### References ###
- [NAIF Documentation](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/et2utc_c.html)
"""
function et2utc(et, format, prec)
lenout = 32
utcstr = Array{UInt8}(undef, lenout)
ccall((:et2utc_c, libcspice), Cvoid,
(SpiceDouble, Cstring, SpiceInt, SpiceInt, Ptr{UInt8}),
et, string(format), prec, lenout, utcstr)
handleerror()
unsafe_string(pointer(utcstr))
end
Loading

0 comments on commit f4ac042

Please sign in to comment.