Skip to content

Commit

Permalink
fixes mode discrepency
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Mathot committed Oct 25, 2018
1 parent 5661b98 commit 397fe09
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ class OperationalModeMetadataExtractor : IMetadataExtractor {
public string GetMetadata(IOpenSearchResultItem item, string specifier) {

var mode = Terradue.Metadata.EarthObservation.OpenSearch.Extensions.EarthObservationOpenSearchResultExtensions.FindOperationalMode(item);
if ( mode == "EW" || mode == "IW" || mode == "WV" || mode == "SM" ){
var match = Regex.Match(item.Identifier, @"^(?'psn'S1[AB])_(?'mode'\w{2})_(?'pt'\w{3})(?'res'\w{1})_(?'level'\d{1})(?'class'\w{1})(?'polarisation'\w{2})_(?'begin'\w{15})_(?'end'\w{15})_.*$");
if (!match.Success)
mode = string.Format("{0}_{1}P", match.Groups["mode"].Value, match.Groups["polarisation"].Value[0]);
if ( mode.EndsWith("_SP") || mode.EndsWith("_DP") ){
mode = mode.Replace("_SP", "").Replace("_DP", "");
}
return mode;
}
Expand Down

0 comments on commit 397fe09

Please sign in to comment.