Skip to content

Commit

Permalink
Merge pull request #1005 from wright-group/from-colors
Browse files Browse the repository at this point in the history
From colors
  • Loading branch information
kameyer226 committed May 6, 2021
2 parents 5df6c30 + f01c224 commit fc2a60f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
- explicitly store axes as fixed string dtype

### Fixed
- Fixed bug in `from_COLORS` that misordered the relationship between variables and channels for 1D datasets.
- Avoid passing both `vmin/vmax` and `norm` to `pcolor*` methods

## [3.3.3]
Expand Down
7 changes: 4 additions & 3 deletions WrightTools/data/_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ def from_COLORS(
label = dic["label"]
data.create_variable(name=key, values=a, units=units, label=label)
# channels
points = tuple(arr[axes[key.split("=")[0]]["idx"]] for key in scanned.keys())
if len(scanned) == 1: # 1D data
(xi,) = scanned.values()
for key in channels.keys():
channel = channels[key]
zi = arr[channel["idx"]]
data.create_channel(name=key, values=zi)
grid_i = griddata(points, zi, xi, method="nearest")
data.create_channel(name=key, values=grid_i)
else: # all other dimensionalities
# channels
points = tuple(arr[axes[key.split("=")[0]]["idx"]] for key in scanned.keys())
xi = tuple(np.meshgrid(*scanned.values(), indexing="ij"))
for key in channels.keys():
channel = channels[key]
Expand Down

0 comments on commit fc2a60f

Please sign in to comment.