Skip to content

Commit 9e41daa

Browse files
authored
Merge pull request #5 from opensatelliteproject/BugFixes
Bug Fixes
2 parents 32bb063 + 8ce3ea8 commit 9e41daa

File tree

6 files changed

+46
-24
lines changed

6 files changed

+46
-24
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
GOES LRIT Dumper
1+
GOES xRIT Dumper
22
=========================
33

44
This program receives a TCP Stream from decoder and decodes the channel in realtime generating .lrit files. It also depends on **decompressor.exe** and will run wine to decompress the lrit files.
55

66
With all **LRIT** files, you can use [xrit2pic](http://www.alblas.demon.nl/wsat/software/soft_msg.html).
77

8-
![GOES Dump](screenshot.png)
8+
![GOES Dump](screenshot.png)

goesdump.userprefs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<Properties StartupItem="goesdump/GOES Dumper.csproj" RefactoringSettings.EnableRefactorings="True">
22
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
3-
<MonoDevelop.Ide.Workbench ActiveDocument="goesdump/UIComponents/Constellation.cs">
3+
<MonoDevelop.Ide.Workbench ActiveDocument="goesdump/ChannelDecoder/Demuxer.cs">
44
<Files>
55
<File FileName="goesdump/Main.cs" Line="1" Column="1" />
6-
<File FileName="goesdump/UIComponents/Constellation.cs" Line="1" Column="1" />
6+
<File FileName="goesdump/UIComponents/Constellation.cs" Line="16" Column="9" />
77
<File FileName="goesdump/UIComponents/CurrentFrameData.cs" Line="1" Column="1" />
88
<File FileName="goesdump/GoesDecoder/Connector.cs" Line="1" Column="1" />
9+
<File FileName="goesdump/ChannelDecoder/Demuxer.cs" Line="12" Column="1" />
10+
<File FileName="goesdump/GoesDecoder/PacketManager.cs" Line="209" Column="17" />
911
</Files>
1012
</MonoDevelop.Ide.Workbench>
1113
<MonoDevelop.Ide.DebuggingService.Breakpoints>

goesdump/ChannelDecoder/DemuxManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ public DemuxManager() {
1414
public void parseBytes(byte[] data) {
1515
int vcid = (data[1] & 0x3F);
1616
if (vcid != FILL_VCID) {
17-
/*if (vcid == 0 || vcid == 1) {
17+
if (vcid == 0 || vcid == 1) {
1818
// Skip DCS and EMWIN
1919
return;
20-
}*/
20+
}
21+
2122
if (vcid == 31) { // Skip DCS for HRIT
2223
return;
2324
}

goesdump/GoesDecoder/PacketManager.cs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ public static string Decompressor(string filename, int pixels) {
218218
UIConsole.GlobalConsole.Error(String.Format("Error Decompressing: {0}", stderr));
219219
} else {
220220
UIConsole.GlobalConsole.Debug(String.Format("Decompress sucessful to {0}", String.Format("{0}_decomp.lrit", filename)));
221+
try {
222+
File.Delete(filename);
223+
} catch (Exception e) {
224+
Console.WriteLine("Cannot delete file {0}", filename);
225+
}
221226
}
222227

223228
} catch (Exception e) {
@@ -234,13 +239,19 @@ public static string Decompressor(string prefix, int pixels, int startnum, int e
234239
Process decompressor = new Process();
235240
ProcessStartInfo startInfo = new ProcessStartInfo();
236241
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
237-
startInfo.FileName = "wine";
238-
startInfo.Arguments = String.Format("Decompress.exe {0} {1} {2} {3} a", prefix, pixels, startnum + 1, endnum);
242+
if (Tools.IsLinux) {
243+
startInfo.FileName = "wine";
244+
startInfo.Arguments = String.Format("Decompress.exe {0} {1} {2} {3} a", prefix, pixels, startnum + 1, endnum);
245+
startInfo.EnvironmentVariables.Add("WINEDEBUG", "fixme-all,err-winediag");
246+
} else {
247+
startInfo.FileName = "Decompress.exe";
248+
startInfo.Arguments = String.Format("{0} {1} {2} {3} a", prefix, pixels, startnum + 1, endnum);
249+
}
250+
239251
startInfo.RedirectStandardError = true;
240252
startInfo.RedirectStandardOutput = true;
241253
startInfo.CreateNoWindow = true;
242254
startInfo.UseShellExecute = false;
243-
startInfo.EnvironmentVariables.Add("WINEDEBUG", "fixme-all,err-winediag");
244255

245256
decompressor.StartInfo = startInfo;
246257

@@ -253,6 +264,14 @@ public static string Decompressor(string prefix, int pixels, int startnum, int e
253264
UIConsole.GlobalConsole.Error(String.Format("Error Decompressing: {0}", stderr));
254265
} else {
255266
UIConsole.GlobalConsole.Debug(String.Format("Decompress sucessful to {0}", String.Format("{0}_decomp{1}.lrit", prefix, startnum)));
267+
for (int i=startnum; i<endnum+1; i++) {
268+
string f = string.Format("{0}{1}.lrit", prefix, i);
269+
try {
270+
File.Delete(f);
271+
} catch (Exception e) {
272+
Console.WriteLine("Error deleting file {0}", f);
273+
}
274+
}
256275
}
257276

258277
} catch (Exception e) {

goesdump/PacketData/Presets.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ static Presets() {
3030
noaaProducts.Add((int)NOAAProductID.DCS, new NOAAProduct(NOAAProductID.DCS, "DCS"));
3131

3232
noaaProducts.Add((int)NOAAProductID.SCANNER_DATA_1, new NOAAProduct(NOAAProductID.SCANNER_DATA_1, "Scanner Image", new Dictionary<int, NOAASubproduct>() { // So far, only received GOES 13 images. Coecidence?
33-
{ (int) ScannerSubProduct.NONE, new NOAASubproduct(ScannerSubProduct.NONE, "N(int) one") },
34-
{ (int) ScannerSubProduct.INFRARED_FULLDISK, new NOAASubproduct(ScannerSubProduct.INFRARED_FULLDISK, "I(int) nfrared Full Disk") },
35-
{ (int) ScannerSubProduct.INFRARED_NORTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_NORTHERN, "I(int) nfrared Northern Hemisphere") },
36-
{ (int) ScannerSubProduct.INFRARED_SOUTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_SOUTHERN, "I(int) nfrared Southern Hemisphere") },
37-
{ (int) ScannerSubProduct.INFRARED_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.INFRARED_UNITEDSTATES, "I(int) nfrared United States") },
38-
{ (int) ScannerSubProduct.INFRARED_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.INFRARED_AREA_OF_INTEREST, "I(int) nfrared Area of Interest") },
39-
{ (int) ScannerSubProduct.VISIBLE_FULLDISK, new NOAASubproduct(ScannerSubProduct.VISIBLE_FULLDISK, "V(int) isible Full Disk") },
40-
{ (int) ScannerSubProduct.VISIBLE_NORTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_NORTHERN, "V(int) isible Northern Hemisphere") },
41-
{ (int) ScannerSubProduct.VISIBLE_SOUTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_SOUTHERN, "V(int) isible Southern Hemisphere") },
42-
{ (int) ScannerSubProduct.VISIBLE_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.VISIBLE_UNITEDSTATES, "V(int) isible United States") },
43-
{ (int) ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, "V(int) isible Area of Interest") },
44-
{ (int) ScannerSubProduct.WATERVAPOUR_FULLDISK, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_FULLDISK, "W(int) ater Vapour Full Disk") },
45-
{ (int) ScannerSubProduct.WATERVAPOUR_NORTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_NORTHERN, "W(int) ater Vapour Northern Hemisphere") },
46-
{ (int) ScannerSubProduct.WATERVAPOUR_SOUTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_SOUTHERN, "W(int) ater Vapour Southern Hemisphere") },
47-
{ (int) ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, "W(int) ater Vapour United States") },
33+
{ (int) ScannerSubProduct.NONE, new NOAASubproduct(ScannerSubProduct.NONE, "None") },
34+
{ (int) ScannerSubProduct.INFRARED_FULLDISK, new NOAASubproduct(ScannerSubProduct.INFRARED_FULLDISK, "Infrared Full Disk") },
35+
{ (int) ScannerSubProduct.INFRARED_NORTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_NORTHERN, "Infrared Northern Hemisphere") },
36+
{ (int) ScannerSubProduct.INFRARED_SOUTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_SOUTHERN, "Infrared Southern Hemisphere") },
37+
{ (int) ScannerSubProduct.INFRARED_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.INFRARED_UNITEDSTATES, "Infrared United States") },
38+
{ (int) ScannerSubProduct.INFRARED_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.INFRARED_AREA_OF_INTEREST, "Infrared Area of Interest") },
39+
{ (int) ScannerSubProduct.VISIBLE_FULLDISK, new NOAASubproduct(ScannerSubProduct.VISIBLE_FULLDISK, "Visible Full Disk") },
40+
{ (int) ScannerSubProduct.VISIBLE_NORTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_NORTHERN, "Visible Northern Hemisphere") },
41+
{ (int) ScannerSubProduct.VISIBLE_SOUTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_SOUTHERN, "Visible Southern Hemisphere") },
42+
{ (int) ScannerSubProduct.VISIBLE_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.VISIBLE_UNITEDSTATES, "Visible United States") },
43+
{ (int) ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, "Visible Area of Interest") },
44+
{ (int) ScannerSubProduct.WATERVAPOUR_FULLDISK, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_FULLDISK, "Water Vapour Full Disk") },
45+
{ (int) ScannerSubProduct.WATERVAPOUR_NORTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_NORTHERN, "Water Vapour Northern Hemisphere") },
46+
{ (int) ScannerSubProduct.WATERVAPOUR_SOUTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_SOUTHERN, "Water Vapour Southern Hemisphere") },
47+
{ (int) ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, "Water Vapour United States") },
4848
{ (int) ScannerSubProduct.WATERVAPOUR_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_AREA_OF_INTEREST, "Water Vapour Area of Interest") }
4949
}));
5050

screenshot.png

331 KB
Loading

0 commit comments

Comments
 (0)