]> Pileus Git - aweather/commitdiff
Add dual-pole support and improve colormap handling
authorAndy Spencer <andy753421@gmail.com>
Sun, 13 Feb 2011 11:00:42 +0000 (11:00 +0000)
committerAndy Spencer <andy753421@gmail.com>
Tue, 15 Feb 2011 13:06:15 +0000 (13:06 +0000)
Add support for dual-pole (KOUN). This should work for the most part.
Some of the dual-pole colormaps are still broken. For KOUN to work, a
recent (unreleased) version of the RSL wsr88d_locations.dat file is
needed.

Use non builtin colormaps. This should make updating colormaps easier.
The colormaps are written in simple flat files, the format is:

  - line 1: Parameter name,  - Reflectivity
  - line 2: Data scale,      - 2
  - line 3: Data shift,      - 31
  - line 4: RGBA color data, - 255 207 0 255
  - line n: Same as line 4 for however many lines are needed

The scale and shift parameters map the parameter values to a colortable
index. The index is clamped to the number of color data lines.

14 files changed:
data/Makefile.am
data/colors/dr.clr [new file with mode: 0644]
data/colors/dz.clr [new file with mode: 0644]
data/colors/ph.clr [new file with mode: 0644]
data/colors/rh.clr [new file with mode: 0644]
data/colors/sw.clr [new file with mode: 0644]
data/colors/vr.clr [new file with mode: 0644]
src/Makefile.am
src/aweather-location.c
src/plugins/Makefile.am
src/plugins/level2.c
src/plugins/radar-info.c
src/plugins/radar-info.h
src/plugins/radar.c

index bec25f696586c6dddad81245b3c7635a1a436c0d..9a6dd0055f9eabf8c44fdacef1196fdc2f3a39f4 100644 (file)
@@ -4,6 +4,9 @@ dist_gtkbuilder_DATA = main.ui
 configdir = $(datadir)/aweather/
 dist_config_DATA = defaults.ini
 
+colordir = $(datadir)/aweather/
+dist_color_DATA = colors/
+
 if WIN32
 noinst_DATA = aweather.ico
 else
