-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skip_patches_outside_xylimits doesn't work with grid mappings #278
Comments
I agre e- False should be the default. It would be an impossible one for users to debug. But
those in the know will know to set the flag to True.
— Marsha
… On Sep 21, 2020, at 2:01 PM, Randall J. LeVeque ***@***.***> wrote:
The new feature added in #262 <#262> skips plotting AMR patches that are outside the specified xlimits and ylimits, unless plotaxes.skip_patches_outside_xylimits == False as provided in #263 <#263>. By default this is set to True.
I recently discovered that this doesn't work well with a mapped grid where a mapc2p function is provided to map the computational xc, yc to the physical space xp, yp for plotting. The problem is that xlimits, ylimits are specified in physical coordinates (what you see in the plot) whereas the check on whether to skip a patch is done before mapc2p is applied, and hence the xc ,yc used in the test are in computational coordinates. A patch may easily appear to be outside the limits even though after the mapping it will be inside. This is also a problem in 1d if mapc2p is specified to map xc to xp.
This would be fairly easy to fix if mapc2p were also a ClawPlotAxes attribute, and it seems like it probably should be since the axes should presumably be in the same coordinate system regardless of what item is being plotted on it.
However, for some reason (my bad design, probably), mapc2p is an attribute of a ClawPlotItem, or if that is not set, the code also checks for mapc2p as an attribute of plotdata, but there is no plotaxes.mapc2p.
Cleaning this up will take some work and needs further discussion.
In the meantime, users should be aware that if using a mapc2p function, you should also set plotaxes.skip_patches_outside_xylimits to False.
Should this be the default, rather than True?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#278>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGUGCYX52CVU32NL7XZJBTSG6IILANCNFSM4RU2NGEA>.
|
I would favor keeping the default as The reasoning is that there are very few who use mapped grids to plot and I would consider those who do to be the experts. I also think that the speedup that this enables for the generic GeoClaw user, who is more than likely not an expert, would be well worth the issue as @rjleveque outlined it. Furthermore I think that adding Of course just my 2¢. |
I used mapped grids, and I would not remember to do that. Not an expert!
— Marsha
… On Sep 21, 2020, at 8:30 PM, Kyle Mandli ***@***.***> wrote:
I would favor keeping the default as True myself.
The reasoning is that there are very few who use mapped grids to plot and I would consider those who do to be the experts. I also think that the speedup that this enables for the generic GeoClaw user, who is more than likely not an expert, would be well worth the issue as @rjleveque <https://github.com/rjleveque> outlined it. Furthermore I think that adding mapc2p to the plotting capabilities is something we should enforce as was done in the old Matlab plotting code.
Of course just my 2¢.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#278 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGUGC7XMWQH7ROI74YBQ53SG7VZPANCNFSM4RU2NGEA>.
|
@mjberger oh man, if you are not an expert are any of us except for maybe @rjleveque 😉 |
I won't say how long it took me to figure out why nothing showed up in my plots with a mapped grid the other day, but much too long. So I agree with @mjberger that True is not a good default in general. On the other hand for many GeoClaw applications with zoomed plots are small regions from big computations, it is nice to have it skip patches by default. I've got a quick and dirty fix that I think sets the default to True unless there's a mapc2p function for any item in which case it's set to False. We can consider to discuss better long-term options. |
Instead of always setting to True if not set by user, set to False if there is a mapc2p function for some item, since it doesn't work properly in this case. clawpack#278
I like the idea you had in the PR myself. |
Do you think we should raise a warning maybe? |
Where would we raise it, whenever Note there's a possible warning message in the file that's not currently activated but could be, and would be even more tiresome since it would print a message for every axes in every frame if patches are being skipped...
|
Not sure, I was thinking maybe if someone set |
The new feature added in #262 skips plotting AMR patches that are outside the specified xlimits and ylimits, unless
plotaxes.skip_patches_outside_xylimits == False
as provided in #263. By default this is set toTrue
.I recently discovered that this doesn't work well with a mapped grid where a
mapc2p
function is provided to map the computationalxc, yc
to the physical spacexp, yp
for plotting. The problem is thatxlimits, ylimits
are specified in physical coordinates (what you see in the plot) whereas the check on whether to skip a patch is done beforemapc2p
is applied, and hence thexc ,yc
used in the test are in computational coordinates. A patch may easily appear to be outside the limits even though after the mapping it will be inside. This is also a problem in 1d ifmapc2p
is specified to mapxc
toxp
.This would be fairly easy to fix if
mapc2p
were also aClawPlotAxes
attribute, and it seems like it probably should be since the axes should presumably be in the same coordinate system regardless of what item is being plotted on it.However, for some reason (my bad design, probably),
mapc2p
is an attribute of aClawPlotItem
, or if that is not set, the code also checks formapc2p
as an attribute ofplotdata
, but there is noplotaxes.mapc2p
.Cleaning this up will take some work and needs further discussion.
In the meantime, users should be aware that if using a
mapc2p
function, you should also setplotaxes.skip_patches_outside_xylimits
toFalse
.Should this be the default, rather than
True
?The text was updated successfully, but these errors were encountered: