Skip to content

Commit

Permalink
Merge pull request #5 from opensatelliteproject/BugFixes
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
racerxdl authored Feb 10, 2017
2 parents 32bb063 + 8ce3ea8 commit 9e41daa
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GOES LRIT Dumper
GOES xRIT Dumper
=========================

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.

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

![GOES Dump](screenshot.png)
![GOES Dump](screenshot.png)
6 changes: 4 additions & 2 deletions goesdump.userprefs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Properties StartupItem="goesdump/GOES Dumper.csproj" RefactoringSettings.EnableRefactorings="True">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.Workbench ActiveDocument="goesdump/UIComponents/Constellation.cs">
<MonoDevelop.Ide.Workbench ActiveDocument="goesdump/ChannelDecoder/Demuxer.cs">
<Files>
<File FileName="goesdump/Main.cs" Line="1" Column="1" />
<File FileName="goesdump/UIComponents/Constellation.cs" Line="1" Column="1" />
<File FileName="goesdump/UIComponents/Constellation.cs" Line="16" Column="9" />
<File FileName="goesdump/UIComponents/CurrentFrameData.cs" Line="1" Column="1" />
<File FileName="goesdump/GoesDecoder/Connector.cs" Line="1" Column="1" />
<File FileName="goesdump/ChannelDecoder/Demuxer.cs" Line="12" Column="1" />
<File FileName="goesdump/GoesDecoder/PacketManager.cs" Line="209" Column="17" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
Expand Down
5 changes: 3 additions & 2 deletions goesdump/ChannelDecoder/DemuxManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ public DemuxManager() {
public void parseBytes(byte[] data) {
int vcid = (data[1] & 0x3F);
if (vcid != FILL_VCID) {
/*if (vcid == 0 || vcid == 1) {
if (vcid == 0 || vcid == 1) {
// Skip DCS and EMWIN
return;
}*/
}

if (vcid == 31) { // Skip DCS for HRIT
return;
}
Expand Down
25 changes: 22 additions & 3 deletions goesdump/GoesDecoder/PacketManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ public static string Decompressor(string filename, int pixels) {
UIConsole.GlobalConsole.Error(String.Format("Error Decompressing: {0}", stderr));
} else {
UIConsole.GlobalConsole.Debug(String.Format("Decompress sucessful to {0}", String.Format("{0}_decomp.lrit", filename)));
try {
File.Delete(filename);
} catch (Exception e) {
Console.WriteLine("Cannot delete file {0}", filename);
}
}

} catch (Exception e) {
Expand All @@ -234,13 +239,19 @@ public static string Decompressor(string prefix, int pixels, int startnum, int e
Process decompressor = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.FileName = "wine";
startInfo.Arguments = String.Format("Decompress.exe {0} {1} {2} {3} a", prefix, pixels, startnum + 1, endnum);
if (Tools.IsLinux) {
startInfo.FileName = "wine";
startInfo.Arguments = String.Format("Decompress.exe {0} {1} {2} {3} a", prefix, pixels, startnum + 1, endnum);
startInfo.EnvironmentVariables.Add("WINEDEBUG", "fixme-all,err-winediag");
} else {
startInfo.FileName = "Decompress.exe";
startInfo.Arguments = String.Format("{0} {1} {2} {3} a", prefix, pixels, startnum + 1, endnum);
}

startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.EnvironmentVariables.Add("WINEDEBUG", "fixme-all,err-winediag");

decompressor.StartInfo = startInfo;

Expand All @@ -253,6 +264,14 @@ public static string Decompressor(string prefix, int pixels, int startnum, int e
UIConsole.GlobalConsole.Error(String.Format("Error Decompressing: {0}", stderr));
} else {
UIConsole.GlobalConsole.Debug(String.Format("Decompress sucessful to {0}", String.Format("{0}_decomp{1}.lrit", prefix, startnum)));
for (int i=startnum; i<endnum+1; i++) {
string f = string.Format("{0}{1}.lrit", prefix, i);
try {
File.Delete(f);
} catch (Exception e) {
Console.WriteLine("Error deleting file {0}", f);
}
}
}

} catch (Exception e) {
Expand Down
30 changes: 15 additions & 15 deletions goesdump/PacketData/Presets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ static Presets() {
noaaProducts.Add((int)NOAAProductID.DCS, new NOAAProduct(NOAAProductID.DCS, "DCS"));

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?
{ (int) ScannerSubProduct.NONE, new NOAASubproduct(ScannerSubProduct.NONE, "N(int) one") },
{ (int) ScannerSubProduct.INFRARED_FULLDISK, new NOAASubproduct(ScannerSubProduct.INFRARED_FULLDISK, "I(int) nfrared Full Disk") },
{ (int) ScannerSubProduct.INFRARED_NORTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_NORTHERN, "I(int) nfrared Northern Hemisphere") },
{ (int) ScannerSubProduct.INFRARED_SOUTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_SOUTHERN, "I(int) nfrared Southern Hemisphere") },
{ (int) ScannerSubProduct.INFRARED_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.INFRARED_UNITEDSTATES, "I(int) nfrared United States") },
{ (int) ScannerSubProduct.INFRARED_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.INFRARED_AREA_OF_INTEREST, "I(int) nfrared Area of Interest") },
{ (int) ScannerSubProduct.VISIBLE_FULLDISK, new NOAASubproduct(ScannerSubProduct.VISIBLE_FULLDISK, "V(int) isible Full Disk") },
{ (int) ScannerSubProduct.VISIBLE_NORTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_NORTHERN, "V(int) isible Northern Hemisphere") },
{ (int) ScannerSubProduct.VISIBLE_SOUTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_SOUTHERN, "V(int) isible Southern Hemisphere") },
{ (int) ScannerSubProduct.VISIBLE_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.VISIBLE_UNITEDSTATES, "V(int) isible United States") },
{ (int) ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, "V(int) isible Area of Interest") },
{ (int) ScannerSubProduct.WATERVAPOUR_FULLDISK, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_FULLDISK, "W(int) ater Vapour Full Disk") },
{ (int) ScannerSubProduct.WATERVAPOUR_NORTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_NORTHERN, "W(int) ater Vapour Northern Hemisphere") },
{ (int) ScannerSubProduct.WATERVAPOUR_SOUTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_SOUTHERN, "W(int) ater Vapour Southern Hemisphere") },
{ (int) ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, "W(int) ater Vapour United States") },
{ (int) ScannerSubProduct.NONE, new NOAASubproduct(ScannerSubProduct.NONE, "None") },
{ (int) ScannerSubProduct.INFRARED_FULLDISK, new NOAASubproduct(ScannerSubProduct.INFRARED_FULLDISK, "Infrared Full Disk") },
{ (int) ScannerSubProduct.INFRARED_NORTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_NORTHERN, "Infrared Northern Hemisphere") },
{ (int) ScannerSubProduct.INFRARED_SOUTHERN, new NOAASubproduct(ScannerSubProduct.INFRARED_SOUTHERN, "Infrared Southern Hemisphere") },
{ (int) ScannerSubProduct.INFRARED_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.INFRARED_UNITEDSTATES, "Infrared United States") },
{ (int) ScannerSubProduct.INFRARED_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.INFRARED_AREA_OF_INTEREST, "Infrared Area of Interest") },
{ (int) ScannerSubProduct.VISIBLE_FULLDISK, new NOAASubproduct(ScannerSubProduct.VISIBLE_FULLDISK, "Visible Full Disk") },
{ (int) ScannerSubProduct.VISIBLE_NORTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_NORTHERN, "Visible Northern Hemisphere") },
{ (int) ScannerSubProduct.VISIBLE_SOUTHERN, new NOAASubproduct(ScannerSubProduct.VISIBLE_SOUTHERN, "Visible Southern Hemisphere") },
{ (int) ScannerSubProduct.VISIBLE_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.VISIBLE_UNITEDSTATES, "Visible United States") },
{ (int) ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.VISIBLE_AREA_OF_INTEREST, "Visible Area of Interest") },
{ (int) ScannerSubProduct.WATERVAPOUR_FULLDISK, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_FULLDISK, "Water Vapour Full Disk") },
{ (int) ScannerSubProduct.WATERVAPOUR_NORTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_NORTHERN, "Water Vapour Northern Hemisphere") },
{ (int) ScannerSubProduct.WATERVAPOUR_SOUTHERN, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_SOUTHERN, "Water Vapour Southern Hemisphere") },
{ (int) ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_UNITEDSTATES, "Water Vapour United States") },
{ (int) ScannerSubProduct.WATERVAPOUR_AREA_OF_INTEREST, new NOAASubproduct(ScannerSubProduct.WATERVAPOUR_AREA_OF_INTEREST, "Water Vapour Area of Interest") }
}));

Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9e41daa

Please sign in to comment.