Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCM datasets does not show instrument mode #52

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"sar"
],
"sensor_type": "radar",
"title": "RCM-1 GCD HH/VV",
"title": "RCM-1 GCD 3M HH/VV",
"sat:orbit_state": "descending",
"sar:instrument_mode": "",
"sar:instrument_mode": "3M",
"sar:frequency_band": "C",
"sar:polarizations": [
"HH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
],
"sensor_type": "radar",
"gsd": 9.0,
"title": "RCM-2 GRD HH/HV/VH/VV",
"title": "RCM-2 GRD QP26 HH/HV/VH/VV",
"sat:orbit_state": "ascending",
"sar:instrument_mode": "QP",
"sar:instrument_mode": "QP26",
"sar:frequency_band": "C",
"sar:polarizations": [
"HH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"sar"
],
"sensor_type": "radar",
"title": "RCM-2 GRD HH/HV",
"title": "RCM-2 GRD 16M HH/HV",
"sat:orbit_state": "descending",
"sar:instrument_mode": "",
"sar:instrument_mode": "16M",
"sar:frequency_band": "C",
"sar:polarizations": [
"HH",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"sar"
],
"sensor_type": "radar",
"title": "RCM-3 GRD HH/VV",
"title": "RCM-3 GRD FSLCP27 HH/VV",
"sat:orbit_state": "descending",
"sar:instrument_mode": "FSL",
"sar:instrument_mode": "FSLCP27",
"sar:frequency_band": "C",
"sar:polarizations": [
"HH",
Expand Down
63 changes: 38 additions & 25 deletions src/Stars.Data/Model/Metadata/RCM/RcmMetadataExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,32 +217,44 @@ private string GetProcessingLevel(Product auxiliary)

private string GetInstrumentMode(Product auxiliary)
{
switch (auxiliary.SourceAttributes.BeamMode)
{
case BEAM_MODE.LOW_RESOLUTION_100:
return "SC100";
case BEAM_MODE.MEDIUM_RESOLUTION_50:
return "SC50";
case BEAM_MODE.MEDIUM_RESOLUTION_30:
return "SC30";
case BEAM_MODE.MEDIUM_RESOLUTION_16:
return "16M";
case BEAM_MODE.HIGH_RESOLUTION_5:
return "5M";
case BEAM_MODE.VERY_HIGH_RESOLUTION_3:
return "3M";
case BEAM_MODE.LOW_NOISE:
return "LN";
case BEAM_MODE.QUAD_POLARIZATION:
return "QP";
case BEAM_MODE.SHIP_DETECTION:
return "SD";
case BEAM_MODE.SPOTLIGHT:
return "FSL";
default:
return "";
// switch (auxiliary.SourceAttributes.BeamMode)
// {
// case BEAM_MODE.LOW_RESOLUTION_100:
// return "SC100";
// case BEAM_MODE.MEDIUM_RESOLUTION_50:
// return "SC50";
// case BEAM_MODE.MEDIUM_RESOLUTION_30:
// return "SC30";
// case BEAM_MODE.MEDIUM_RESOLUTION_16:
// return "16M";
// case BEAM_MODE.HIGH_RESOLUTION_5:
// return "5M";
// case BEAM_MODE.VERY_HIGH_RESOLUTION_3:
// return "3M";
// case BEAM_MODE.LOW_NOISE:
// return "LN";
// case BEAM_MODE.QUAD_POLARIZATION:
// return "QP";
// case BEAM_MODE.SHIP_DETECTION:
// return "SD";
// case BEAM_MODE.SPOTLIGHT:
// return "FSL";
// default:
// return "";
// }
//There are tons of them

//Take the entire string if no numbers
//That since the beginning to the (eventual) first letter after the number group
string inputString = auxiliary.SourceAttributes.BeamModeMnemonic;
Match match = Regex.Match(inputString, @"^([^0-9]*\d+[^A-Za-z]*[A-Za-z]?)|([^0-9]+)");
if (match.Success) {
return match.Groups[1].Value != "" ? match.Groups[1].Value : match.Groups[2].Value;
} else {
return inputString;
}
}

private SarCommonFrequencyBandName GetFrequencyBand(Product auxiliary)
{
return SarCommonFrequencyBandName.C; //HARDCODED it is a SAR-C instrument
Expand Down Expand Up @@ -382,10 +394,11 @@ private void FillBasicsProperties(Product auxiliary, IDictionary<String, object>

protected string GetTitle(Product auxiliary, IDictionary<string, object> properties)
{
return string.Format("{0} {1} {2}",
return string.Format("{0} {1} {2} {3}",
//StylePlatform(properties.GetProperty<string>("platform")),
properties.GetProperty<string>("platform").ToUpper(),
GetProductType(auxiliary),
GetInstrumentMode(auxiliary),
string.Join("/", GetPolarizations(auxiliary))
);
}
Expand Down
Loading