mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 07:20:04 +00:00 
			
		
		
		
	Add hydrometeor classification level 3 product
This commit is contained in:
		
							parent
							
								
									447f3ee821
								
							
						
					
					
						commit
						587dbb7f1f
					
				
					 7 changed files with 45 additions and 11 deletions
				
			
		
							
								
								
									
										17
									
								
								scwx-qt/res/palettes/wct/HC.pal
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								scwx-qt/res/palettes/wct/HC.pal
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | ; WCT Palette for Hydrometeor Classification adapted for Supercell Wx | ||||||
|  | 
 | ||||||
|  | SolidColor:	 10	156	156	156 ; BI = Biological | ||||||
|  | SolidColor:	 20	118	118	118 ; GC = Anomalous Propagation/Ground Clutter | ||||||
|  | SolidColor:	 30	255	176	176 ; IC = Ice Crystals | ||||||
|  | SolidColor:	 40	  0	255	255 ; DS = Dry Snow | ||||||
|  | SolidColor:	 50	  0	144	255 ; WS = Wet Snow | ||||||
|  | SolidColor:	 60	  0	251	144 ; RA = Light and/or Moderate Rain | ||||||
|  | SolidColor:	 70	  0	187	  0 ; HR = Heavy Rain | ||||||
|  | SolidColor:	 80	208	208	 96 ; BD = Big Drops | ||||||
|  | SolidColor:	 90	210	132	132 ; GR = Graupel | ||||||
|  | SolidColor:	100	255	  0	  0 ; HA = Small Hail | ||||||
|  | SolidColor:	110	160	 20	 20 ; LH = Large Hail | ||||||
|  | SolidColor:	120	255	255	  0 ; GH = Giant Hail | ||||||
|  | SolidColor:	130	  0	  0	  0 ; TBD | ||||||
|  | SolidColor:	140	231	  0	255 ; UK = Unknown Classification | ||||||
|  | SolidColor:	150	119	  0	125 ; RF = Range Folded | ||||||
|  | @ -54,6 +54,7 @@ | ||||||
|         <file>res/palettes/wct/DR.pal</file> |         <file>res/palettes/wct/DR.pal</file> | ||||||
|         <file>res/palettes/wct/DV.pal</file> |         <file>res/palettes/wct/DV.pal</file> | ||||||
|         <file>res/palettes/wct/ET.pal</file> |         <file>res/palettes/wct/ET.pal</file> | ||||||
|  |         <file>res/palettes/wct/HC.pal</file> | ||||||
|         <file>res/palettes/wct/KDP.pal</file> |         <file>res/palettes/wct/KDP.pal</file> | ||||||
|         <file>res/palettes/wct/KDP2.pal</file> |         <file>res/palettes/wct/KDP2.pal</file> | ||||||
|         <file>res/palettes/wct/OHP.pal</file> |         <file>res/palettes/wct/OHP.pal</file> | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ namespace settings | ||||||
| 
 | 
 | ||||||
| static const std::string logPrefix_ = "scwx::qt::settings::palette_settings"; | static const std::string logPrefix_ = "scwx::qt::settings::palette_settings"; | ||||||
| 
 | 
 | ||||||