diff --git a/data/colors/dr.clr b/data/colors/dr.clr
new file mode 100644 (file)
index 0000000..b74aba4
--- /dev/null
@@ -0,0 +1,259 @@
+Differential Reflectivity
+16
+128
+0   0   0   255
+118 0   125 255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+0   0   0   255
+64  64  64  255
+67  67  67  255
+70  70  70  255
+73  73  73  255
+76  76  76  255
+78  78  78  255
+81  81  81  255
+84  84  84  255
+87  87  87  255
+90  90  90  255
+93  93  93  255
+96  96  96  255
+99  99  99  255
+101 101 101 255
+104 104 104 255
+107 107 107 255
+110 110 110 255
+113 113 113 255
+116 116 116 255
+119 119 119 255
+122 122 122 255
+124 124 124 255
+127 127 127 255
+130 130 130 255
+133 133 133 255
+136 136 136 255
+139 139 139 255
+143 143 143 255
+145 145 145 255
+147 147 147 255
+150 150 150 255
+153 153 153 255
+156 156 156 255
+158 158 158 255
+160 160 160 255
+162 162 162 255
+164 164 164 255
+165 165 165 255
+167 167 167 255
+169 169 169 255
+171 171 171 255
+173 173 173 255
+175 175 175 255
+177 177 177 255
+179 179 179 255
+180 180 180 255
+182 182 182 255
+184 184 184 255
+186 186 186 255
+188 188 188 255
+190 190 190 255
+192 192 192 255
+194 194 194 255
+195 195 195 255
+197 197 197 255
+199 199 199 255
+201 201 201 255
+193 191 198 255
+185 181 196 255
+177 171 193 255
+169 161 191 255
+161 150 188 255
+153 140 185 255
+145 130 183 255
+140 120 180 255
+105 90  173 255
+70  60  166 255
+35  30  159 255
+0   0   152 255
+0   37  167 255
+0   76  182 255
+0   114 196 255
+35  152 211 255
+39  165 211 255
+43  178 211 255
+47  191 211 255
+52  204 211 255
+56  216 210 255
+60  229 210 255
+64  242 210 255
+68  255 210 255
+70  251 195 255
+73  246 179 255
+75  242 164 255
+78  237 148 255
+80  233 133 255
+82  229 117 255
+85  224 102 255
+87  219 86  255
+108 224 87  255
+129 228 88  255
+150 233 90  255
+171 237 91  255
+192 242 92  255
+213 246 94  255
+234 251 95  255
+255 255 96  255
+255 241 93  255
+255 227 89  255
+255 212 86  255
+255 198 82  255
+255 184 79  255
+255 169 76  255
+255 155 72  255
+255 144 68  255
+251 126 0   255
+246 108 0   255
+242 90  0   255
+237 72  0   255
+232 54  0   255
+228 36  0   255
+221 18  0   255
+218 0   0   255
+216 0   0   255
+213 0   0   255
+211 0   0   255
+208 0   0   255
+206 0   0   255
+203 0   0   255
+201 0   0   255
+198 0   0   255
+196 0   0   255
+193 0   0   255
+191 0   0   255
+188 0   0   255
+186 0   0   255
+183 0   0   255
+181 0   0   255
+174 0   0   255
+182 8   12  255
+186 16  24  255
+191 32  36  255
+195 40  48  255
+199 48  60  255
+204 56  72  255
+208 64  83  255
+212 72  95  255
+217 80  107 255
+221 88  119 255
+225 96  131 255
+229 104 143 255
+234 112 154 255
+238 121 166 255
+243 131 178 255
+247 130 190 255
+247 138 194 255
+247 145 197 255
+248 152 201 255
+248 158 204 255
+248 165 208 255
+249 172 211 255
+249 179 215 255
+250 186 219 255
+250 193 223 255
+250 200 226 255
+251 207 230 255
+251 214 233 255
+252 221 237 255
+252 227 241 255
+253 234 242 255
+253 241 248 255
+253 248 251 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
diff --git a/data/colors/dz.clr b/data/colors/dz.clr
new file mode 100644 (file)
index 0000000..5393c3e
--- /dev/null
@@ -0,0 +1,259 @@
+Reflectivity
+2
+72
+0   0   0   0
+0   0   0   0
+204 204 204 0
+204 204 204 0
+204 204 204 0
+204 204 204 0
+197 197 197 0
+197 197 197 0
+197 197 197 0
+197 197 197 0
+197 197 197 0
+190 190 190 0
+190 190 190 0
+190 190 190 0
+190 190 190 0
+190 190 190 0
+183 183 183 0
+183 183 183 0
+183 183 183 0
+183 183 183 0
+183 183 183 0
+176 176 176 0
+176 176 176 0
+176 176 176 0
+176 176 176 0
+176 176 176 0
+169 169 169 0
+169 169 169 0
+169 169 169 0
+169 169 169 0
+169 169 169 0
+162 162 162 0
+162 162 162 0
+162 162 162 0
+162 162 162 0
+162 162 162 0
+155 155 155 0
+155 155 155 0
+155 155 155 0
+155 155 155 0
+155 155 155 0
+148 148 148 0
+148 148 148 0
+148 148 148 0
+148 148 148 0
+148 148 148 0
+141 141 141 0
+141 141 141 0
+141 141 141 0
+141 141 141 0
+141 141 141 0
+134 134 134 0
+134 134 134 0
+134 134 134 0
+134 134 134 0
+134 134 134 0
+127 127 127 0
+127 127 127 0
+127 127 127 0
+127 127 127 0
+127 127 127 0
+120 120 120 0
+120 120 120 0
+120 120 120 0
+120 120 120 0
+120 120 120 0
+113 113 113 0
+113 113 113 0
+113 113 113 0
+113 113 113 0
+113 113 113 0
+96  96  96  0
+96  96  96  0
+96  96  96  0
+96  96  96  0
+96  96  96  0
+32  96  128 5
+32  96  128 10
+33  104 137 15
+33  104 137 20
+34  112 146 25
+34  112 146 30
+35  120 155 35
+35  120 155 40
+37  128 164 45
+37  128 164 50
+38  136 174 55
+38  136 174 60
+39  144 183 65
+39  144 183 70
+40  152 192 75
+40  152 192 80
+41  160 201 85
+41  160 201 90
+43  168 210 95
+43  168 210 100
+44  176 219 105
+44  176 219 110
+45  184 228 115
+45  184 228 120
+46  192 237 125
+46  192 237 130
+47  200 246 135
+47  200 246 140
+48  208 255 145
+48  208 255 150
+0   255 0   155
+0   255 0   160
+0   246 0   165
+0   246 0   170
+0   236 0   175
+0   236 0   180
+0   227 0   185
+0   227 0   190
+0   217 0   195
+0   217 0   200
+0   208 0   205
+0   208 0   210
+0   198 0   215
+0   198 0   220
+0   189 0   225
+0   189 0   230
+0   180 0   235
+0   180 0   240
+0   170 0   245
+0   170 0   250
+0   161 0   255
+0   161 0   255
+0   151 0   255
+0   151 0   255
+0   142 0   255
+0   142 0   255
+0   133 0   255
+0   133 0   255
+0   123 0   255
+0   123 0   255
+0   114 0   255
+0   114 0   255
+0   104 0   255
+0   104 0   255
+0   95  0   255
+0   95  0   255
+0   85  0   255
+0   85  0   255
+0   76  0   255
+0   76  0   255
+255 230 0   255
+255 230 0   255
+255 219 0   255
+255 219 0   255
+255 207 0   255
+255 207 0   255
+255 196 0   255
+255 196 0   255
+255 185 0   255
+255 185 0   255
+255 173 0   255
+255 173 0   255
+255 162 0   255
+255 162 0   255
+255 151 0   255
+255 151 0   255
+255 139 0   255
+255 139 0   255
+255 128 0   255
+255 128 0   255
+255 0   0   255
+255 0   0   255
+237 0   0   255
+237 0   0   255
+220 0   0   255
+220 0   0   255
+202 0   0   255
+202 0   0   255
+184 0   0   255
+184 0   0   255
+167 0   0   255
+167 0   0   255
+149 0   0   255
+149 0   0   255
+131 0   0   255
+131 0   0   255
+114 0   0   255
+114 0   0   255
+96  0   0   255
+96  0   0   255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+255 32  255 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+144 48  208 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
+225 125 150 255
diff --git a/data/colors/ph.clr b/data/colors/ph.clr
new file mode 100644 (file)
index 0000000..a0a94f8
--- /dev/null
@@ -0,0 +1,259 @@
+Differential Phase
+1
+42
+0   0   0   0
+118 0   125 255
+118 118 118 255
+118 118 118 255
+121 121 121 255
+124 124 124 255
+127 127 127 255
+130 130 130 255
+134 134 134 255
+137 137 137 255
+140 140 140 255
+143 143 143 255
+146 146 146 255
+149 149 149 255
+152 152 152 255
+155 155 155 255
+158 158 158 255
+161 161 161 255
+165 165 165 255
+168 168 168 255
+171 171 171 255
+174 174 174 255
+177 177 177 255
+180 180 180 255
+170 162 162 255
+159 144 144 255
+149 126 126 255
+138 108 108 255
+128 90  90  255
+117 72  72  255
+107 54  54  255
+96  36  36  255
+86  18  18  255
+75  0   0   255
+79  0   3   255
+83  0   5   255
+87  0   8   255
+91  0   10  255
+95  0   13  255
+99  0   15  255
+103 0   18  255
+107 0   20  255
+111 0   23  255
+115 0   25  255
+125 2   29  255
+135 4   33  255
+145 5   36  255
+155 7   40  255
+165 8   44  255
+175 20  54  255
+184 33  63  255
+194 46  73  255
+203 58  82  255
+213 71  92  255
+215 76  101 255
+217 81  111 255
+220 86  120 255
+222 91  129 255
+224 95  139 255
+226 100 148 255
+228 105 157 255
+231 110 166 255
+233 115 176 255
+235 120 185 255
+227 121 185 255
+218 122 185 255
+210 123 184 255
+201 124 184 255
+193 125 184 255
+184 126 184 255
+176 127 183 255
+167 128 183 255
+159 129 183 255
+150 129 183 255
+145 142 190 255
+140 152 196 255
+134 167 203 255
+129 179 210 255
+124 192 217 255
+119 205 223 255
+114 217 230 255
+108 230 237 255
+103 242 243 255
+98  255 250 255
+90  248 230 255
+82  241 210 255
+75  234 190 255
+67  227 170 255
+59  220 150 255
+51  213 130 255
+43  206 110 255
+36  199 90  255
+28  192 70  255
+20  185 50  255
+19  192 46  255
+18  199 42  255
+17  206 38  255
+16  213 34  255
+15  220 30  255
+14  227 26  255
+13  234 22  255
+12  241 18  255
+11  248 14  255
+10  255 10  255
+22  255 9   255
+35  255 9   255
+47  255 8   255
+59  255 8   255
+71  255 7   255
+84  255 7   255
+96  255 6   255
+108 255 6   255
+120 255 5   255
+133 255 5   255
+145 255 4   255
+157 255 4   255
+169 255 3   255
+182 255 3   255
+194 255 2   255
+206 255 2   255
+218 255 1   255
+231 255 1   255
+243 255 0   255
+255 255 0   255
+255 248 1   255
+255 242 2   255
+255 235 3   255
+255 228 4   255
+255 221 5   255
+255 215 6   255
+255 208 7   255
+255 201 8   255
+255 194 9   255
+255 188 10  255
+255 181 11  255
+255 174 12  255
+255 167 13  255
+255 161 14  255
+255 154 15  255
+255 147 16  255
+255 140 17  255
+255 134 18  255
+255 127 19  255
+255 120 20  255
+255 122 23  255
+255 124 26  255
+255 126 28  255
+255 129 31  255
+255 131 34  255
+255 133 37  255
+255 135 39  255
+255 137 42  255
+255 139 45  255
+255 141 48  255
+255 143 50  255
+255 146 53  255
+255 148 56  255
+255 150 59  255
+255 152 61  255
+255 154 64  255
+255 156 68  255
+255 158 70  255
+255 160 72  255
+255 163 75  255
+255 165 78  255
+255 167 81  255
+255 169 83  255
+255 171 86  255
+255 173 89  255
+255 175 92  255
+255 177 94  255
+255 180 97  255
+255 182 100 255
+255 184 103 255
+255 186 105 255
+255 188 108 255
+255 190 111 255
+255 192 114 255
+255 194 116 255
+255 197 119 255
+255 199 122 255
+255 201 125 255
+255 203 127 255
+255 205 130 255
+255 205 131 255
+255 206 133 255
+255 206 134 255
+255 207 135 255
+255 207 137 255
+255 208 138 255
+255 208 140 255
+255 209 141 255
+255 209 143 255
+255 210 144 255
+255 210 146 255
+255 211 147 255
+255 211 149 255
+255 212 150 255
+255 212 151 255
+255 213 153 255
+255 213 154 255
+255 214 156 255
+255 214 157 255
+255 215 159 255
+255 215 160 255
+255 216 162 255
+255 216 163 255
+255 217 165 255
+255 217 166 255
+255 218 168 255
+255 218 169 255
+255 219 171 255
+255 219 172 255
+255 220 174 255
+255 220 175 255
+255 221 176 255
+255 221 178 255
+255 222 180 255
+255 222 181 255
+255 223 183 255
+255 223 184 255
+255 224 186 255
+255 224 187 255
+255 225 189 255
+255 225 190 255
+255 226 191 255
+255 226 193 255
+255 227 194 255
+255 227 195 255
+255 228 197 255
+255 228 196 255
+255 229 198 255
+255 229 199 255
+255 230 201 255
+255 230 202 255
+255 231 203 255
+255 231 204 255
+255 232 206 255
+255 232 207 255
+255 233 209 255
+255 233 210 255
+255 234 211 255
+255 234 213 255
+255 235 214 255
+255 235 216 255
+255 236 217 255
+255 236 219 255
+255 237 220 255
+255 237 222 255
+255 238 223 255
+255 238 225 255
+255 246 227 255
+255 255 231 255
+255 255 244 255
+255 255 247 255
+255 255 255 255
diff --git a/data/colors/rh.clr b/data/colors/rh.clr
new file mode 100644 (file)
index 0000000..1c20a54
--- /dev/null
@@ -0,0 +1,67 @@
+Correlation Coefficient
+16
+0
+0   0   0   255
+156 156 156 255
+20  20  140 255
+0   0   217 255
+135 135 255 255
+85  255 85  255
+135 207 0   255
+255 255 0   255
+255 200 0   255
+255 140 0   255
+255 45  0   255
+225 0   0   255
+160 0   0   255
+153 0   98  255
+255 140 170 255
+119 0   125 255
+61  61  145 255
+47  47  143 255
+34  34  142 255
+20  20  140 255
+18  18  147 255
+16  16  155 255
+14  14  162 255
+12  12  170 255
+10  10  177 255
+8   8   184 255
+6   6   192 255
+4   4   199 255
+2   2   207 255
+0   0   214 255
+55  59  233 255
+91  91  193 255
+102 109 230 255
+130 130 255 255
+157 157 255 255
+185 185 255 255
+123 196 157 255
+107 230 103 255
+85  255 85  255
+32  150 44  255
+74  196 81  255
+135 207 0   255
+176 208 0   255
+193 219 0   255
+255 255 0   255
+255 226 0   255
+255 178 0   255
+255 140 0   255
+255 45  0   255
+225 0   0   255
+255 140 170 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
+255 255 255 255
diff --git a/data/colors/sw.clr b/data/colors/sw.clr
new file mode 100644 (file)
index 0000000..83b97dd
--- /dev/null
@@ -0,0 +1,259 @@
+Spectrum width
+2
+128
+0   0   0   0
+175 0   175 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+150 150 150 255
+150 150 150 255
+150 150 150 255
+150 150 150 255
+0   170 0   255
+0   170 0   255
+0   170 0   255
+0   170 0   255
+0   220 0   255
+0   220 0   255
+0   220 0   255
+0   220 0   255
+255 0   0   255
+255 0   0   255
+255 0   0   255
+255 0   0   255
+190 135 0   255
+190 135 0   255
+190 135 0   255
+190 135 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+255 255 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+220 220 0   255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+255 115 200 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+80  140 210 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
+225 225 225 255
diff --git a/data/colors/vr.clr b/data/colors/vr.clr
new file mode 100644 (file)
index 0000000..25eded1
--- /dev/null
@@ -0,0 +1,259 @@
+Velocity
+2
+129
+0   0   0   0
+128 0   208 255
+255 0   128 255
+255 0   128 255
+255 0   128 255
+223 0   132 255
+223 0   132 255
+223 0   132 255
+223 0   132 255
+191 0   136 255
+191 0   136 255
+191 0   136 255
+191 0   136 255
+159 0   140 255
+159 0   140 255
+159 0   140 255
+159 0   140 255
+128 0   144 255
+128 0   144 255
+128 0   144 255
+128 0   144 255
+96  0   148 255
+96  0   148 255
+96  0   148 255
+96  0   148 255
+64  0   152 255
+64  0   152 255
+64  0   152 255
+64  0   152 255
+32  0   156 255
+32  0   156 255
+32  0   156 255
+32  0   156 255
+0   0   160 255
+0   0   160 255
+0   0   160 255
+0   0   160 255
+0   37  176 255
+0   37  176 255
+0   37  176 255
+0   37  176 255
+0   75  192 255
+0   75  192 255
+0   75  192 255
+0   75  192 255
+0   112 208 255
+0   112 208 255
+0   112 208 255
+0   112 208 255
+0   149 223 255
+0   149 223 255
+0   149 223 255
+0   149 223 255
+0   187 239 255
+0   187 239 255
+0   187 239 255
+0   187 239 255
+0   224 255 255
+0   255 224 255
+0   255 224 255
+0   255 224 255
+0   255 224 255
+0   255 224 255
+0   255 224 255
+0   255 224 255
+120 255 212 255
+120 255 212 255
+120 255 212 255
+120 255 212 255
+120 255 212 255
+120 255 212 255
+120 255 212 255
+160 255 208 255
+160 255 208 255
+160 255 208 255
+160 255 208 255
+160 255 208 255
+160 255 208 255
+160 255 208 255
+128 255 166 255
+128 255 166 255
+96  255 125 255
+96  255 125 255
+64  255 83  255
+64  255 83  255
+32  255 42  255
+32  255 42  255
+0   255 0   255
+0   255 0   255
+0   255 0   255
+0   255 0   255
+2   232 2   255
+2   232 2   255
+2   232 2   255
+2   232 2   255
+5   210 5   255
+5   210 5   255
+5   210 5   255
+5   210 5   255
+7   187 7   255
+7   187 7   255
+7   187 7   255
+7   187 7   255
+9   164 9   255
+9   164 9   255
+9   164 9   255
+9   164 9   255
+11  141 11  255
+11  141 11  255
+11  141 11  255
+11  141 11  255
+14  119 14  255
+14  119 14  255
+14  119 14  255
+14  119 14  255
+16  96  16  255
+16  96  16  255
+16  96  16  255
+16  96  16  255
+35  102 35  255
+35  102 35  255
+54  109 54  255
+54  109 54  255
+74  115 74  255
+74  115 74  255
+93  122 93  255
+93  122 93  255
+112 128 112 255 
+112 128 112 255 
+144 128 144 255
+144 128 144 255
+138 102 115 255
+138 102 115 255 
+131 77  86  255
+131 77  86  255
+125 51  58  255
+125 51  58  255
+118 26  29  255
+118 26  29  255
+112 0   0   255
+112 0   0   255
+112 0   0   255
+112 0   0   255
+112 0   0   255
+132 0   0   255
+132 0   0   255
+132 0   0   255
+132 0   0   255
+153 0   0   255
+153 0   0   255
+153 0   0   255
+153 0   0   255
+173 0   0   255
+173 0   0   255
+173 0   0   255
+173 0   0   255
+194 0   0   255
+194 0   0   255
+194 0   0   255
+194 0   0   255
+214 0   0   255
+214 0   0   255
+214 0   0   255
+214 0   0   255
+235 0   0   255
+235 0   0   255
+235 0   0   255
+235 0   0   255
+255 0   0   255
+255 0   0   255
+255 0   0   255
+255 0   0   255
+255 0   32  255
+255 0   32  255
+255 0   64  255
+255 0   64  255
+255 0   96  255
+255 0   96  255
+255 0   128 255
+255 0   128 255
+255 0   144 255
+255 0   144 255
+255 26  166 255
+255 26  166 255
+255 51  188 255
+255 51  188 255
+255 77  211 255
+255 77  211 255
+255 102 233 255
+255 102 233 255
+255 128 255 255
+255 128 255 255
+255 128 255 255
+255 145 255 255
+255 145 255 255
+255 162 255 255
+255 162 255 255
+255 179 255 255
+255 179 255 255
+255 196 255 255
+255 196 255 255
+255 96  0   255
+255 96  0   255
+255 96  0   255
+255 96  0   255
+255 108 0   255
+255 108 0   255
+255 108 0   255
+255 108 0   255
+255 120 0   255
+255 120 0   255
+255 120 0   255
+255 120 0   255
+255 133 0   255
+255 133 0   255
+255 133 0   255
+255 133 0   255
+255 145 0   255
+255 145 0   255
+255 145 0   255
+255 145 0   255
+255 157 0   255
+255 157 0   255
+255 157 0   255
+255 157 0   255
+255 169 0   255
+255 169 0   255
+255 169 0   255
+255 169 0   255
+255 182 0   255
+255 182 0   255
+255 182 0   255
+255 182 0   255
+255 194 0   255
+255 194 0   255
+255 194 0   255
+255 194 0   255
+255 206 0   255
+255 206 0   255
+255 206 0   255
+255 206 0   255
+255 218 0   255
+255 218 0   255
+255 218 0   255
+255 218 0   255
+255 231 0   255
+255 231 0   255
+255 231 0   255
+255 231 0   255
+255 243 0   255
+255 243 0   255
+255 243 0   255
+255 243 0   255
+255 255 0   255
+255 255 0   255
+255 255 255 255
index 46630769a8b4d7def9a7f167e7230b77cac66ac8..9b8803785585c36284ce8c85f3be4e7d05f398f0 100644 (file)
@@ -37,7 +37,8 @@ CLEANFILES = gmon.out valgrind.out
 MAINTAINERCLEANFILES = Makefile.in
 
 test: all
