You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we do not provide the span parameter, the function works correctly. For example:
img = ds.transfer_functions.shade(agg, cmap=customColorMap, how='linear')
However, the function behaves incorrectly when the span parameter is provided. For example:
img = ds.transfer_functions.shade(agg, cmap=customColorMap, how='linear', span = [valMin ,valMax])
This is because the data has been shifted with the offset = min(agg). However, the span value is not shifted accordingly. One way to fix it is to shift the span value
suggested fix:
In the function _interpolate(), we modify the function as follows:
CHANGE FROM:
if span is None:
span = [np.nanmin(data), np.nanmax(data)]
else:
if how == 'eq_hist':
# For eq_hist to work with span, we'll need to store the histogram
# from the data and then apply it to the span argument.
raise ValueError("span is not (yet) valid to use with eq_hist")
span = interpolater(span,0)
TO:
if span is None:
span = [np.nanmin(data), np.nanmax(data)]
else:
if how == 'eq_hist':
# For eq_hist to work with span, we'll need to store the histogram
# from the data and then apply it to the span argument.
raise ValueError("span is not (yet) valid to use with eq_hist")
if 'offset' in locals():
span = interpolater(span - offset,0)
else:
span = interpolater(span,0)
The text was updated successfully, but these errors were encountered:
Description
If we do not provide the span parameter, the function works correctly. For example:
img = ds.transfer_functions.shade(agg, cmap=customColorMap, how='linear')
However, the function behaves incorrectly when the span parameter is provided. For example:
img = ds.transfer_functions.shade(agg, cmap=customColorMap, how='linear', span = [valMin ,valMax])
This is because the data has been shifted with the offset = min(agg). However, the span value is not shifted accordingly. One way to fix it is to shift the span value
suggested fix:
In the function _interpolate(), we modify the function as follows:
CHANGE FROM:
if span is None:
span = [np.nanmin(data), np.nanmax(data)]
else:
if how == 'eq_hist':
# For eq_hist to work with span, we'll need to store the histogram
# from the data and then apply it to the span argument.
raise ValueError("span is not (yet) valid to use with eq_hist")
span = interpolater(span,0)
TO:
if span is None:
span = [np.nanmin(data), np.nanmax(data)]
else:
if how == 'eq_hist':
# For eq_hist to work with span, we'll need to store the histogram
# from the data and then apply it to the span argument.
raise ValueError("span is not (yet) valid to use with eq_hist")
if 'offset' in locals():
span = interpolater(span - offset,0)
else:
span = interpolater(span,0)
The text was updated successfully, but these errors were encountered: