Example: Plotting NH sea ice using hslice with proj='nps', box= [-180, 180, 60, 90], cmin=None, cmax=None, chist=False should calculate cmin and cmax based on maximum and minimum values in the desired region. However, the calculated cmax (which is then finally used for the colormap) is too small.
Looking into the code I think the issue is the following:
plot_hslice creates a triangulation object tri which uses do_reindex_vert_and_elem to reindex the vertices.
You are right, that was a bit sloppy Theoretical all info was already there i just forgot to apply it. I fixed and pushed this issue through https://github.com/FESOM/tripyview/pull/142 into the main branch!
Example: Plotting NH sea ice using hslice with
proj='nps'
,box= [-180, 180, 60, 90]
,cmin=None
,cmax=None
,chist=False
should calculatecmin
andcmax
based on maximum and minimum values in the desired region. However, the calculatedcmax
(which is then finally used for the colormap) is too small.Looking into the code I think the issue is the following:
plot_hslice
creates a triangulation objecttri
which usesdo_reindex_vert_and_elem
to reindex the vertices.do_setupcinfo
then tries to use the reindexed vertices to access thenod2
of the originaldata_plot
which will the select a totally different region from the data than it is supposed to: https://github.com/FESOM/tripyview/blob/5c85295dcac30b12774da917fa8e357a38b4826f/tripyview/sub_plot.py#L5700-L5701If
chist
is set toTrue
then it seems like global values are taken and the regional selection is discarded entirely https://github.com/FESOM/tripyview/blob/5c85295dcac30b12774da917fa8e357a38b4826f/tripyview/sub_plot.py#L5696-L5697I'm not sure how to fix this issue. Somehow the information of the remapping needs to be remembered for calculating
cmin
andcmax
.