Skip to content

Commit 21bede1

Browse files
authored
Merge branch 'AnalyticalGraphicsInc:master' into master
2 parents 5de86e4 + dda7f92 commit 21bede1

File tree

587 files changed

+80490
-40848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+80490
-40848
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The code examples in this repository are licensed under the AGI Code Examples Li
4747

4848
If You redistribute the code examples, in whole or in part, You must provide a copy of this License Agreement to any other recipient of the code examples, and include the following copyright notice:
4949

50-
© 2021 Analytical Graphics, Inc.
50+
© 2022 Analytical Graphics, Inc.
5151

5252
----
5353

StkAutomation/Html/Problem_Specific/CameraPathZoom.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
// Stop following the selected view, so the view doesn't change when the animation time changes
7878
// Then set the time to the path time which is scaled by the input length
7979
root.ExecuteCommand("VO * CameraControl Follow Off");
80-
root.CurrentTime = pathTime;
80+
root.CurrentTime = pathTime + initialTime;
8181
// Add a keyframe at this time
8282
root.ExecuteCommand("VO * CameraControl Keyframes \"" + newPathInput.value + "\" Add");
8383

StkAutomation/Html/Problem_Specific/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,17 @@ This utility will allow you to select an object and a vector and will create a n
7373
* Scenario: N/A
7474

7575
---
76+
77+
## [SimGen_UMT_Exporter](SimGen_UMT_Exporter)
78+
79+
This utility allows the user to create a SimGEN user motion file (*.umt) for an STK vehicle.
80+
81+
There is an optional configuration file that is white space delimeted containing `START-TIME`, `STOP-TIME`, and `FILE-PATH`. [example configuration file](SimGen_UMT_Exporter/output-config-EXAMPLE.txt)
82+
83+
### Dependencies
84+
85+
* Capabilities: Free
86+
* Other Scripts: N/A
87+
* Scenario: N/A
88+
89+
---

StkAutomation/Matlab/General_Utilities/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ convertTLEState('Satellite1','ePropagatorHPOP')
2020

2121
---
2222

23+
## [create_normalized_frame_sequence.m](create_normalized_frame_sequence.m)
24+
25+
This script takes a folder of eoir raw data files and normalizes the collection. That's because each frame of an EOIR synthetic scene is normalized to itself, so there's color variation in some frames. This script normalizes the collection to the first (or the selected frame).
26+
27+
### Dependencies
28+
29+
* Capabilities: Matlab
30+
* Other Scripts: save_colormapped_image.m
31+
* Scenario: N/A
32+
33+
---
34+
2335
## [createEphemerisFile.m](createEphemerisFile.m)
2436

2537
Creates an ephemeris file for an STK Object in an Analysis Workbench Coordinate System. The script can also automatically create a new object using the new ephemeris file.
@@ -184,6 +196,18 @@ StkHelp(satellite, 'offline')
184196

185197
---
186198

199+
## [save_colormapped_image.m](save_colormapped_image.m)
200+
201+
This script is run from the create_normalized_frame_sequence.m script. It takes the normalized data and saves it as a colormapped image.
202+
203+
### Dependencies
204+
205+
* Capabilities: Matlab
206+
* Other Scripts: create_normalized_frame_sequence.m
207+
* Scenario: N/A
208+
209+
---
210+
187211
## [StkHelp.m](StkHelp.m)
188212

189213
This function will launch the Programming Help documentation page for a given STK handle. The 'offline' flag can be used to open the local Programming Help (optional).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
function [] = create_normalized_frame_sequence(input_folder,output_folder,normalize_to_first,colormap_to_use,scale_up_factor)
2+
if (nargin < 3)
3+
normalize_to_first = 1;
4+
end
5+
6+
if (nargin < 4)
7+
colormap_to_use = colormap;
8+
end
9+
10+
if (nargin < 5)
11+
scale_up_factor = 1;
12+
end
13+
14+
files = dir(input_folder);
15+
num_files = length(files)-2;
16+
if (length(files) <= 2)
17+
disp('Error, no data files found.') ;
18+
return;
19+
end
20+
21+
[~, reindex] = sort( str2double( regexp( {files.name}, '\d+', 'match', 'once' )));
22+
files = files(reindex) ;
23+
24+
i = 1;
25+
file_name = sprintf('%s\\%s',files(i).folder,files(i).name);
26+
a = load(file_name);
27+
28+
if (normalize_to_first || num_files == 1)
29+
min_value = min(a(:))
30+
max_value = max(a(:))
31+
else
32+
min_value = min(a(:))
33+
max_value = max(a(:))
34+
35+
for i=4:num_files+2
36+
file_name = sprintf('%s\\%s',files(i).folder,files(i).name);
37+
a = load(file_name);
38+
39+
temp_min_value = min(a(:));
40+
temp_max_value = max(a(:));
41+
42+
if (temp_min_value < min_value)
43+
min_value = temp_min_value
44+
end
45+
46+
if (temp_max_value > max_value)
47+
max_value = temp_max_value
48+
end
49+
end
50+
end
51+
52+
%disp(min_value);
53+
%disp(max_value);
54+
55+
%min_value = 0.0e+10; #manually setting min
56+
%max_value = 7.0e+10; #manually setting max
57+
58+
disp(min_value);
59+
disp(max_value);
60+
61+
full_value_range = max_value-min_value
62+
bounds(1) = min_value;%+0.001*full_value_range
63+
bounds(2) = max_value-0.1*full_value_range
64+
for i=3:floor(num_files)
65+
file_name = sprintf('%s\\%s',files(i).folder,files(i).name);
66+
disp(file_name)
67+
a = load(file_name);
68+
figure(2);
69+
subplot(1,2,1);
70+
imagesc(a);
71+
subplot(1,2,2);
72+
imagesc(a,bounds);
73+
axis tight equal off;
74+
output_file = sprintf('%s\\output_frame_%06d.jpg',output_folder,i-2)
75+
76+
% Processing image here
77+
powerscale = .3;
78+
a(a<0) = 0;
79+
a = a.^powerscale;
80+
81+
bounds(1) = 0;
82+
bounds(2) = max_value^powerscale;
83+
84+
if (scale_up_factor == 1)
85+
save_colormapped_image(a, colormap_to_use, output_file, bounds);
86+
elseif (scale_up_factor > 1)
87+
save_colormapped_image(a(1:1/scale_up_factor:end,1:1/scale_up_factor:end), colormap_to_use, output_file, bounds);
88+
end
89+
90+
% pause(0.1);
91+
end
92+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function [] = save_colormapped_image(image_data, c_map, image_file_to_write, bounds)
2+
if nargin < 4
3+
bounds(1) = min(image_data(:)) ;
4+
bounds(2) = max(image_data(:)) ;
5+
end
6+
7+
ncolors = size(c_map, 1);
8+
scaled_image = (image_data-bounds(1))/(bounds(2)-bounds(1));
9+
mapped_image = uint8(scaled_image.*(ncolors-1));
10+
11+
imwrite(mapped_image,c_map,image_file_to_write);
12+
end
Loading
Loading

0 commit comments

Comments
 (0)