| static const std::array<std::string, 17> kPaletteKeys_ { | static const std::array<std::string, 18> kPaletteKeys_ { | ||||||
|    // Level 2 / Common Products
 |    // Level 2 / Common Products
 | ||||||
|    "BR", |    "BR", | ||||||
|    "BV", |    "BV", | ||||||
|  | @ -27,6 +27,7 @@ static const std::array<std::string, 17> kPaletteKeys_ { | ||||||
|    "DOD", |    "DOD", | ||||||
|    "DSD", |    "DSD", | ||||||
|    "ET", |    "ET", | ||||||
|  |    "HC", | ||||||
|    "STP", |    "STP", | ||||||
|    "OHP", |    "OHP", | ||||||
|    "STPIN", |    "STPIN", | ||||||
|  | @ -48,6 +49,7 @@ static const std::unordered_map<std::string, std::string> kDefaultPalettes_ { | ||||||
|    {"DOD", ":/res/palettes/wct/DOD_DSD.pal"}, |    {"DOD", ":/res/palettes/wct/DOD_DSD.pal"}, | ||||||
|    {"DSD", ":/res/palettes/wct/DOD_DSD.pal"}, |    {"DSD", ":/res/palettes/wct/DOD_DSD.pal"}, | ||||||
|    {"ET", ":/res/palettes/wct/ET.pal"}, |    {"ET", ":/res/palettes/wct/ET.pal"}, | ||||||
|  |    {"HC", ":/res/palettes/wct/HC.pal"}, | ||||||
|    {"OHP", ":/res/palettes/wct/OHP.pal"}, |    {"OHP", ":/res/palettes/wct/OHP.pal"}, | ||||||
|    {"OHPIN", ""}, |    {"OHPIN", ""}, | ||||||
|    {"PHI3", ":/res/palettes/wct/KDP.pal"}, |    {"PHI3", ":/res/palettes/wct/KDP.pal"}, | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ struct ColorTableConversions | ||||||
|    float    scale {1.0f}; |    float    scale {1.0f}; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static const std::array<std::pair<std::string, std::string>, 15> | static const std::array<std::pair<std::string, std::string>, 16> | ||||||
|    kColorTableTypes_ {std::pair {"BR", "BR"}, |    kColorTableTypes_ {std::pair {"BR", "BR"}, | ||||||
|                       std::pair {"BV", "BV"}, |                       std::pair {"BV", "BV"}, | ||||||
|                       std::pair {"SW", "SW"}, |                       std::pair {"SW", "SW"}, | ||||||
|  | @ -64,6 +64,7 @@ static const std::array<std::pair<std::string, std::string>, 15> | ||||||
|                       std::pair {"DOD", "DOD"}, |                       std::pair {"DOD", "DOD"}, | ||||||
|                       std::pair {"DSD", "DSD"}, |                       std::pair {"DSD", "DSD"}, | ||||||
|                       std::pair {"ET", "ET"}, |                       std::pair {"ET", "ET"}, | ||||||
|  |                       std::pair {"HC", "HC"}, | ||||||
|                       std::pair {"OHP", "OHP"}, |                       std::pair {"OHP", "OHP"}, | ||||||
|                       std::pair {"PHI3", "KDP"}, |                       std::pair {"PHI3", "KDP"}, | ||||||
|                       std::pair {"SRV", "SRV"}, |                       std::pair {"SRV", "SRV"}, | ||||||
|  | @ -84,6 +85,7 @@ static const std::unordered_map<std::string, ColorTableConversions> | ||||||
|                             {"DOD", {0u, 255u, 128.0f, 1.5f}}, |                             {"DOD", {0u, 255u, 128.0f, 1.5f}}, | ||||||
|                             {"DSD", {0u, 255u, 128.0f, 1.5f}}, |                             {"DSD", {0u, 255u, 128.0f, 1.5f}}, | ||||||
|                             {"ET", {0u, 255u, 2.0f, 1.0f}}, |                             {"ET", {0u, 255u, 2.0f, 1.0f}}, | ||||||
|  |                             {"HC", {10u, 160u, 0.0f, 1.0f}}, | ||||||
|                             {"OHP", {0u, 255u, 0.0f, 2.5f}}, |                             {"OHP", {0u, 255u, 0.0f, 2.5f}}, | ||||||
|                             {"PHI3", {0u, 255u, 43.0f, 20.0f}}, |                             {"PHI3", {0u, 255u, 43.0f, 20.0f}}, | ||||||
|                             {"SRV", {0u, 255u, 128.0f, 2.0f}}, |                             {"SRV", {0u, 255u, 128.0f, 2.0f}}, | ||||||
|  |  | ||||||
|  | @ -47,11 +47,12 @@ enum class Level3ProductCategory | ||||||
|    DifferentialReflectivity, |    DifferentialReflectivity, | ||||||
|    SpecificDifferentialPhase, |    SpecificDifferentialPhase, | ||||||
|    CorrelationCoefficient, |    CorrelationCoefficient, | ||||||
|  |    HydrometeorClassification, | ||||||
|    Unknown |    Unknown | ||||||
| }; | }; | ||||||
| typedef util::Iterator<Level3ProductCategory, | typedef util::Iterator<Level3ProductCategory, | ||||||
|                        Level3ProductCategory::Reflectivity, |                        Level3ProductCategory::Reflectivity, | ||||||
|                        Level3ProductCategory::CorrelationCoefficient> |                        Level3ProductCategory::HydrometeorClassification> | ||||||
|    Level3ProductCategoryIterator; |    Level3ProductCategoryIterator; | ||||||
| 
 | 
 | ||||||
| typedef std::unordered_map< | typedef std::unordered_map< | ||||||
|  | @ -74,9 +75,8 @@ GetLevel3CategoryDefaultProduct(Level3ProductCategory category); | ||||||
| Level3ProductCategory GetLevel3Category(const std::string& categoryName); | Level3ProductCategory GetLevel3Category(const std::string& categoryName); | ||||||
| Level3ProductCategory | Level3ProductCategory | ||||||
| GetLevel3CategoryByProduct(const std::string& productName); | GetLevel3CategoryByProduct(const std::string& productName); | ||||||
| Level3ProductCategory | Level3ProductCategory GetLevel3CategoryByAwipsId(const std::string& awipsId); | ||||||
| GetLevel3CategoryByAwipsId(const std::string& awipsId); | const std::string&    GetLevel3Palette(int16_t productCode); | ||||||
| const std::string& GetLevel3Palette(int16_t productCode); |  | ||||||
| 
 | 
 | ||||||
| std::string        GetLevel3ProductByAwipsId(const std::string& awipsId); | std::string        GetLevel3ProductByAwipsId(const std::string& awipsId); | ||||||
| const std::string& GetLevel3ProductDescription(const std::string& productName); | const std::string& GetLevel3ProductDescription(const std::string& productName); | ||||||
|  |  | ||||||
|  | @ -67,7 +67,8 @@ static const std::unordered_map<std::string, std::string> | ||||||
|                               {"DZD", "Digital Differential Reflectivity"}, |                               {"DZD", "Digital Differential Reflectivity"}, | ||||||
|                               {"DCC", "Digital Correlation Coefficient"}, |                               {"DCC", "Digital Correlation Coefficient"}, | ||||||
|                               {"DKD", "Digital Specific Differential Phase"}, |                               {"DKD", "Digital Specific Differential Phase"}, | ||||||
|                               {"DHD", "Digital Hydrometeor Classification"}, |                               {"DHC", "Digital Hydrometeor Classification"}, | ||||||
|  |                               {"HHC", "Hybrid Hydrometeor Classification"}, | ||||||
|                               {"ML", "Melting Layer"}, |                               {"ML", "Melting Layer"}, | ||||||
|                               {"SW", "Spectrum Width"}, |                               {"SW", "Spectrum Width"}, | ||||||
|                               {"TDR", "Digital Reflectivity"}, |                               {"TDR", "Digital Reflectivity"}, | ||||||
|  | @ -102,8 +103,9 @@ static const std::unordered_map<std::string, std::vector<std::string>> | ||||||
|       // Specific Differential Phase
 |       // Specific Differential Phase
 | ||||||
|       {"DKD", {"NXK", "NYK", "NZK", "N0K", "NAK", "N1K", "NBK", "N2K", "N3K"}}, |       {"DKD", {"NXK", "NYK", "NZK", "N0K", "NAK", "N1K", "NBK", "N2K", "N3K"}}, | ||||||
| 
 | 
 | ||||||
|       // Digital Hydrometeor Classification
 |       // Hydrometeor Classification
 | ||||||
|       {"DHC", {"NXH", "NYH", "NZH", "N0H", "NAH", "N1H", "NBH", "N2H", "N3H"}}, |       {"DHC", {"NXH", "NYH", "NZH", "N0H", "NAH", "N1H", "NBH", "N2H", "N3H"}}, | ||||||
|  |       {"HHC", {"HHC"}}, | ||||||
| 
 | 
 | ||||||
|       // Melting Layer
 |       // Melting Layer
 | ||||||
|       {"ML", {"NXM", "NYM", "NZM", "N0M", "NAM", "N1M", "NBM", "N2M", "N3M"}}, |       {"ML", {"NXM", "NYM", "NZM", "N0M", "NAM", "N1M", "NBM", "N2M", "N3M"}}, | ||||||
|  | @ -120,6 +122,7 @@ static const std::unordered_map<Level3ProductCategory, std::string> | ||||||
|       {Level3ProductCategory::DifferentialReflectivity, "ZDR"}, |       {Level3ProductCategory::DifferentialReflectivity, "ZDR"}, | ||||||
|       {Level3ProductCategory::SpecificDifferentialPhase, "KDP"}, |       {Level3ProductCategory::SpecificDifferentialPhase, "KDP"}, | ||||||
|       {Level3ProductCategory::CorrelationCoefficient, "CC"}, |       {Level3ProductCategory::CorrelationCoefficient, "CC"}, | ||||||
|  |       {Level3ProductCategory::HydrometeorClassification, "HC"}, | ||||||
|       {Level3ProductCategory::Unknown, "?"}}; |       {Level3ProductCategory::Unknown, "?"}}; | ||||||
| 
 | 
 | ||||||
| static const std::unordered_map<Level3ProductCategory, std::string> | static const std::unordered_map<Level3ProductCategory, std::string> | ||||||
|  | @ -134,6 +137,8 @@ static const std::unordered_map<Level3ProductCategory, std::string> | ||||||
|        "Specific Differential Phase"}, |        "Specific Differential Phase"}, | ||||||
|       {Level3ProductCategory::CorrelationCoefficient, |       {Level3ProductCategory::CorrelationCoefficient, | ||||||
|        "Correlation Coefficient"}, |        "Correlation Coefficient"}, | ||||||
|  |       {Level3ProductCategory::HydrometeorClassification, | ||||||
|  |        "Hydrometeor Classification"}, | ||||||
|       {Level3ProductCategory::Unknown, "?"}}; |       {Level3ProductCategory::Unknown, "?"}}; | ||||||
| 
 | 
 | ||||||
