-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmvn_kp_3d.pro
2935 lines (2689 loc) · 134 KB
/
mvn_kp_3d.pro
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;+
; :Name: mvn_kp_3d
;
; Copyright 2017 Regents of the University of Colorado. All Rights Reserved.
; Released under the MIT license.
; This software was developed at the University of Colorado's Laboratory for Atmospheric and Space Physics.
; Verify current version before use at: https://lasp.colorado.edu/maven/sdc/public/pages/software.html
; :Author: Kristopher Larsen
;
; :Description:
; Interactive 3D visualization of MAVEN spacecraft trajectory
; and insitu/iuvs KP parameters.
;
; :Params:
; insitu: in, required, type=structure
; This is the full or maniuplated MAVEN KP insitu data structure.
; At a minimum, it must contain the SPACECRAFT substructure.
; iuvs: in, optional, type=structure
; time: in, optional,
; can be a scalar or a two or three item array of type:
; long(s) orbit number
; string(s) format: YYYY-MM-DD/hh:mm:ss
; If only one time provided, that defines the initial display point of
; the visualization.
; Two times provided are assumed to be start and stop times.
; Three times provided are start/display/stop times.
;
; basemap: in, optional, type=string
; the name of the basemap to display. If not included, then lat/lon
; grid is shown .
; 'MDIM': The Mars Digital Image Model.
; 'MOLA': Mars Topography in color.
; 'MOLA_BW': Mars topography in black and white.
; 'MAG': Mars crustal magnetism.
; 'DUST': IUVS Apopase Dust index image.
; 'OZONE': IUVS Apopase Ozone index image.
; 'RAD_H': IUVS Apopase H Radiance image.
; 'RAD_O': IUVS Apopase O Radiance image.
; 'RAD_CO': IUVS Apopase CO Radiance image.
; 'RAD_NO': IUVS Apopase NO Radiance image.
; 'USER': User definied basemap. Will open a file dialog window
; to select the image.
; parameter: in, optional, type=string
; The name of the parameter to initiall plot in the widget window
; minimum: in, optional, type=float
; The minimum value to assign to color level 0
; maximum: in, optional, type=float
; The maximum value to assign to color level 255
; bgcolor: in, optional, type=byte or bytarr(3)
; Define the background color for the widget window.
; If single byte value, assign a gray between 0(black) and 255(white)
; If three-element bytarr, it is the RGB color vector
; color_bar: in, optional, type=bytearr(3) or boolean
; If provided as a boolean, display color bar upon opening window.
; Define the text color for the color bar in the plotting subwindow
; as an RGB vector.
; showplot: in, optional, type=boolean or structure
; If boolean, display the chosen parameter or S/C altitude at the
; bottom of the widget window.
; If a structure, it provides the information to create the plot
; ambient: in, optional, type=float
; Define the intensity of the flashlight that mimics sunlight.
; Be aware, a setting of 0.0 does NOT create a crisp terminator.
; initialview: in, optional, type=fltarr(3) or fltarr(5)
; Define the initial view of the planet. The fields are:
; latitude, longitude, radius [,x offset, y offset]
; scale_factor: in, optional, type=float
; Scale down the widget window for smaller screens. As of now, this
; also reduces button sizes, so a small enough value could render
; the widget unuseable.
; spacecraft_scale: in, optional, type=float
; Change the scale size of the MAVEn S/C. Default value is 0.03
;
; :Keywords:
; list: in, optional, type=boolean
; if selected, will list the parameters included in kp_data.
; range: in, optional, type=boolean
; if selected, will list the beginning and end times of kp_data.
; subsolar: in, optional, type=boolean
; if selected, will plot the subsolar point with a yellow disk.
; sunmodel: in, optional, type=boolean
; if selected, will plot the Mars-Sun vector as a yellow line.
; submaven: in, optional, type=boolean
; if selected, will plot the sub S/C point with a blue disk.
; grid: in, optional, type=boolean
; if selected overplot lat/lon grid with 30/45 deg res respectively
; mso: in, optional, type=boolean
; if selected, plot the S/C track and data in MSO coordinates
; axes: in, optional, type=boolean
; if selected, plot the XYZ axes in the widget window. MSO or GEO.
; log: in, optional, type=boolean
; if selected, use log scale for all visualizations
; optimize: in, optional, type=boolean
; For large data structures, the plotting of the orbital track can
; get very slow. This keyword decimates the track to a managable size.
; direct: in, optional, type=boolean
; if selected, create direct graphics plots with no widget ability.
; help: Invoke this list.
;
; :Obsolete:
; drawid: Undetermined and unused keyword or parameter
; speckle: Undetermined and unused keyword or parameter
;-
pro MVN_KP_3D, insitu, iuvs=iuvs, time=time, basemap=basemap, grid=grid, $
cow=cow, tron=tron, subsolar=subsolar, submaven=submaven, $
; field=field, minimum=minimum, maximum=maximum, $
parameter=parameter, $
colorbar_min=colorbar_min, colorbar_max=colorbar_max, $
log=log, color_table=color_table, bgcolor=bgcolor, $
plotname=plotname, color_bar=color_bar,axes=axes,$
whiskers=whiskers,showplot=showplot,$
periapse_limb_scan=periapse_limb_scan, direct=direct, $
ambient=ambient,view_size=view_size, camera_view=camera_view, $
mso=mso, sunmodel=sunmodel, optimize=optimize, $
initialview=initialview, drawid=drawid, $
scale_factor=scale_factor, spacecraft_scale=spacecraft_scale, $
speckle=speckle, range=range, list=list, help=help, $
maven_sphere=maven_sphere, maven_color=maven_color, $
path=path, maven_size=maven_size
common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
;provide help for those who don't have IDLDOC installed
if keyword_set(help) then begin
mvn_kp_get_help,'mvn_kp_3d'
return
endif
;CHECK THE insitu1 DATA STRUCTURE FOR RELEVANT FIELDS
MVN_KP_TAG_PARSER, insitu, base_tag_count, first_level_count, $
second_level_count, base_tags, first_level_tags, $
second_level_tags
;variables to be added to command line at some points
apoapse_image_choice = 'Ozone Depth' ; ????
;correction for IDL 'features' in 8.1
if Float(!Version.Release) LE 8.1 THEN BEGIN
;USE DIRECT GRAPHICS IF USER HAS OLD VERSION OF IDL
orbit_offset = 0.00001
endif else begin
orbit_offset = 0.001
endelse
;LIST OF ALL POSSIBLE PLOTABLE PARAMETERS IF /LIST IS SET
if keyword_set(list) then begin
if arg_present(list) then begin
; return the KP list to the provided variable
mvn_kp_get_list, kp_data, list=list
endif else begin
; print the KP list to screen
mvn_kp_get_list, kp_data, /list
endelse
return
endif
;PROVIDE THE TEMPORAL RANGE OF THE DATA SET IN BOTH DATE/TIME AND ORBITS
;IF REQUESTED.
if keyword_set(range) then begin
mvn_kp_range,insitu,iuvs=iuvs
return
endif
;OPTIMIZATION OPTION
if keyword_set(optimize) then begin
; For now, just use the optimization to ~5000 points
; if( size(optimize,/type) eq 3 or size(optimize,/type) eq 4 or $
; size(optimize,/type) eq 5 )then begin
; only proceed if the optimization value is given as an integer
; data type or integer-like data type (byte, int, long)
; May expand to uint, etc. at a future date
; optimizer = optimize
; endif else begin
; print,"*****WARNING*****"
; print,"Use of 'optimize=<value>' recognized ONLY if value is of '
; print,"type BYTE, INT, or LONG."
; endelse
optimizer = round(n_elements(insitu[begin_index:end_index])/5000.)
MVN_KP_3D_OPTIMIZE, insitu, insitu1, optimizer
endif else begin
insitu1 = insitu;[begin_index:end_index]
endelse
;PARSE DATA STRUCTURES FOR BEGINNING, END, AND MID TIMES
;SET THE TIME BOUNDS BASED ON THE INSITU DATA STRUCTURE
;**************************************************
; *******NEED TO RESIZE IUVS CORRECTLY AS WELL******
; **************************************************
time_step_size = 10
if( keyword_set(time) )then begin
case size(time,/dim) of
0: mvn_kp_range_select, insitu1, time, begin_index, end_index
1: mvn_kp_range_select, insitu1, time, begin_index, end_index
2: mvn_kp_range_select, insitu1, time, begin_index, end_index
3: begin
; can only accept this if input values are string or float date
; range_select takes care of types other than INT
if( size(time,/type) ne 2)then begin
time=time[sort(time)] ; sort the three
; Feed largest and smallest to range_select
mvn_kp_range_select, insitu1, [time[0],time[2]], $
begin_index, end_index
endif else begin
error_message = 'If three times are provided, ' $
+ 'they must be either strings or floats.'
message, error_message
endelse
end
else: begin
; print error message and exit
error_message = 'Number of elements provided in time ' $
+ 'variable cannot exceed 3.'
message, error_message
end
endcase
endif else begin
; time keyword is not set, use the whole data structure
begin_index = 0L
end_index = n_elements(insitu1)-1; if time keyword is used
endelse
;
; Use begin and end index to subset the input datra structure
;
insitu1 = insitu1[begin_index:end_index]
;
; Redefine the begin and end indices
;
begin_index = 0L & end_index = n_elements(insitu1)-1
;
; Now, define the opening view time for the widget window
;
if( size(time,/dim) eq 3 )then begin
; open view time has been provided
if( size(time,/type) eq 7 )then begin ; time is a string
time_index = value_locate( insitu1.time_string, time[1] )
endif else begin ; time is a UNIX time
time_index = value_locate( insitu1.time, time[1] )
endelse
endif else begin
; open view time not provided: use mid-time
time_index = end_index / 2L
endelse
;
; Now define the strings and times needed for widget display windows
;
start_time = insitu1[begin_index].time
end_time = insitu1[end_index].time
start_time_string = time_string( start_time, format=0 )
end_time_string = time_string( end_time, format=0 )
initial_time = insitu1[time_index].time
;PARSE DATA STRUCTURES FOR KP DATA AVAILABILITY
;flags to indicate if a given instrumnet data is present
instrument_array = intarr(19)
tags=tag_names(insitu1)
temp = where(tags eq 'LPW')
if temp ne -1 then instrument_array[0] = 1
temp = where(tags eq 'STATIC')
if temp ne -1 then instrument_array[1] = 1
temp = where(tags eq 'SWIA')
if temp ne -1 then instrument_array[2] = 1
temp = where(tags eq 'SWEA')
if temp ne -1 then instrument_array[3] = 1
temp = where(tags eq 'MAG')
if temp ne -1 then instrument_array[4] = 1
temp = where(tags eq 'SEP')
if temp ne -1 then instrument_array[5] = 1
temp = where(tags eq 'NGIMS')
if temp ne -1 then instrument_array[6] = 1
temp = where(tags eq 'EUV')
if temp ne -1 then instrument_array[18] = 1
if keyword_set(iuvs) then begin
instrument_array[7] = 1
tags1 = tag_names(iuvs)
temp = where(tags1 eq 'PERIAPSE')
if temp ne -1 then begin
if iuvs[0].periapse[0].time_start ne '' then begin
instrument_array[8] = 1
endif
endif
temp = where(tags1 eq 'APOAPSE')
if temp ne -1 then begin
if iuvs[0].APOAPSE[0].time_start ne '' then begin
instrument_array[9] = 1
endif
endif
temp = where(tags1 eq 'CORONA_E_HIGH')
if temp ne -1 then begin
if iuvs[0].CORONA_E_HIGH[0].time_start ne '' then begin
instrument_array[10] = 1
endif
endif
temp = where(tags1 eq 'CORONA_E_DISK')
if temp ne -1 then begin
if iuvs[0].CORONA_E_DISK[0].time_start ne '' then begin
instrument_array[11] = 1
endif
endif
temp = where(tags1 eq 'STELLAR_OCC')
if temp ne -1 then begin
instrument_array[12] = 0
endif
temp = where(tags1 eq 'CORONA_LO_HIGH')
if temp ne -1 then begin
if iuvs[0].CORONA_LO_HIGH[0].time_start ne '' then begin
instrument_array[13] = 1
endif
endif
temp = where(tags1 eq 'CORONA_LO_LIMB')
if temp ne -1 then begin
if iuvs[0].CORONA_LO_LIMB[0].time_start ne '' then begin
instrument_array[14] = 1
endif
endif
temp = where(tags1 eq 'CORONA_E_LIMB')
if temp ne -1 then begin
if iuvs[0].CORONA_E_LIMB[0].time_start ne '' then begin
instrument_array[15] = 1
endif
endif
temp = where(tags1 eq 'CORONA_LO_DISK')
if temp ne -1 then begin
if iuvs[0].CORONA_LO_DISK[0].time_start ne '' then begin
instrument_array[16] = 1
endif
endif
endif
temp = where(tags eq 'USER')
if temp ne -1 then instrument_array[17] = 1
;PARSE COMMAND LINE OPTIONS FOR INITIAL CONDITIONS
;DEFINE THE BASEMAP
install_result = routine_info('mvn_kp_3d',/source)
install_directory = strsplit(install_result.path,'mvn_kp_3d.pro',$
/extract,/regex)
;BACKGROUND COLORS
;-ToDo: these are gray scale bu they are being offered in widget as rainbow
bg_colors = [[0,0,0],[15,15,15],[30,30,30],[45,45,45],[60,60,60],$
[75,75,75],[90,90,90],[105,105,105],[120,120,120],$
[135,135,135],[150,150,150],[165,165,165],[180,180,180],$
[195,195,195],[210,210,210],[225,225,225],[240,240,240],$
[255,255,255]]
if keyword_set(bgcolor) then begin
if n_elements(bgcolor) eq 3 then begin
backgroundcolor = bgcolor
endif else begin
if( bgcolor lt 0 or bgcolor gt 255)then begin
print,'** WARNING **'
print,' BGCOLOR supplied: ',bgcolor,' is invalid.'
print,' Must be either an integer between 0 and 255,'
print,' or a three-element [R,G,B] byte array'
print,' Code will now default to bgcolor=0 (black)'
backgroundcolor = 0
endif else begin
backgroundcolor = replicate(bgcolor,3)
endelse
endelse
endif else begin
backgroundcolor = [15,15,15]
endelse
if keyword_set(parameter) then begin
;if parameter not selected, pass an invalid value
MVN_KP_TAG_VERIFY, insitu1, parameter, base_tag_count, $
first_level_count, base_tags, $
first_level_tags, check, level0_index, $
level1_index, tag_array
if check ne 0 then begin
;if requested parameter doesn't exist, default to none
print,'REQUESTED PLOT PARAMETER, '+strtrim(string(parameter),2) $
+' IS NOT PART OF THE DATA STRUCTURE.'
plotted_parameter_name = ''
current_plotted_value = ''
level0_index = -9
level1_index = -9
endif else begin
plotted_parameter_name = tag_array[0]+':'+tag_array[1]
current_plotted_value = insitu1[time_index]$
.(level0_index).(level1_index)
endelse
endif else begin
;if no parameter selected, default to spacecraft altitude
parameter='spacecraft.altitude'
MVN_KP_TAG_VERIFY, insitu1, parameter, base_tag_count, $
first_level_count, base_tags, $
first_level_tags, check, level0_index, $
level1_index, tag_array
plotted_parameter_name = tag_array[0]+':'+tag_array[1]
current_plotted_value = insitu1[time_index]$
.(level0_index).(level1_index)
endelse
;default colorbar settings
if( ~arg_present(colorbar_max) )then $
colorbar_max = max(insitu1.(level0_index).(level1_index),/NaN) ; 100.
if (~arg_present(colorbar_min) )then $
colorbar_min = min(insitu1.(level0_index).(level1_index),/NaN) ;0.0
colorbar_stretch = keyword_set(log) ; 0
;camera viewpoint:
; 0=default free view camera,
; 1=spacecraft view locked camera
if keyword_set(camera_view) ne 1 then begin
camera_view = 0
endif
;parse the input iuvs structure (if it exists)
;to see which coronal observations are present
if instrument_array[7] eq 1 then begin
mvn_kp_3d_iuvs_parse, iuvs, instrument_array, e_disk_list=e_disk_list, $
e_limb_list=e_limb_list, e_high_list, lo_disk_list=lo_disk_list, $
lo_limb_list=lo_limb_list, lo_high_list=lo_high_list
endif
;If there is an error, replace above with the contents of
; mvn_kp_3d_iuvs_parse, with an additional bracketing of
; if instrument_array[7] eq 1 then begin
; ...
; endif
;SET WHETHER GEO OR MSO COORDINATES ARE USED
if keyword_set(mso) then begin
coord_sys = 1
endif else begin
coord_sys = 0
endelse
;BUILD THE WIDGET
if keyword_set(scale_factor) then begin
scale_factor = scale_factor
endif else begin
scale_factor = 1.0
endelse
;set the size of the draw window
if keyword_set(view_size) then begin
draw_xsize = scale_factor*view_size[0]
draw_ysize = scale_factor*view_size[1]
endif else begin
draw_xsize=scale_factor*800
draw_ysize=scale_factor*800
endelse
base = widget_base(title='MAVEN Key Parameter Visualization',/column)
subbase = widget_base(base,/row)
;BASE AND VISUALIZATION WINDOW
subbaseL = widget_base(subbase)
draw = widget_draw(subbaseL, xsize=scale_factor*draw_xsize, $
ysize=scale_factor*draw_ysize, graphics_level=2, $
/button_events, /motion_events, /wheel_events, $
uname='draw',retain=0, renderer=0)
if keyword_set(direct) then drawid=base
if keyword_set(direct) eq 0 then begin
;SKIP THIS IF /DIRECT IS SET, SKIPPING THE GUI INTERFACE
;TOP LEVEL MENU
subbaseR = widget_base(subbase)
subbaseR1 = widget_base(subbaseR,/column)
button1 = widget_button(subbaseR1, value='Mars/Label Options', $
uname='mars',xsize=scale_factor*300, $
ysize=scale_factor*30)
button1 = widget_button(subbaseR1, value='In-Situ Scalar Data', $
uname='insitu', xsize=scale_factor*300, $
ysize=scale_factor*30)
if( (instrument_array[1] eq 1) or $
(instrument_array[2] eq 1) or $
(instrument_array[4] eq 1) or $
(instrument_array[5] eq 1) )then begin
button1 = widget_button(subbaseR1, value='In-Situ Vector Data', $
uname='insitu_vector', $
xsize=scale_factor*300,ysize=scale_factor*30)
endif
if instrument_array[7] eq 1 then begin
button1 = widget_button(subbaseR1, value='IUVS Data', uname='iuvs', $
xsize=scale_factor*300, ysize=scale_factor*30)
endif
button1 = widget_button(subbaseR1, value='Viewing Geometries', $
uname='views', xsize=scale_factor*300, $
ysize=scale_factor*30)
button1 = widget_button(subbaseR1, value='Models', uname='models', $
xsize=scale_factor*300,ysize=scale_factor*30)
button1 = widget_button(subbaseR1, value='Outputs', uname='output', $
xsize=scale_factor*300,ysize=scale_factor*30)
button1 = widget_button(subbaseR1, value='Animation', $
uname='animation', xsize=scale_factor*300, $
ysize=scale_factor*30)
widget_control,button1,sensitive=0
button1 = widget_button(subbaseR1, value='Help', uname='help',$
xsize=scale_factor*300,ysize=scale_factor*30)
;TIME BAR ACROSS THE BOTTOM
tbase = widget_base(base,/row)
timebarbase = widget_base(tbase, /column,/frame, /align_left, $
xsize=scale_factor*1000)
;PROVIDES LATER ABILITY TO CHANGE AND UPDATE START/END TIMES
time_min=start_time
time_max = end_time
timelabelbase = widget_base(timebarbase, xsize=scale_factor*1000, $
ysize=scale_factor*20, /row)
label5 = $
widget_label(timelabelbase, $
value=strtrim(string(time_string(time_min,format=4)),2), $
scr_xsize=scale_factor*200, /align_left)
label6 = widget_label(timelabelbase, value='Time Range', /align_center, $
scr_xsize=scale_factor*590)
label7 = $
widget_label(timelabelbase, $
value=strtrim(string(time_string(time_max,format=4)),2), $
scr_xsize=scale_factor*200, /align_right)
timeline = cw_fslider(timebarbase, /drag, maximum=time_max, $
minimum=time_min, /double, uname='time', $
title='Displayed Time',xsize=scale_factor*1000, $
/edit,/suppress_value)
tbase1 = widget_base(tbase,/column,/align_center)
label1 = widget_label(tbase1, value='Step Size')
text1 = widget_text(tbase1, value=strtrim(string(time_step_size),2), $
uname='timestep_define',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
/align_center)
tbase2 = widget_base(tbase1,/row)
button1 = widget_button(tbase2, value='-', uname='timeminusone',$
xsize=scale_factor*50)
button1 = widget_button(tbase2, value='+', uname='timeplusone',$
xsize=scale_factor*50)
widget_control,timeline,set_value=initial_time
;MARS GLOBE/LABEL OPTIONS MENU
subbaseR2 = widget_base(subbaseR,/column)
marsbase = widget_base(subbaseR2,/column)
;BASEMAP OPTIONS
button1 = widget_button(marsbase, value='Spacecraft Orbit Track', $
uname='orbit_onoff', xsize=scale_factor*300, $
ysize=scale_factor*30)
label1 = widget_label(marsbase, value='Basemap')
basemapbase = widget_base(marsbase, /column,/frame,/exclusive)
button1 = widget_button(basemapbase, value='MDIM',uname='basemap1',$
xsize=scale_factor*300,ysize=scale_factor*30, $
/no_release)
; mars_base_map = 'mdim' ;-km I think this is unnecessary.
;-km The following control command sets the MDIM button.
;-km This is in error if the basemap keyword is set.
;-km It should set the button of the chosen basemap; default to MDIM.
widget_control,button1, /set_button
button1 = widget_button(basemapbase, value='MOLA',uname='basemap1',$
xsize=scale_factor*300,ysize=scale_factor*30, $
/no_release)
button1 = widget_button(basemapbase, value='MOLA_BW',uname='basemap1',$
xsize=scale_factor*300,ysize=scale_factor*30, $
/no_release)
button1 = widget_button(basemapbase, value='CRUSTAL MAG',$
uname='basemap1',xsize=scale_factor*300,$
ysize=scale_factor*30, /no_release)
button1 = widget_button(basemapbase, value='BLANK',uname='basemap1',$
xsize=scale_factor*300,ysize=scale_factor*30, $
/no_release)
button1 = widget_button(basemapbase, value='User Defined',$
uname='basemap1',xsize=scale_factor*300,$
ysize=scale_factor*30, /no_release)
;LABEL OPTIONS
label2 = widget_label(marsbase, value='Label Options')
gridbase = widget_base(marsbase, /column,/frame)
button2 = widget_button(gridbase, value='Grid',uname='grid', $
xsize=scale_factor*300,ysize=scale_factor*30)
button2 = widget_button(gridbase, value='Sub-Solar Point', $
uname='subsolar',xsize=scale_factor*300,$
ysize=scale_factor*30)
button2 = widget_button(gridbase, value='Sub-Spacecraft', $
uname='submaven', xsize=scale_factor*300,$
ysize=scale_factor*30)
button2 = widget_button(gridbase, value='Terminator', $
uname='terminator', xsize=scale_factor*300,$
ysize=scale_factor*30,sensitive=0)
button2 = widget_button(gridbase, value='Sun Vector', $
uname='sunvector', xsize=scale_factor*300, $
ysize=scale_factor*30)
button2 = widget_button(gridbase, value='Planet Axes', uname='axes', $
xsize=scale_factor*300, ysize=scale_factor*30)
button2 = widget_button(gridbase, value='Parameters', $
uname='parameters', xsize=scale_factor*300, $
ysize=scale_factor*30)
button2 = widget_button(gridbase, value='Plotted Values', $
uname='orbitPlotName', xsize=scale_factor*300, $
ysize=scale_factor*30)
;COLOR OPTIONS
label2 = widget_label(marsbase, value='Background Color Options')
gridbase1 = widget_base(marsbase,/column,/frame)
loadct,13,/silent
bgcolor = cw_clr_index(gridbase1, uname ='background_color',$
color_values=bg_colors,xsize=scale_factor*210,$
ysize=scale_factor*30)
;ambient light slider
label2 = widget_label(marsbase, value='Ambient Light Level')
slider2 = widget_slider(marsbase, frame=2, maximum=100, minimum=0, $
xsize=scale_factor*300,ysize=scale_factor*33,$
uname='ambient', value=50)
button2 = widget_button(marsbase, value='Return',uname='mars_return', $
xsize=scale_factor*300,ysize=scale_factor*30)
;VIEWING GEOMETRY OPTIONS MENU
subbaseR3 = widget_base(subbaseR,/column)
label3 = widget_label(subbaseR3, value='Camera Options', /align_center)
subbaseR3a = widget_base(subbaseR3,/column,/exclusive,/frame)
button3a = widget_button(subbaseR3a, value='Free-view Camera', $
uname='camera', xsize=scale_factor*300, $
ysize=scale_factor*30, /no_release)
if camera_view eq 0 then widget_control, button3a, /set_button
button3b = widget_button(subbaseR3a, value='Spacecraft Camera', $
uname='camera', xsize=scale_factor*300, $
ysize=scale_factor*30, /no_release)
if camera_view eq 1 then widget_control, button3b, /set_button
label3 = widget_label(subbaseR3,value='Coordinate Systems', $
/align_center)
subbaseR3b = widget_base(subbaseR3,/column,/exclusive,/frame)
button3c = widget_button(subbaseR3b, value='Planetocentric', $
uname='coordinates', xsize=scale_factor*300,$
ysize=scale_factor*30,/no_release)
if coord_sys eq 0 then widget_control,button3c, /set_button
button3d = widget_button(subbaseR3b, value='Mars-Sun', $
uname='coordinates', xsize=scale_factor*300,$
ysize=scale_factor*30,/no_release)
if coord_sys eq 1 then widget_control, button3d, /set_button
widget_control,subbaseR3a, sensitive=0
button3 = widget_button(subbaseR3, value='Return',uname='view_return', $
xsize=scale_factor*300,ysize=scale_factor*30)
;MODEL DISPLAY OPTIONS
subbaseR4 = widget_base(subbaseR, /column)
label4 = widget_label(subbaseR4, value='Atmosphere Shells', $
/align_center)
modbase1 = widget_base(subbaseR4, /row,/frame)
button4 = widget_button(modbase1, value='Level 1', uname='atmLevel1', $
xsize=scale_factor*70, ysize=scale_factor*30)
button41c = widget_button(modbase1, value='Load', $
uname='atmLevel1Load',xsize=scale_factor*50, $
ysize=scale_factor*30,sensitive=0)
atmLevel1height = 100
button41a = widget_text(modbase1, $
value=strtrim(string(atmlevel1height),2), $
uname='atmLevel1height',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase1, value='km')
atmlevel1alpha = 100
button41b = widget_text(modbase1, $
value=strtrim(string(atmlevel1alpha),2), $
uname='atmLevel1alpha', /editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase1, value='%')
modbase2 = widget_base(subbaseR4, /row,/frame)
button4 = widget_button(modbase2, value='Level 2', uname='atmLevel2', $
xsize=scale_factor*70, ysize=scale_factor*30)
button42c = widget_button(modbase2, value='Load', $
uname='atmLevel2Load',xsize=scale_factor*50, $
ysize=scale_factor*30,sensitive=0)
atmLevel2height = 200
button42a = widget_text(modbase2, $
value=strtrim(string(atmlevel2height),2), $
uname='atmLevel2height',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase2, value='km')
atmlevel2alpha = 100
button42b = widget_text(modbase2, $
value=strtrim(string(atmlevel2alpha),2), $
uname='atmLevel2alpha', /editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase2, value='%')
modbase3 = widget_base(subbaseR4, /row,/frame)
button4 = widget_button(modbase3, value='Level 3', uname='atmLevel3', $
xsize=scale_factor*70, ysize=scale_factor*30)
button43c = widget_button(modbase3, value='Load', $
uname='atmLevel3Load',xsize=scale_factor*50, $
ysize=scale_factor*30,sensitive=0)
atmLevel3height = 300
button43a = widget_text(modbase3, $
value=strtrim(string(atmlevel3height),2), $
uname='atmLevel3height',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase3, value='km')
atmlevel3alpha = 100
button43b = widget_text(modbase3, $
value=strtrim(string(atmlevel3alpha),2), $
uname='atmLevel3alpha', /editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase3, value='%')
modbase4 = widget_base(subbaseR4, /row,/frame)
button4 = widget_button(modbase4, value='Level 4', uname='atmLevel4', $
xsize=scale_factor*70, ysize=scale_factor*30)
button44c = widget_button(modbase4, value='Load', $
uname='atmLevel4Load',xsize=scale_factor*50, $
ysize=scale_factor*30,sensitive=0)
atmLevel4height = 400
button44a = widget_text(modbase4, $
value=strtrim(string(atmlevel4height),2), $
uname='atmLevel4height',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase4, value='km')
atmlevel4alpha = 100
button44b = widget_text(modbase4, $
value=strtrim(string(atmlevel4alpha),2), $
uname='atmLevel4alpha', /editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase4, value='%')
modbase5 = widget_base(subbaseR4, /row,/frame)
button4 = widget_button(modbase5, value='Level 5', uname='atmLevel5', $
xsize=scale_factor*70, ysize=scale_factor*30)
button45c = widget_button(modbase5, value='Load', $
uname='atmLevel5Load',xsize=scale_factor*50, $
ysize=scale_factor*30,sensitive=0)
atmLevel5height = 500
button45a = widget_text(modbase5, $
value=strtrim(string(atmlevel5height),2), $
uname='atmLevel5height',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase5, value='km')
atmlevel5alpha = 100
button45b = widget_text(modbase5, $
value=strtrim(string(atmlevel5alpha),2), $
uname='atmLevel5alpha', /editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase5, value='%')
modbase6 = widget_base(subbaseR4, /row,/frame)
button4 = widget_button(modbase6, value='Level 6', uname='atmLevel6', $
xsize=scale_factor*70, ysize=scale_factor*30)
button46c = widget_button(modbase6, value='Load', $
uname='atmLevel6Load',xsize=scale_factor*50, $
ysize=scale_factor*30,sensitive=0)
atmLevel6height = 600
button46a = widget_text(modbase6, $
value=strtrim(string(atmlevel6height),2), $
uname='atmLevel6height',/editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase6, value='km')
atmlevel6alpha = 100
button46b = widget_text(modbase6, $
value=strtrim(string(atmlevel6alpha),2), $
uname='atmLevel6alpha', /editable,$
xsize=scale_factor*7,ysize=scale_factor*1,$
sensitive=0)
label4 = widget_label(modbase6, value='%')
button4 = widget_button(subbaseR4, value='Return',uname='model_return', $
xsize=scale_factor*300,ysize=scale_factor*30)
;OUTPUT OPTIONS
subbaseR5 = widget_base(subbaseR, /column)
button5 = widget_button(subbaseR5, value='Save Configuration',$
uname='config_save',xsize=scale_factor*300, $
ysize=scale_factor*30)
button5 = widget_button(subbaseR5, value='Load Configuration',$
uname='config_load',xsize=scale_factor*300, $
ysize=scale_factor*30)
button5 = widget_button(subbaseR5, value='Export View',$
uname='save_view',xsize=scale_factor*300,$
ysize=scale_factor*30)
button5 = widget_button(subbaseR5, value='Return',$
uname='output_return', $
xsize=scale_factor*300,ysize=scale_factor*30)
;HELP MENU
subbaseR6 = widget_base(subbaseR, /column)
text = widget_text(subbaseR6, /scroll,xsize=scale_factor*45,$
ysize=scale_factor*25)
button6 = widget_button(subbaseR6, value='Return', $
uname='help_return',xsize=scale_factor*300, $
ysize=scale_factor*30)
;insitu1 SCALAR DATA MENU
subbaseR7 = widget_base(subbaseR, /column)
subbaseR7a = widget_base(subbaseR7, /column,/frame)
label7 = widget_label(subbaseR7a, value='Orbital Track Plots')
vert_align = 15
if instrument_array[0] eq 1 then begin
lpw_list = tag_names(insitu1.lpw)
drop1=widget_droplist(subbaseR7a, value=lpw_list, uname='lpw_list', $
title='LPW',frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[18] eq 1 then begin
euv_list = tag_names(insitu1.euv)
drop1=widget_droplist(subbaseR7a, value=euv_list, uname='euv_list', $
title='EUV',frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[1] eq 1 then begin
static_list = tag_names(insitu1.static)
drop1=widget_droplist(subbaseR7a, value=static_list, $
uname='static_list', title='STATIC', $
frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[2] eq 1 then begin
swia_list = tag_names(insitu1.swia)
drop1=widget_droplist(subbaseR7a, value=swia_list, $
uname='swia_list', title='SWIA', frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[3] eq 1 then begin
swea_list = tag_names(insitu1.swea)
drop1=widget_droplist(subbaseR7a, value=swea_list, $
uname='swea_list', title='SWEA', frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[4] eq 1 then begin
mag_list = tag_names(insitu1.mag)
drop1=widget_droplist(subbaseR7a, value=mag_list, uname='mag_list', $
title='MAG', frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[5] eq 1 then begin
sep_list = tag_names(insitu1.sep)
drop1=widget_droplist(subbaseR7a, value=sep_list, $
uname='sep_list', title='SEP', frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[6] eq 1 then begin
ngims_list = tag_names(insitu1.ngims)
drop1=widget_droplist(subbaseR7a, value=ngims_list, $
uname='ngims_list', title='NGIMS', frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[17] eq 1 then begin
user_list = tag_names(insitu1.user)
drop1=widget_droplist(subbaseR7a, value=user_list, $
uname='user_list', title='User', frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
button7 = widget_button(subbaseR7a, value='Reset Orbit Colors', $
uname='orbit_reset', yoffset=vert_align)
button7 = widget_button(subbaseR7, value='Plot',uname='overplots', $
xsize=scale_factor*300,ysize=scale_factor*30)
subbaseR7c = widget_base(subbaseR7, /column, /frame)
button7 = widget_button(subbaseR7c, value='ColorTable',$
uname='colortable',xsize=scale_factor*300,$
ysize=scale_factor*30)
button7 = widget_button(subbaseR7c, value = 'Color Bar', $
uname='ColorBarPlot', xsize=scale_factor*300, $
ysize=scale_factor*30)
subbaseR7c2 = widget_base(subbaseR7c, /row)
label7 = widget_label(subbaseR7c2, value='Color Bar Title')
text7 = widget_text(subbaseR7c2, value='', $
/editable,xsize=scale_factor*3,$
uname='colorbar_title', scr_xsize=300)
subbaseR7d = widget_base(subbaseR7c, /row)
label7 = widget_label(subbaseR7d, value='Min')
text7 = widget_text(subbaseR7d, value=strtrim(string(colorbar_min),2), $
/editable,xsize=scale_factor*3,$
uname='colorbar_min', scr_xsize=60)
label7 = widget_label(subbaseR7d, value='Max')
text7 = widget_text(subbaseR7d, value=strtrim(string(colorbar_max),2), $
/editable,xsize=scale_factor*3,$
uname='colorbar_max', scr_xsize=60)
button7 = widget_button(subbaseR7d, value='Reset', $
uname='colorbar_reset')
subbaseR7e = widget_base(subbaseR7d, /row,/exclusive)
button7a = widget_button(subbaseR7e, value='Linear', $
uname='colorbar_stretch', /no_release)
widget_control, button7a, /set_button
button7 = widget_button(subbaseR7e, value='Log', $
uname='colorbar_stretch', /no_release)
button7 = widget_button(subbaseR7, value='Return',$
uname='insitu_return',$
xsize=scale_factor*300,ysize=scale_factor*30)
;insitu1 VECTOR DATA MENU
subbaseR10 = widget_base(subbaseR, /column)
button10 = widget_button(subbaseR10, value='Display Vector Data', $
uname='vector_display',$
xsize=scale_factor*300,ysize=scale_factor*30)
subbaseR10a = widget_base(subbaseR10, /column)
subbaseR10b = widget_base(subbaseR10a, /column,/frame)
vector_list = strarr(9)
vector_list_index = 0
if instrument_array[4] eq 1 then begin
vector_list[vector_list_index] = 'Magnetic Field'
vector_list_index = vector_list_index + 1
endif
if instrument_array[2] eq 1 then begin
vector_list[vector_list_index] = 'SWIA H+ Flow Velocity'
vector_list_index = vector_list_index + 1
endif
if instrument_array[1] eq 1 then begin
vector_list[vector_list_index] = 'STATIC O2+ Flow Velocity'
vector_list_index = vector_list_index + 1
vector_list[vector_list_index] = 'STATIC H+ Char Dir'
vector_list_index = vector_list_index + 1
vector_list[vector_list_index] = 'STATIC Dom Ion Char Dir'
vector_list_index = vector_list_index + 1
endif
if instrument_array[5] eq 1 then begin
vector_list[vector_list_index] = 'SEP Look Direction 1 Front'
vector_list_index = vector_list_index + 1
vector_list[vector_list_index] = 'SEP Look Direction 1 Back'
vector_list_index = vector_list_index + 1
vector_list[vector_list_index] = 'SEP Look Direction 2 Front'
vector_list_index = vector_list_index + 1
vector_list[vector_list_index] = 'SEP Look Direction 2 Back'
vector_list_index = vector_list_index + 1
endif
vector_list = vector_list[0:vector_list_index-1]
drop1=widget_droplist(subbaseR10b, value=vector_list, $
uname='vector_field',title='Vector Field',$
frame=5)
label10 = widget_label(subbaseR10a, $
value='Vector Scale Factor, Percent')
slider10 = widget_slider(subbaseR10a, frame=2, maximum=100, $
minimum=1, xsize=scale_factor*300, $
ysize=scale_factor*33,uname='vec_scale', $
value=100)
vector_scale = 1.0
subbaseR10c = widget_base(subbaseR10, /column,/frame)
label10 = widget_label(subbaseR10c, value='Vector Magnitude Colors')
vert_align = 15
if instrument_array[0] eq 1 then begin
lpw_list = tag_names(insitu1.lpw)
drop1=widget_droplist(subbaseR10c, value=lpw_list, $
uname='lpw_list_vec',title='LPW',frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[18] eq 1 then begin
euv_list = tag_names(insitu1.euv)
drop1=widget_droplist(subbaseR10c, value=euv_list, $
uname='euv_list_vec', title='EUV', frame=5, $
yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[1] eq 1 then begin
static_list = tag_names(insitu1.static)
drop1=widget_droplist(subbaseR10c, value=static_list, $
uname='static_list_vec', title='STATIC', $
frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[2] eq 1 then begin
swia_list = tag_names(insitu1.swia)
drop1=widget_droplist(subbaseR10c, value=swia_list, $
uname='swia_list_vec', title='SWIA', $
frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[3] eq 1 then begin
swea_list = tag_names(insitu1.swea)
drop1=widget_droplist(subbaseR10c, value=swea_list, $
uname='swea_list_vec', title='SWEA', $
frame=5, yoffset=vert_align)
vert_align = vert_align + 15
endif
if instrument_array[4] eq 1 then begin
mag_list = tag_names(insitu1.mag)
drop1=widget_droplist(subbaseR10c, value=mag_list, $
uname='mag_list_vec', title='MAG', $
frame=5, yoffset=vert_align)
vert_align = vert_align + 15