Skip to content

Commit

Permalink
WIP: work from wednesday and thursday (#7)
Browse files Browse the repository at this point in the history
* Added some L,F,R and M

* Fixed some errors

* Fixed all errors

* Changed some D, E and L

* Added all L functions, lots of errors

* Fixed some errors

* Merge typed search functions

* Finished L

* Update d.jl

* Update e.jl

* Update e.jl

* Update l.jl

* Do not use deprecated functions

* Update l.jl
  • Loading branch information
Adriaenvc authored and helgee committed Nov 30, 2018
1 parent c2b6ad4 commit 7a7f145
Show file tree
Hide file tree
Showing 4 changed files with 606 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 7a7f145

Please sign in to comment.