Data container and its handling interfaces
Frames
Frames
is the module that handles data container for attitude frame representation. Please visit frames for notation and detailed explanation of the attitude frame representation
FlexibleSpacecraft.Frames.Frame
— Typestruct Frame(x::Vector{Real}, y::Vector{Real}, z::Vector{Real})
Struct of immutable vectors that express the coordinate frame of a certain state
Base.:*
— MethodBase. :*(C::Union{SMatrix{3, 3, <:Real}, Matrix{<:Real}}, refframe::Frame)::Frame
Calculate the transformed frame with transformation matrix C
with respect to refframe
Base.:-
— MethodBase.:-(a::Frame, b::Frame)::Frame
Subtraction operator for struct Frame
.
FlexibleSpacecraft.Frames.ECI2BodyFrame
— MethodECI2BodyFrame
Calculate the transformation matrix from ECI frame to spacecraft body-fixed frame.
Arguments
q::SVector{4, Float64}
: vector of the quaternion
Return
C_ECI2BRF::SMatrix{3, 3, Float64}
: transformation matrix
FlexibleSpacecraft.Frames.getframe
— Methodgetframe(time, sampling_period, coordinates::FrameArray)
get a sampledframe::Frame
matching with given time
FlexibleSpacecraft.Frames.initframes
— Methodinitframes(datanum, initial_coordinate::Frame)
initialize data container of time-variant coordinate frame
DataContainers
DataContainers.jl
is the set of function that deals with the handling of all the necessary data container of the simulation.
This submodule also includes the multiple dispatch for the ::AbstractVector{<:AbstractVector}
type data container used for simulation. Please be noted that you may need to pay attention to this feature when you manually code your simulation using the ::AbstractVector{<:AbstractVector}
type variables.
Base.getindex
— MethodBase.getindex(v::AbstractVector{<:AbstractVector}, r::Int, datarow::Int)
get datarow
-th element of the r
-th vector in the v::AbstractVector{<:AbstractVector}
Example
> angularvelocity # ::AbstractVector{<:AbstractVector}
10-element Vector{Vector{Int64}}:
[1, 2, 3]
[1, 2, 3]
⋮
[1, 2, 3]
[1, 2, 3]
> angularvelocity[1]
3-element Vector{Int64}: # get the first vector
1
2
3
> angularvelocity[3, 2] # get the 2st element of the 3rd vector of the `angularvelocity`
2
Base.getindex
— MethodBase.getindex(v::AbstractVector{<:AbstractVector}, r::AbstractRange, datarow::Int)
get a 1-D subset of the every datarow
-th value of the inner vector v::AbstractVector{<:AbstractVector}
within the specified range r::AbstractRange
.
Example
> angularvelocity # ::AbstractVector{<:AbstractVector}
10-element Vector{Vector{Int64}}:
[1, 2, 3]
[1, 2, 3]
⋮
[1, 2, 3]
[1, 2, 3]
> angularvelocity[1]
3-element Vector{Int64}: # get the first vector
1
2
3
> angularvelocity[1:5, 1] # get the 1st element of the 1st to 5th vector of the
5-element Vector{Int64}:
1
1
1
1
1
FlexibleSpacecraft.DataContainers.timerange2indexrange
— Methodtimerange2indexrange(timerange::Tuple{<:Real, <:Real}, samplingtime::Real)::Union{UnitRange{Int64}, Colon}
returns an index::::Union{UnitRange{Int64}, Colon}
that corresponding to the given timerange::Tuple{<:Real, <:Real}
FlexibleSpacecraft.DataContainers.timerange2indexrange
— Methodtimerange2indexrange(timerange::Tuple{<:Real, <:Real}, time::StepRangeLen)::Union{UnitRange{Int64}, Colon}
returns an index::::Union{UnitRange{Int64}, Colon}
that corresponding to the given timerange::Tuple{<:Real, <:Real}