Skip to content

Commit 7396587

Browse files
committed
finish cube generator chapter
1 parent def23ed commit 7396587

File tree

1 file changed

+62
-38
lines changed

1 file changed

+62
-38
lines changed

12_cube_gen.md

Lines changed: 62 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ author: E. Todd Bradley
44
(sec:cube_gen)=
55
# Cube Generator
66

7-
:::{note} Chapter conversion status
8-
Text was copied raw, figures and tables still missing.
9-
:::
10-
117
## Introduction <!-- 12.1 -->
128

139
Cube Generator (CG) is an IDL widget to read and process raw Cassini UVIS data files,
1410
and combine the processed data with geometric parameters as calculated by Josh Colwell’s
15-
Geometer Engine into an _Image Cube_ for use in further investigations. Users are given a variety
16-
of options regarding the processing of the data and geometer options. This document provides a
17-
reference and tutorial for new users to CG. After a brief introduction and comments regarding
18-
the installation and compiling of CG, the tutorial is written in the order a typical user would use
19-
to create an image cube from raw data.
11+
Geometer Engine into an _Image Cube_ for use in further investigations.
12+
Users are given a variety of options regarding the processing of the data and geometer options.
13+
This document provides a reference and tutorial for new users to CG.
14+
After a brief introduction and comments regarding the installation and compiling of CG, the tutorial is
15+
ritten in the order a typical user would use to create an image cube from raw data.
2016

2117
## Installation <!-- 12.2 -->
2218

@@ -31,11 +27,13 @@ been renamed to avoid confusion or conflict with previously extant code.
3127
Cube Generator requires at least IDL 5.5 and the ICY spice interface, available from
3228
ftp://naif.jpl.nasa.gov/pub/naif/toolkit/IDL/.
3329
To run CG, compile and run **_cube_generator.pro_** , either from the command line or via
34-
the IDL development environment. If successful, the following widget will be realized (Figure
35-
12.1).
30+
the IDL development environment. If successful, the following widget will be realized ({ref}`fig:cg_options`).
3631

37-
```
38-
Figure 12.1: Base level menu for Cube Generator.
32+
```{figure} figures/fig_12.1.png
33+
:label: "fig:cg_options"
34+
:width: 75%
35+
:align: left
36+
Base level menu for Cube Generator.
3937
```
4038

4139
On the left half of the widget, a series of inputs and menu buttons provide access to the
@@ -54,6 +52,7 @@ label file must be downloaded and placed in the same directory as the data file.
5452
image cube from a single data file, simply click on the ‘Input Single File’ button. A file selection
5553
dialog will open allowing the user to navigate to where the file is saved on their computer and
5654
select it for input.
55+
5756
In the case of an observation that consists of more than one raw file, the user will select
5857
the ‘Input Batch File’ button. The program is asking for a text file that lists the names of all the
5958
data files to be combined into a single cube _in the order they are listed in the file._ Cube
@@ -65,10 +64,13 @@ of a text file.
6564
## Output Formats <!-- 12.5 -->
6665

6766
Selecting the ‘Output Formats’ button will change the menu options on the left half of the
68-
Cube Generator widget as follows (see Figure 12.2).
67+
Cube Generator widget as follows (see {ref}`fig:cg_output`).
6968

70-
```
71-
Figure 12.2: File Output options menu
69+
```{figure} figures/fig_12.2.png
70+
:label: "fig:cg_output"
71+
:width: 75%
72+
:align: left
73+
File Output options menu
7274
```
7375

