| 3178 | return result |
| 3179 | |
| 3180 | def inverse(self, value): |
| 3181 | if not self.scaled(): |
| 3182 | raise ValueError("Not invertible until scaled") |
| 3183 | |
| 3184 | result, is_scalar = self.process_value(value) |
| 3185 | |
| 3186 | gamma = self.gamma |
| 3187 | vmin, vmax = self.vmin, self.vmax |
| 3188 | |
| 3189 | resdat = result.data |
| 3190 | resdat[resdat > 0] = np.power(resdat[resdat > 0], 1 / gamma) |
| 3191 | resdat *= (vmax - vmin) |
| 3192 | resdat += vmin |
| 3193 | |
| 3194 | result = np.ma.array(resdat, mask=result.mask, copy=False) |
| 3195 | if is_scalar: |
| 3196 | result = result[0] |
| 3197 | return result |
| 3198 | |
| 3199 | |
| 3200 | class BoundaryNorm(Normalize): |