From c23e7a656332801e049a399221354023d0a1cc69 Mon Sep 17 00:00:00 2001 From: FCWY Date: Tue, 29 Oct 2024 15:59:05 +0800 Subject: [PATCH 1/2] add ignore for vs cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ec96c4e..3df9cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +.vs/ bin/ obj/ *.DotSettings.user From 76a0432eb87f28f174dcc495c129a8bbbf3cd0a6 Mon Sep 17 00:00:00 2001 From: FCWY Date: Tue, 29 Oct 2024 16:11:00 +0800 Subject: [PATCH 2/2] add support for satdump-generated gk2a image filename parsing --- .../Filesystem/FilenameParserProvider.cs | 1 + .../Services/Filesystem/FilenameParserType.cs | 7 ++++++- .../Gk2ASatDumpVariantFilenameParser.cs | 18 ++++++++++++++++++ Sanchez/Resources/Satellites.json | 13 +++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Sanchez.Processing/Services/Filesystem/Parsers/Gk2ASatDumpVariantFilenameParser.cs diff --git a/Sanchez.Processing/Services/Filesystem/FilenameParserProvider.cs b/Sanchez.Processing/Services/Filesystem/FilenameParserProvider.cs index 99db34a..46f2b9d 100644 --- a/Sanchez.Processing/Services/Filesystem/FilenameParserProvider.cs +++ b/Sanchez.Processing/Services/Filesystem/FilenameParserProvider.cs @@ -10,6 +10,7 @@ public static IFilenameParser GetParser(FilenameParserType type, string? prefix, { FilenameParserType.Goesproc => new GoesFilenameParser(prefix, suffix), FilenameParserType.Xrit => new Gk2AFilenameParser(prefix, suffix), + FilenameParserType.SatDumpGK2APlugin => new Gk2ASatDumpVariantFilenameParser(prefix, suffix), FilenameParserType.Electro => new ElectroFilenameParser(prefix, suffix), _ => throw new ArgumentOutOfRangeException(nameof(type), type, null) }; diff --git a/Sanchez.Processing/Services/Filesystem/FilenameParserType.cs b/Sanchez.Processing/Services/Filesystem/FilenameParserType.cs index bf54228..5ac2c9b 100644 --- a/Sanchez.Processing/Services/Filesystem/FilenameParserType.cs +++ b/Sanchez.Processing/Services/Filesystem/FilenameParserType.cs @@ -11,7 +11,12 @@ public enum FilenameParserType /// Images produced by xrit-rx for GK-2A images. /// Xrit, - + + /// + /// Images produced by satdump gk2a plugin for GK-2A images. + /// + SatDumpGK2APlugin, + /// /// Images produced for Electro-L N2 images. /// diff --git a/Sanchez.Processing/Services/Filesystem/Parsers/Gk2ASatDumpVariantFilenameParser.cs b/Sanchez.Processing/Services/Filesystem/Parsers/Gk2ASatDumpVariantFilenameParser.cs new file mode 100644 index 0000000..377954d --- /dev/null +++ b/Sanchez.Processing/Services/Filesystem/Parsers/Gk2ASatDumpVariantFilenameParser.cs @@ -0,0 +1,18 @@ +using System.Text.RegularExpressions; + +namespace Sanchez.Processing.Services.Filesystem.Parsers; + +/// +/// Parses filenames of satellite imagery received from GK-2A and processed by xrit-rc. +/// +public class Gk2ASatDumpVariantFilenameParser : AbstractFilenameParser +{ + protected override Regex Regex { get; } + + protected override string TimestampFormat => "yyyyMMddTHHmmssZ"; + + public Gk2ASatDumpVariantFilenameParser(string? prefix, string? suffix) + { + Regex = new Regex(prefix + "([0-9]{8}T[0-9]{6}Z)" + suffix + "\\.[^ ]*", RegexOptions.Compiled); + } +} \ No newline at end of file diff --git a/Sanchez/Resources/Satellites.json b/Sanchez/Resources/Satellites.json index 7a1b6a0..b333e91 100644 --- a/Sanchez/Resources/Satellites.json +++ b/Sanchez/Resources/Satellites.json @@ -62,6 +62,19 @@ 0.006363 ] }, + { + "DisplayName": "GEO-KOMPSAT-2A-SatDump-Variant", + "FilenamePrefix": "^GK2A_IR105_", + "FilenameParser": "SatDumpGK2APlugin", + "Longitude": 128.2, + "Brightness": 0.97, + "Crop": [ + 0.006363, + 0.006363, + 0.006363, + 0.006363 + ] + }, { "DisplayName": "Electro-L N2", "FilenameSuffix": "[1-3]",