-       .libs/aweather -o -d 7 -s KLSX -t '2010-12-31 17:56Z'
+       .libs/aweather -o -d 7 -s KOUN -t '2011-02-01 10:01Z'
+#.libs/aweather -o -d 7 -s KLSX -t '2010-12-31 17:56Z'
 #.libs/aweather -o -d 7 -s KDGX -t '2010-12-31 23:10Z'
 #.libs/aweather -o -d 7 -s KDGX -t '1999-05-03 23:51Z'
 
index 269176695e36d6d00ce84192d9b5c6d9c8d32f02..93ac8448713f99aca5a1497fd436d772f3f2a054 100644 (file)
@@ -204,7 +204,7 @@ city_t cities[] = {
        {LOCATION_CITY,  "KINX", "Tulsa",             {36.17,   -95.5647, 0}, 0.5},
        {LOCATION_CITY,  "KTLX", "Oklahoma City",     {35.333,  -97.2778, 0}, 0.8},
        {LOCATION_CITY,  "KVNX", "Vance AFB",         {36.740,  -98.1278, 0}, 0.3},
-       {LOCATION_NOP,   "KOUN", "Norman (KOUN)",     {35.246,  -97.4721, 0}, 0.1},
+       {LOCATION_CITY,  "KOUN", "Norman (KOUN)",     {35.246,  -97.4721, 0}, 0.1},
 
        {LOCATION_STATE, NULL,   "Oregon",            {0,        0,       0}, 0.0},
        {LOCATION_CITY,  "KMAX", "Medford",           {42.081,  -122.717, 0}, 0.3},
index 29ae442247d481acc1f5c5b6323606a0358a4232..9755b8c66cb180e9d0df7661d3c5208c81755814 100644 (file)
@@ -15,6 +15,8 @@ radar_la_SOURCES = \
        radar-info.c radar-info.h \
        ../aweather-location.c \
        ../aweather-location.h
+radar_la_CPPFLAGS = \
+       -DPKGDATADIR="\"$(dots)$(pkgdatadir)\""
 radar_la_LIBADD  = $(RSL_LIBS) $(GRITS_LIBS) \
                   $(addprefix $(top_srcdir)/lib/,$(gl_LTLIBOBJS))
 endif
index 00e640bb8bb6a945b9d136e10fa509dbdf82643f..c1a70a5da6f081d209701e51c28dc4dca3bb80f1 100644 (file)
@@ -46,18 +46,25 @@ static void _bscan_sweep(Sweep *sweep, AWeatherColormap *colormap,
        for (int ri = 0; ri < sweep->h.nrays; ri++) {
                Ray *ray  = sweep->ray[ri];
                for (int bi = 0; bi < ray->h.nbins; bi++) {
-                       /* copy RGBA into buffer */
-                       //guint val   = dz_f(ray->range[bi]);
-                       guint8 val   = (guint8)ray->h.f(ray->range[bi]);
                        guint  buf_i = (ri*max_bins+bi)*4;
-                       buf[buf_i+0] = colormap->data[val][0];
-                       buf[buf_i+1] = colormap->data[val][1];
-                       buf[buf_i+2] = colormap->data[val][2];
-                       buf[buf_i+3] = colormap->data[val][3]*0.75; // TESTING
-                       if (val == BADVAL     || val == RFVAL      || val == APFLAG ||
-                           val == NOTFOUND_H || val == NOTFOUND_V || val == NOECHO) {
+                       float  value = ray->h.f(ray->range[bi]);
+
+                       /* Check for bad values */
+                       if (value == BADVAL     || value == RFVAL      || value == APFLAG ||
+                           value == NOTFOUND_H || value == NOTFOUND_V || value == NOECHO) {
                                buf[buf_i+3] = 0x00; // transparent
+                               continue;
                        }
+
+                       /* Convert data value to index */
+                       gint idx = value * colormap->scale + colormap->shift;
+                       idx = CLAMP(idx, 0, colormap->len);
+
+                       /* Copy color to buffer */
+                       buf[buf_i+0] = colormap->data[idx][0];
+                       buf[buf_i+1] = colormap->data[idx][1];
+                       buf[buf_i+2] = colormap->data[idx][2];
+                       buf[buf_i+3] = colormap->data[idx][3]*0.75; // TESTING
                }
        }
 
@@ -218,7 +225,7 @@ void aweather_level2_set_sweep(AWeatherLevel2 *self,
 
        /* Find colormap */
        self->sweep_colors = NULL;
-       for (int i = 0; self->colormap[i].name; i++)
+       for (int i = 0; self->colormap[i].file; i++)
                if (self->colormap[i].type == type)
                        self->sweep_colors = &self->colormap[i];
        if (!self->sweep_colors) {
index ecbc47eac603f8343fc61b58f7a74646ad75c3b0..01c44c489f83c8da32bcf102ddc72142a703ee14 100644 (file)
 #include <rsl.h>
 #include "radar-info.h"
 
-         //{0xcc,0xff,0xff,0xff},{0xcc,0xff,0xff,0xff}, {0xcc,0xff,0xff,0xff},
-         //{0xcc,0x99,0xcc,0xff},{0xcc,0x99,0xcc,0xff}, {0xcc,0x99,0xcc,0xff},
-         //{0x99,0x66,0x99,0xff},{0x99,0x66,0x99,0xff}, {0x99,0x66,0x99,0xff},
-         //{0x66,0x33,0x66,0xff},{0x66,0x33,0x66,0xff}, {0x66,0x33,0x66,0xff},
-         //{0xcc,0xcc,0x99,0xff},{0xcc,0xcc,0x99,0xff}, {0xcc,0xcc,0x99,0xff},
-         //{0x99,0x99,0x66,0xff},{0x99,0x99,0x66,0xff}, {0x99,0x99,0x66,0xff},
 AWeatherColormap colormaps[] = {
-       {DZ_INDEX, "Reflectivity",
-        {{0x00,0x00,0x00,0x00}, //  0 dBZ
-          {0x00,0x00,0x00,0x00}, //  1 dBZ
-          {0x00,0x00,0x00,0x00}, //  2 dBZ
-          {0x01,0x25,0x23,0x00}, //  3 dBZ
-          {0x02,0x5b,0x56,0x00}, //  4 dBZ
-          {0x03,0x97,0x8f,0x00}, //  5 dBZ
-          {0x04,0xca,0xc3,0x10}, //  6 dBZ
-          {0x04,0xe9,0xe7,0x20}, //  7 dBZ
-          {0x04,0xef,0xf8,0x30}, //  8 dBZ
-          {0x03,0xe6,0xfd,0x40}, //  9 dBZ
-          {0x02,0xd1,0xfa,0x50}, // 10 dBZ
-          {0x01,0xb8,0xf6,0x60}, // 11 dBZ
-          {0x01,0x9f,0xf4,0x70}, // 12 dBZ
-          {0x01,0x7e,0xf9,0x80}, // 13 dBZ
-          {0x02,0x52,0xff,0x90}, // 14 dBZ
-          {0x02,0x26,0xff,0xa0}, // 15 dBZ
-          {0x03,0x07,0xff,0xb0}, // 16 dBZ
-          {0x03,0x00,0xf4,0xc0}, // 17 dBZ
-          {0x03,0x1d,0xcf,0xd0}, // 18 dBZ
-          {0x03,0x56,0x99,0xe0}, // 19 dBZ
-          {0x03,0x9a,0x5d,0xf0}, // 20 dBZ
-          {0x02,0xd8,0x27,0xff}, // 21 dBZ
-          {0x02,0xfd,0x02,0xff}, // 22 dBZ
-          {0x02,0xff,0x00,0xff}, // 23 dBZ
-          {0x02,0xfd,0x00,0xff}, // 24 dBZ
-          {0x01,0xea,0x00,0xff}, // 25 dBZ
-          {0x01,0xd5,0x00,0xff}, // 26 dBZ
-          {0x01,0xc5,0x01,0xff}, // 27 dBZ
-          {0x00,0xb7,0x01,0xff}, // 28 dBZ
-          {0x00,0xa7,0x00,0xff}, // 29 dBZ
-          {0x00,0x98,0x00,0xff}, // 30 dBZ
-          {0x00,0x8f,0x00,0xff}, // 31 dBZ
-          {0x00,0x8e,0x00,0xff}, // 32 dBZ
-          {0x27,0x9c,0x00,0xff}, // 33 dBZ
-          {0x60,0xb5,0x01,0xff}, // 34 dBZ
-          {0xa0,0xd2,0x01,0xff}, // 35 dBZ
-          {0xd8,0xeb,0x02,0xff}, // 36 dBZ
-          {0xfd,0xf8,0x02,0xff}, // 37 dBZ
-          {0xff,0xf6,0x02,0xff}, // 38 dBZ
-          {0xff,0xeb,0x01,0xff}, // 39 dBZ
-          {0xf8,0xda,0x01,0xff}, // 40 dBZ
-          {0xeb,0xc9,0x00,0xff}, // 41 dBZ
-          {0xe5,0xbc,0x00,0xff}, // 42 dBZ
-          {0xe7,0xb5,0x00,0xff}, // 43 dBZ
-          {0xec,0xb0,0x00,0xff}, // 44 dBZ
-          {0xf3,0xac,0x00,0xff}, // 45 dBZ
-          {0xf9,0xa4,0x00,0xff}, // 46 dBZ
-          {0xfd,0x95,0x00,0xff}, // 47 dBZ
-          {0xff,0x7c,0x00,0xff}, // 48 dBZ
-          {0xff,0x5a,0x00,0xff}, // 49 dBZ
-          {0xff,0x36,0x00,0xff}, // 50 dBZ
-          {0xff,0x16,0x00,0xff}, // 51 dBZ
-          {0xfd,0x00,0x00,0xff}, // 52 dBZ
-          {0xf7,0x00,0x00,0xff}, // 53 dBZ
-          {0xef,0x00,0x00,0xff}, // 54 dBZ
-          {0xe5,0x00,0x00,0xff}, // 55 dBZ
-          {0xdc,0x00,0x00,0xff}, // 56 dBZ
-          {0xd4,0x00,0x00,0xff}, // 57 dBZ
-          {0xcd,0x00,0x00,0xff}, // 58 dBZ
-          {0xc5,0x00,0x00,0xff}, // 59 dBZ
-          {0xbf,0x00,0x00,0xff}, // 60 dBZ
-          {0xbb,0x00,0x00,0xff}, // 61 dBZ
-          {0xbc,0x00,0x00,0xff}, // 62 dBZ
-          {0xc5,0x00,0x27,0xff}, // 63 dBZ
-          {0xd5,0x00,0x62,0xff}, // 64 dBZ
-          {0xe7,0x00,0xa2,0xff}, // 65 dBZ
-          {0xf5,0x00,0xda,0xff}, // 66 dBZ
-          {0xf8,0x00,0xfd,0xff}, // 67 dBZ
-          {0xec,0x0a,0xff,0xff}, // 68 dBZ
-          {0xd3,0x17,0xf8,0xff}, // 69 dBZ
-          {0xb8,0x28,0xe3,0xff}, // 70 dBZ
-          {0xa1,0x3c,0xcf,0xff}, // 71 dBZ
-          {0x98,0x54,0xc6,0xff}, // 72 dBZ
-          {0xa1,0x73,0xcb,0xff}, // 73 dBZ
-          {0xb7,0x9a,0xd7,0xff}, // 74 dBZ
-         {0xd2,0xc1,0xe6,0xff}, // 75 dBZ
-         {0xec,0xe5,0xf4,0xff}, // 76 dBZ
-         {0xfd,0xfd,0xfd,0xff}, // 77 dBZ
-         {0xff,0xff,0xff,0xff}, // 78 dBZ
-         {0xff,0xff,0xff,0xff}, // 79 dBZ
-         {0xff,0xff,0xff,0xff}, // 80 dBZ
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00}}},
-       {VR_INDEX, "Velocity",
-        {
-         {0x88,0x88,0x88,0x00}, //  0  
-         {0x98,0x77,0x77,0xff}, //  1  
-         {0x98,0x77,0x77,0xff}, //  2  
-         {0x98,0x77,0x77,0xff}, //  3  
-         {0x98,0x77,0x77,0xff}, //  4  
-          {0x89,0x00,0x00,0xff}, //  5  
-          {0xa2,0x00,0x00,0xff}, //  6  
-          {0xa2,0x00,0x00,0xff}, //  7  
-          {0xa2,0x00,0x00,0xff}, //  8  
-          {0xa2,0x00,0x00,0xff}, //  9  
-          {0xa2,0x00,0x00,0xff}, //  10 
-          {0xb9,0x00,0x00,0xff}, //  11 
-          {0xb9,0x00,0x00,0xff}, //  12 
-          {0xb9,0x00,0x00,0xff}, //  13 
-          {0xb9,0x00,0x00,0xff}, //  14 
-          {0xb9,0x00,0x00,0xff}, //  15 
-          {0xb9,0x00,0x00,0xff}, //  16 
-          {0xb9,0x00,0x00,0xff}, //  17 
-          {0xb9,0x00,0x00,0xff}, //  18 
-          {0xb9,0x00,0x00,0xff}, //  19 
-          {0xb9,0x00,0x00,0xff}, //  20 
-          {0xb9,0x00,0x00,0xff}, //  21 
-          {0xb9,0x00,0x00,0xff}, //  22 
-          {0xd8,0x00,0x00,0xff}, //  23 
-          {0xd8,0x00,0x00,0xff}, //  24 
-          {0xd8,0x00,0x00,0xff}, //  25 
-          {0xd8,0x00,0x00,0xff}, //  26 
-          {0xd8,0x00,0x00,0xff}, //  27 
-          {0xd8,0x00,0x00,0xff}, //  28 
-          {0xd8,0x00,0x00,0xff}, //  29 
-          {0xd8,0x00,0x00,0xff}, //  30 
-          {0xef,0x00,0x00,0xff}, //  31 
-          {0xef,0x00,0x00,0xff}, //  32 
-          {0xef,0x00,0x00,0xff}, //  33 
-          {0xef,0x00,0x00,0xff}, //  34 
-          {0xef,0x00,0x00,0xff}, //  35 
-          {0xef,0x00,0x00,0xff}, //  36 
-          {0xef,0x00,0x00,0xff}, //  37 
-          {0xef,0x00,0x00,0xff}, //  38 
-          {0xef,0x00,0x00,0xff}, //  39 
-          {0xef,0x00,0x00,0xff}, //  40 
-          {0xfe,0x00,0x00,0xff}, //  41 
-          {0xfe,0x00,0x00,0xff}, //  42 
-          {0xfe,0x00,0x00,0xff}, //  43 
-          {0xfe,0x00,0x00,0xff}, //  44 
-          {0xfe,0x00,0x00,0xff}, //  45 
-          {0xfe,0x00,0x00,0xff}, //  46 
-          {0xfe,0x00,0x00,0xff}, //  47 
-          {0xfe,0x00,0x00,0xff}, //  48 
-          {0xfe,0x00,0x00,0xff}, //  49 
-          {0xfe,0x00,0x00,0xff}, //  50 
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-         {0x00,0x00,0x00,0x00},
-          {0x02,0xfc,0x02,0xff}, // -50
-          {0x02,0xfc,0x02,0xff}, // -49
-          {0x02,0xfc,0x02,0xff}, // -48
-          {0x02,0xfc,0x02,0xff}, // -47
-          {0x02,0xfc,0x02,0xff}, // -46
-          {0x02,0xfc,0x02,0xff}, // -45
-          {0x02,0xfc,0x02,0xff}, // -44
-          {0x02,0xfc,0x02,0xff}, // -43
-          {0x02,0xfc,0x02,0xff}, // -42
-          {0x02,0xfc,0x02,0xff}, // -41
-          {0x01,0xe4,0x01,0xff}, // -40
-          {0x01,0xe4,0x01,0xff}, // -39
-          {0x01,0xe4,0x01,0xff}, // -38
-          {0x01,0xe4,0x01,0xff}, // -37
-          {0x01,0xe4,0x01,0xff}, // -36
-          {0x01,0xe4,0x01,0xff}, // -35
-          {0x01,0xe4,0x01,0xff}, // -34
-          {0x01,0xe4,0x01,0xff}, // -33
-          {0x01,0xe4,0x01,0xff}, // -32
-          {0x01,0xe4,0x01,0xff}, // -31
-          {0x01,0xc5,0x01,0xff}, // -30
-          {0x01,0xc5,0x01,0xff}, // -29
-          {0x01,0xc5,0x01,0xff}, // -28
-          {0x01,0xc5,0x01,0xff}, // -27
-          {0x01,0xc5,0x01,0xff}, // -26
-          {0x01,0xc5,0x01,0xff}, // -25
-          {0x01,0xc5,0x01,0xff}, // -24
-          {0x01,0xc5,0x01,0xff}, // -23
-          {0x07,0xac,0x04,0xff}, // -22
-          {0x07,0xac,0x04,0xff}, // -21
-          {0x07,0xac,0x04,0xff}, // -20
-          {0x07,0xac,0x04,0xff}, // -19
-          {0x07,0xac,0x04,0xff}, // -18
-          {0x07,0xac,0x04,0xff}, // -17
-          {0x07,0xac,0x04,0xff}, // -16
-          {0x07,0xac,0x04,0xff}, // -15
-          {0x07,0xac,0x04,0xff}, // -14
-          {0x07,0xac,0x04,0xff}, // -13
-          {0x07,0xac,0x04,0xff}, // -12
-          {0x07,0xac,0x04,0xff}, // -11
-          {0x06,0x8f,0x03,0xff}, // -10
-          {0x06,0x8f,0x03,0xff}, // -9 
-          {0x06,0x8f,0x03,0xff}, // -8 
-          {0x06,0x8f,0x03,0xff}, // -7 
-          {0x06,0x8f,0x03,0xff}, // -6 
-          {0x04,0x72,0x02,0xff}, // -5 
-          {0x7c,0x97,0x7b,0xff}, // -4 
-          {0x7c,0x97,0x7b,0xff}, // -3 
-          {0x7c,0x97,0x7b,0xff}, // -2 
-          {0x7c,0x97,0x7b,0xff}, // -1 
-         }},
-       {SW_INDEX, "Spectrum width",
-        {{0x00,0x00,0x00,0x00},
-         {0x00,0x00,0xa0,0xff},
-         {0x00,0x00,0xd0,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x20,0x20,0xff,0xff},
-         {0x40,0x40,0xff,0xff},
-         {0x70,0x70,0xff,0xff},
-         {0xa0,0xa0,0xff,0xff},
-         {0xd0,0xd0,0xff,0xff},
-         {0xff,0xff,0xff,0xff},
-         {0xff,0xb0,0xa0,0xff},
-         {0xff,0xd0,0x60,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xff,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0x00,0xf0,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0x00,0xf0,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0xf0,0x00,0x00,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0x00,0xf0,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0x00,0xf0,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0x00,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0xf0,0xf0,0xf0,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff},
-         {0x00,0x00,0x00,0xff}}},
-       {0, NULL, {{}}},
+       // type    file      ...
+       {DZ_INDEX, "dz.clr"},
+       {VR_INDEX, "vr.clr"},
+       {SW_INDEX, "sw.clr"},
+       {DR_INDEX, "dr.clr"},
+       {PH_INDEX, "ph.clr"},
+       {RH_INDEX, "rh.clr"},
+       {0,        NULL    },
 };
index e92dffc9a19ef903c78c83be3c0acf220e6c5395..664eeb1b9eb97db58e11f2b40fc13993f291f1a3 100644 (file)
 #include <rsl.h>
 
 typedef struct {
-       int type;
-       const char *name;
-       guint8 data[256][4];
+       gint     type;     // From RSL e.g. DZ_INDEX
+       gchar   *file;     // Basename of the colors file
+       gchar    name[64]; // Name of the colormap          (line 1)
+       gfloat   scale;    // Map values to color table idx (line 2)
+       gfloat   shift;    //   index = value*scale + shift (line 3)
+       gint     len;      // Length of data                    
+       guint8 (*data)[4]; // The actual colormap           (line 4..)
 } AWeatherColormap;
 
 extern AWeatherColormap colormaps[];
index 7ca05d4d19299608634811f8f9bac4207a5d1eae..54d98489f626c8c0541db397a4c726e0a645e539 100644 (file)
@@ -221,6 +221,7 @@ void _site_update(RadarSite *site)
        /* Remove old volume */
        g_debug("RadarSite: update - remove - %s", site->city->code);
        if (site->level2_ref) {
+               site->level2     = NULL;
                grits_viewer_remove(site->viewer, site->level2_ref);
                site->level2_ref = NULL;
        }
@@ -249,6 +250,7 @@ void radar_site_unload(RadarSite *site)
 
        /* Remove radar */
        if (site->level2_ref) {
+               site->level2     = NULL;
                grits_viewer_remove(site->viewer, site->level2_ref);
                site->level2_ref = NULL;
        }
@@ -331,7 +333,6 @@ RadarSite *radar_site_new(city_t *city, GtkWidget *pconfig,
        /* Add marker */
        g_idle_add_full(G_PRIORITY_LOW, _site_add_marker, site, NULL);
 
-
        /* Connect signals */
        site->location_id  = g_signal_connect(viewer, "location-changed",
                        G_CALLBACK(_site_on_location_changed), site);
@@ -625,11 +626,8 @@ void radar_conus_free(RadarConus *conus)
  ********************/
 static void _draw_hud(GritsCallback *callback, GritsOpenGL *opengl, gpointer _self)
 {
-       /* TODO, pick correct colormaps */
-       AWeatherColormap *colormap = &colormaps[0];
-
        g_debug("GritsPluginRadar: _draw_hud");
-       /* Print the color table */
+       /* Setup OpenGL */
        glMatrixMode(GL_MODELVIEW ); glLoadIdentity();
        glMatrixMode(GL_PROJECTION); glLoadIdentity();
        glDisable(GL_TEXTURE_2D);
@@ -637,16 +635,49 @@ static void _draw_hud(GritsCallback *callback, GritsOpenGL *opengl, gpointer _se
        glDisable(GL_CULL_FACE);
        glDisable(GL_LIGHTING);
        glEnable(GL_COLOR_MATERIAL);
-       glBegin(GL_QUADS);
-       int i;
-       for (i = 0; i < 256; i++) {
-               glColor4ubv(colormap->data[i]);
-               glVertex3f(-1.0, (float)((i  ) - 256/2)/(256/2), 0.0); // bot left
-               glVertex3f(-1.0, (float)((i+1) - 256/2)/(256/2), 0.0); // top left
-               glVertex3f(-0.9, (float)((i+1) - 256/2)/(256/2), 0.0); // top right
-               glVertex3f(-0.9, (float)((i  ) - 256/2)/(256/2), 0.0); // bot right
+
+       GHashTableIter iter;
+       gpointer name, _site;
+       GritsPluginRadar *self = GRITS_PLUGIN_RADAR(_self);
+       g_hash_table_iter_init(&iter, self->sites);
+       while (g_hash_table_iter_next(&iter, &name, &_site)) {
+               /* Pick correct colormaps */
+               RadarSite *site = _site;
+               if (site->hidden || !site->level2)
+                       continue;
+               AWeatherColormap *colormap = site->level2->sweep_colors;
+
+               /* Print the color table */
+               glBegin(GL_QUADS);
+               int len = colormap->len;
+               for (int i = 0; i < len; i++) {
+                       glColor4ubv(colormap->data[i]);
+                       glVertex3f(-1.0, (float)((i  ) - len/2)/(len/2), 0.0); // bot left
+                       glVertex3f(-1.0, (float)((i+1) - len/2)/(len/2), 0.0); // top left
+                       glVertex3f(-0.9, (float)((i+1) - len/2)/(len/2), 0.0); // top right
+                       glVertex3f(-0.9, (float)((i  ) - len/2)/(len/2), 0.0); // bot right
+               }
+               glEnd();
        }
-       glEnd();
+}
+
+static void _load_colormap(gchar *filename, AWeatherColormap *cm)
+{
+       g_debug("GritsPluginRadar: _load_colormap - %s", filename);
+       FILE *file = g_fopen(filename, "r");
+       if (!file)
+               g_error("GritsPluginRadar: open failed");
+       guint8 color[4];
+       GArray *array = g_array_sized_new(FALSE, TRUE, sizeof(color), 256);
+       fgets(cm->name, sizeof(cm->name), file);
+       fscanf(file, "%f\n", &cm->scale);
+       fscanf(file, "%f\n", &cm->shift);
+       while (fscanf(file, "%hhd %hhd %hhd %hhd\n",
+                       &color[0], &color[1], &color[2], &color[3]) == 4)
+               g_array_append_val(array, color);
+       cm->len  = (gint )array->len;
+       cm->data = (void*)array->data;
+       g_array_free(array, FALSE);
 }
 
 /* Methods */
@@ -707,6 +738,15 @@ static void grits_plugin_radar_init(GritsPluginRadar *self)
        self->sites      = g_hash_table_new_full(g_str_hash, g_str_equal,
                                NULL, (GDestroyNotify)radar_site_free);
        self->config     = gtk_notebook_new();
+
+       /* Load colormaps */
+       for (int i = 0; colormaps[i].file; i++) {
+               gchar *file = g_build_filename(PKGDATADIR,
+                               "colors", colormaps[i].file, NULL);
+               _load_colormap(file, &colormaps[i]);
+               g_free(file);
+       }
+
        /* Need to position on the top because of Win32 bug */
        gtk_notebook_set_tab_pos(GTK_NOTEBOOK(self->config), GTK_POS_BOTTOM);
 }