| static const std::unordered_map<Level3ProductCategory, std::vector<std::string>> | static const std::unordered_map<Level3ProductCategory, std::vector<std::string>> | ||||||
|  | @ -145,6 +150,7 @@ static const std::unordered_map<Level3ProductCategory, std::vector<std::string>> | ||||||
|       {Level3ProductCategory::DifferentialReflectivity, {"DZD"}}, |       {Level3ProductCategory::DifferentialReflectivity, {"DZD"}}, | ||||||
|       {Level3ProductCategory::SpecificDifferentialPhase, {"DKD"}}, |       {Level3ProductCategory::SpecificDifferentialPhase, {"DKD"}}, | ||||||
|       {Level3ProductCategory::CorrelationCoefficient, {"DCC"}}, |       {Level3ProductCategory::CorrelationCoefficient, {"DCC"}}, | ||||||
|  |       {Level3ProductCategory::HydrometeorClassification, {"DHC", "HHC"}}, | ||||||
|       {Level3ProductCategory::Unknown, {}}}; |       {Level3ProductCategory::Unknown, {}}}; | ||||||
| 
 | 
 | ||||||
| static const std::unordered_map<Level3ProductCategory, std::string> | static const std::unordered_map<Level3ProductCategory, std::string> | ||||||
|  | @ -155,7 +161,8 @@ static const std::unordered_map<Level3ProductCategory, std::string> | ||||||
|       {Level3ProductCategory::SpectrumWidth, "NSW"}, |       {Level3ProductCategory::SpectrumWidth, "NSW"}, | ||||||
|       {Level3ProductCategory::DifferentialReflectivity, "N0X"}, |       {Level3ProductCategory::DifferentialReflectivity, "N0X"}, | ||||||
|       {Level3ProductCategory::SpecificDifferentialPhase, "N0K"}, |       {Level3ProductCategory::SpecificDifferentialPhase, "N0K"}, | ||||||
|       {Level3ProductCategory::CorrelationCoefficient, "N0C"}}; |       {Level3ProductCategory::CorrelationCoefficient, "N0C"}, | ||||||
|  |       {Level3ProductCategory::HydrometeorClassification, "N0H"}}; | ||||||
| 
 | 
 | ||||||
