1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
//
// GENERATED FILE
//
use super::*;
use crate::SpiceContext;
use f2rust_std::*;
const ND: i32 = 2;
const NI: i32 = 5;
/// PCK, unpack segment descriptor
///
/// Unpack the contents of a PCK segment descriptor
///
/// # Required Reading
///
/// * [PCK.](crate::required_reading::pck.)
///
/// # Brief I/O
///
/// ```text
/// VARIABLE I/O DESCRIPTION
/// -------- --- --------------------------------------------------
/// DESCR I A PCK segment descriptor.
/// BODY O The NAIF ID code for the body of the segment.
/// FRAME O The code for the inertial frame of this segment.
/// TYPE O The type of PCK segment.
/// FIRST O The first epoch for which the segment is valid.
/// LAST O The last epoch for which the segment is valid.
/// BEGIN O Beginning DAF address of the segment.
/// END O Ending DAF address of the segment.
/// ```
///
/// # Detailed Input
///
/// ```text
/// DESCR is a PCK segment descriptor.
/// ```
///
/// # Detailed Output
///
/// ```text
/// BODY is the NAIF ID code for the body of the segment.
///
/// FRAME is the SPICE ID code for the inertial frame to which
/// the body fixed orientation is referenced.
///
/// TYPE is the type of PCK segment.
///
/// FIRST is the first epoch for which the segment has
/// orientation data.
///
/// LAST is the last epoch for which the segment has
/// orientation data.
///
/// BEGIN is the starting address of the data associated
/// with this descriptor.
///
/// END is the last address of the data associated with
/// this descriptor.
/// ```
///
/// # Particulars
///
/// ```text
/// This routine extracts the contents of a PCK segment
/// descriptor into the components needed for reading and
/// evaluating the data stored in the segment. It serves
/// as a macro for expanding the PCK segment descriptor.
/// ```
///
/// # Examples
///
/// ```text
/// Suppose you wished to summarize a particular PCK segment
/// and that you have the descriptor for that segment in hand.
/// The following code fragment shows how you might use this
/// routine to create a summary message concerning the segment.
///
/// CALL PCKUDS ( DESCR, BODY, FRAME, TYPE, FIRST, LAST )
///
/// Convert the start and stop times to ephemeris calendar strings
///
/// CALL ETCAL ( FIRST, FSTCAL )
/// CALL ETCAL ( LAST, LSTCAL )
///
/// WRITE (*,*)
/// WRITE (*,*) 'Body : ', BODY
/// WRITE (*,*) 'Frame ID : ', FRAME
/// WRITE (*,*) 'Data Type: ', TYPE
/// WRITE (*,*)
/// WRITE (*,*) 'Segment Start : ', FSTCAL
/// WRITE (*,*) 'Segment Stop : ', LSTCAL
/// ```
///
/// # Author and Institution
///
/// ```text
/// J. Diaz del Rio (ODC Space)
/// E.D. Wright (JPL)
/// ```
///
/// # Version
///
/// ```text
/// - SPICELIB Version 1.0.2, 02-OCT-2021 (JDR)
///
/// Edited the header to comply with NAIF standard.
///
/// - SPICELIB Version 1.0.1, 03-JAN-2014 (EDW)
///
/// Minor edits to $Procedure; clean trailing whitespace.
/// Corrected order of header sections to conform to NAIF
/// standard.
///
/// - SPICELIB Version 1.0.0, 1994-JAN-4 (WLT)
/// ```
pub fn pckuds(
ctx: &mut SpiceContext,
descr: &[f64],
body: &mut i32,
frame: &mut i32,
type_: &mut i32,
first: &mut f64,
last: &mut f64,
begin: &mut i32,
end: &mut i32,
) -> crate::Result<()> {
PCKUDS(
descr,
body,
frame,
type_,
first,
last,
begin,
end,
ctx.raw_context(),
)?;
ctx.handle_errors()?;
Ok(())
}
//$Procedure PCKUDS (PCK, unpack segment descriptor )
pub fn PCKUDS(
DESCR: &[f64],
BODY: &mut i32,
FRAME: &mut i32,
TYPE: &mut i32,
FIRST: &mut f64,
LAST: &mut f64,
BEGIN: &mut i32,
END: &mut i32,
ctx: &mut Context,
) -> f2rust_std::Result<()> {
let DESCR = DummyArray::new(DESCR, 1..);
let mut DPPART = StackArray::<f64, 2>::new(1..=ND);
let mut IPART = StackArray::<i32, 5>::new(1..=NI);
//
// SPICELIB Functions
//
//
// Local Parameters
//
//
// Local Variables
//
//
// Standard SPICELIB error handling.
//
if RETURN(ctx) {
return Ok(());
} else {
CHKIN(b"PCKUDS", ctx)?;
}
//
// No judgments are made about the descriptor when we
// unpack it. If things were done right when the descriptor
// was created, it should be fine now.
//
DAFUS(
DESCR.as_slice(),
ND,
NI,
DPPART.as_slice_mut(),
IPART.as_slice_mut(),
);
if FAILED(ctx) {
CHKOUT(b"PCKUDS", ctx)?;
return Ok(());
}
*BODY = IPART[1];
*FRAME = IPART[2];
*TYPE = IPART[3];
*BEGIN = IPART[4];
*END = IPART[5];
*FIRST = DPPART[1];
*LAST = DPPART[2];
CHKOUT(b"PCKUDS", ctx)?;
Ok(())
}