7476
Users have the option of outputting the image cube in four basic formats; ‘Envi’,
@@ -81,12 +83,15 @@ to reset an IDL session after the creation of each cube due to changing structur
8183
strongly suggested that users create cubes in the ‘Improved’ format.** For further details on
8284
the structure of both the ‘Original’ and ‘Improved’ save file formats, see Appendix 1 at the end
8385
of the document.
86+
8487
The ‘ENVI’ output format creates an image cube and associated header that can be read
8588
by the _ENVI_ image processing package. _ENVI_ is an IDL extension that must be purchased
8689
separately from ITT.
90+
8791
Finally, the ‘Binary’ output format is simply a binary array of double float values. Note
8892
that there is no information in the Binary format to inform a user as to the dimensions of the
8993
included data.
94+
9095
The ‘Output File’ button will open a selection dialog that allows the user to select the
9196
name and location where the image cube will be written.
9297
When the user has selected the output format and file names, press return to change the menu
@@ -97,12 +102,14 @@ back to the base screen (Figure 12.1).
97102
Back at the base level menu, the user has a few options that relate to the calculation of the
98103
geometric parameters or the processing of the raw data. These options are generally left at their
99104
default state, though some special cases may require their modification.
105+
100106
First, the boxed sub-menu labeled ‘Aberation’. This option affects how Geometer will
101107
calculate the geometric parameters. The default setting of ‘LT’ commands geometer to calculate
102108
the state variables as corrected for light-time. ‘None’ does not correct for light-time and ‘LT+S’
103109
corrects for light-time and stellar aberrations. For many observations, the difference between
104110
aberration states would likely be negligible. However, given the possible non-negligible effect on
105111
some calculations, the ‘LT’ correction is set as default.
112+
106113
To the right of the aberration box is the time segment box. Users may select any
107114
combination of three discrete times within an integration period to retrieve geometry.
108115
“Beginning” is at the start of the integration period, “Middle” is at half of an integration period,
@@ -111,40 +118,45 @@ For each time period, a separate structure will be returned, denoted by “datas
111118
datastruct2, and datastruct2_final, for the three time periods, with geometry within each for the
112119
selected time periods. If a time period is not selected, then that particular structure contains a
113120
zero.
121+
114122
Below the aberration selection menu is a box used to select the pointing reference, which
115123
may be Solar, c kernel (the default setting), or Star. In the case of Solar or Star the pointing of
116124
the instrument is referenced to the vector between the instrument and either the Sun or a star. If
117125
“Star” is selected an input box appears requiring that the name of the star be entered.
126+
118127
Below the pointing box is a check-box that allows the user to select between two types of
119128
background subtraction, RTG or spectral average. If RTG is selected, the text box will become
120-
121-
122129
active and, if the user chooses, a new RTG noise value may be entered. Cube Generator will
123130
subtract from each pixel an RTG noise level based on this value and the integration length of
124131
each observation record. **If a new RTG correction value is entered, the user MUST press
125132
return for IDL to record the new value.** If “Spectral Average” is selected the user must enter
126133
upper and lower spectral bounds, which results in the average of the raw counts over that spectral
127134
interval to be subtracted from the raw counts.
135+
128136
Below the “Background Subtraction” box lies another check-box labeled ‘Override
129137
Kernel Check?’. If selected, this will force CG to continue and make an image cube despite
130138
errors from the called SPICE routines that indicate insufficient kernel data to calculate geometric
131139
information. Generally, it is in the users interest to allow C-kernel errors to interrupt CG,
132140
however there are some cases in which an error may be ignored.
133-
Below the “Override Kernel Check” is a pull down ‘Target Name’ menu, as shown in
134-
Figure 12.3. The user is required to manually select the _Target_ relative to which Geometer will
141+
142+
Below the “Override Kernel Check” is a pull down ‘Target Name’ menu, as shown in {ref}`fig:cg_target`.
143+
The user is required to manually select the _Target_ relative to which Geometer will
135144
calculate the relevant parameters. If no target is selected (or the Ra/Dec target is selected without
136145
changing the values to the right), CG will declare an error and interrupt the image cube creation
137146
process. If the user wants to calculate parameters relative to a fixed Ra/Dec value, select Ra/Dec
138147
as the target and modify the values to the right of the pull down menu (remembering to hit return
139148
in each field to register the changes with IDL).
140149

141-
```
142-
Figure 12.3: Target Name pull-down menu.
150+
```{figure} figures/fig_12.3.png
151+
:label: "fig:cg_target"
152+
:width: 100%
153+
:align: left
154+
Target Name pull-down menu.
143155
```
144156

145157
## Flatfielding Options <!-- 12.7 -->
146158

147-
For general use, this menu (Figure 12.4) will not need to be accessed. The default setting
159+
For general use, this menu ({ref}`fig:cg_flatfield`) will not need to be accessed. The default setting
148160
will process the raw data according to the team-sponsored procedure. The default processing
149161
scheme corrects the raw data by the following steps.
150162

@@ -157,42 +169,54 @@ scheme corrects the raw data by the following steps.
157169
5. Export corrected data.
158170

159171
Should a user want to eliminate of modify any of the steps above, the _Ala Carte_ menu
160-
exists to allow flexibility and is accessed by deselecting the ‘Full Flatfielding Routine’,
161-
Figure12. 4.
172+
exists to allow flexibility and is accessed by deselecting the ‘Full Flatfielding Routine’ in {ref}`fig:cg_flatfield`.
162173

163-
```
164-
Figure 12.4: Flatfielding Processing Menu
174+
```{figure} figures/fig_12.4.png
175+
:label: "fig:cg_flatfield"
176+
:width: 100%
177+
:align: left
178+
Flatfielding Processing Menu
165179
```
166180
The _Ala Carte_ flatfielding menu allows the user to select which ground calibration to
167181
apply, 1997, 1999, 2003, or 2004, whether to apply the Red Patch, how to handle NaN’s, and
168-
169-
170182
which flatfield to use. The calibration and flatfields both have the multiplicative modifiers
171183
applied to them.
184+
172185
Some options within the _Ala Carte_ menu preclude other selections. For instance,
173186
selection of the “No NaNs (Ian Stewart)” flatfield will override the user’s selection of a ‘NaN
174187
Handling Approach’ as those selections no longer have any meaning. Similarly, choosing to
175188
apply no calibration will automatically disable the FUV Red Patch, regardless of whether the
176189
patch was selected to be applied by the user from the Flatfielding menu.
190+
177191
Each of the choices under the ‘Calibration Choice’ refer to the year of a lab calibration. If
178192
the 1999 lab calibration (the default setting) is selected, and the inputted data set is an FUV
179193
observation, the derived correction factor of 0.91 is applied automatically. Selection of any of the
180194
other calibrations WILL NOT have a correction factor applied.
195+
181196
If the user checks the box next to the ‘Override all Options?’ label, NO calibrations or
182197
flatfields will be applied to the data. The output in this case would be simply raw data and the
183198
geometric information.
184199

185200
## SPICE Kernels <!-- 12.8 -->
186201

187-
The SPICE Kernel Options menu (Figure 12.5) provides a series of tools to manage the
202+
The SPICE Kernel Options menu ({ref}`fig:cg_spice`) provides a series of tools to manage the
188203
SPICE kernels accessed by Geometer to calculate the geometric parameters included in the
189204
image cube. SPICE kernels loaded into memory via the ICY routines stay resident in memory
190205
until IDL is shut down. Resetting the IDL session **DOES NOT** clear SPICE kernels from
191206
memory. Thus, when processing a large number of files, it is possible to have many, and possibly
192207
conflicting, kernels loaded.
208+
209+
```{figure} figures/fig_12.5.png
210+
:label: "fig:cg_spice"
211+
:width: 100%
212+
:align: left
213+
SPICE Kernel Options menu.
214+
```
215+
193216
The first option in this menu will list all the SPICE kernels currently in memory in the
194217
right hand text box. This is useful for when CG aborts due to a C-kernel error. Examining the
195218
loaded kernels may identify the missing kernel.
219+
196220
To load a single kernel into memory, user the ‘Load a Kernel’ button. A file selection
197221
dialog will open and, if successful, the Processing Status box will confirm loading of the kernel.
198222
The user may also load a series of kernels simultaneously via the ‘Load Kernel Batch’ button.
@@ -201,14 +225,12 @@ contains the paths and names of the desired kernels. And, as with the single ker
201225
option, a successful operation will be indicated in the status box. Alternatively the user may
202226
choose to load spice kernels independently of Cube Generator as long as the kernels are loaded
203227
into the numerical processing software (e.g., IDL) before running Cube Generator.
228+
204229
Finally, the ‘Unload All Kernels’ button will force IDL to clear all SPICE kernels from
205230
memory. If you are concerned that the wrong kernel might be used to calculate the geometry, use
206231
this to clear memory and then re-load the specific kernels you want to use.
207232

208233

209-
```
210-
Figure 12.5: SPICE Kernel Options menu.
211-
```
212234
A quick note about the loading of SPICE kernels. The ICY interface **requires** that the
213235
first kernel in memory be the leap second correction kernel (LSK). Thus, when loading, make
214236
sure that is either the first loaded or the first entry in the text batch file. In addition, the latest
@@ -230,9 +252,9 @@ displayed.
230252
At the base level menu, there are two final buttons that haven’t been described. Both are
231253
so self-explanatory that they shouldn’t require any mention, but to be insanely complete, a few
232254
words.
233-
‘Help’ opens an abridged version of this document within the widget framework for
255+
- ‘Help’ opens an abridged version of this document within the widget framework for
234256
quick reference as needed.
235-
‘Exit’ exits.
257+
- ‘Exit’ exits.
236258

237259

238260
## Examples of Restoring the Contents of Variables <!-- 12.11 -->
@@ -241,18 +263,20 @@ Suppose that one needs to look at the calibrated data, denoted by the variable n
241263
“UVIS” and compare this to the pixel center longitude determined at the middle of the
242264
integration period. In IDL the code would be written as follows:
243265

266+
```{code} idl
244267
Restore,filename
245268
UVIS = datastruct2.UVIS
246269
Pixel_center_longitude = datastruct2.pixel_center_longitude
247-
270+
```
248271
Alternatively suppose one needs to look at the raw counts and compare this to the pixel center
249272
phase angle for geometry determined at the beginning of the integration period. In IDL the code
250273
would be as follows:
251274

275+
```idl
252276
Restore,filename
253277
Rawcounts = datastruct2_initial.rawcounts
254-
Pixel_center_phase_angle =
255-
datastruct2_initial.pixel_center_phase_angle
278+
Pixel_center_phase_angle = datastruct2_initial.pixel_center_phase_angle
279+
```
256280

257281
By default, the number of spatial pixels is 64 and the number of spectral pixels is 1024.
258282
However observations do not always make use of all of the spatial or spectral pixels depending

0 commit comments

Comments
 (0)