| static const std::unordered_map<int, std::string> level3Palette_ { | static const std::unordered_map<int, std::string> level3Palette_ { | ||||||
|    {19, "BR"},     {20, "BR"},     {27, "BV"},     {30, "SW"}, |    {19, "BR"},     {20, "BR"},     {27, "BV"},     {30, "SW"}, | ||||||
|  | @ -169,10 +176,10 @@ static const std::unordered_map<int, std::string> level3Palette_ { | ||||||
|    {137, "BR"},    {138, "STPIN"}, {144, "OHPIN"}, {145, "OHPIN"}, |    {137, "BR"},    {138, "STPIN"}, {144, "OHPIN"}, {145, "OHPIN"}, | ||||||
|    {146, "STPIN"}, {150, "STPIN"}, {151, "STPIN"}, {153, "BR"}, |    {146, "STPIN"}, {150, "STPIN"}, {151, "STPIN"}, {153, "BR"}, | ||||||
|    {154, "BV"},    {155, "SW"},    {159, "ZDR"},   {161, "CC"}, |    {154, "BV"},    {155, "SW"},    {159, "ZDR"},   {161, "CC"}, | ||||||
|    {163, "PHI3"},  {165, "???"},   {167, "CC"},    {168, "PHI3"}, |    {163, "PHI3"},  {165, "HC"},    {167, "CC"},    {168, "PHI3"}, | ||||||
|    {169, "OHPIN"}, {170, "STP"},   {171, "STPIN"}, {172, "STP"}, |    {169, "OHPIN"}, {170, "STP"},   {171, "STPIN"}, {172, "STP"}, | ||||||
|    {173, "STP"},   {174, "DOD"},   {175, "DSD"},   {176, "???"}, |    {173, "STP"},   {174, "DOD"},   {175, "DSD"},   {176, "???"}, | ||||||
|    {177, "???"},   {178, "???"},   {179, "???"},   {180, "BR"}, |    {177, "HC"},    {178, "???"},   {179, "???"},   {180, "BR"}, | ||||||
|    {181, "BR"},    {182, "BV"},    {184, "SW"},    {186, "BR"}, |    {181, "BR"},    {182, "BV"},    {184, "SW"},    {186, "BR"}, | ||||||
|    {193, "BR"},    {195, "BR"},    {-1, "???"}}; |    {193, "BR"},    {195, "BR"},    {-1, "???"}}; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -572,6 +572,11 @@ uint16_t ProductDescriptionBlock::number_of_levels() const | ||||||
|       numberOfLevels = p->halfword(36); |       numberOfLevels = p->halfword(36); | ||||||
|       break; |       break; | ||||||
| 
 | 
 | ||||||
|  |    case 165: | ||||||
|  |    case 177: | ||||||
|  |       numberOfLevels = 160; | ||||||
|  |       break; | ||||||
|  | 
 | ||||||
|    case 178: |    case 178: | ||||||
|    case 179: |    case 179: | ||||||
|       numberOfLevels = 71; |       numberOfLevels = 71; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat