CDAT / uvcmetrics

metrics aka diagnostics for comparing models with observations or each other
BSD 3-Clause "New" or "Revised" License
3 stars 8 forks source link

png generated too many times #237

Closed doutriaux1 closed 8 years ago

doutriaux1 commented 8 years ago

in case of multi plots, tm2 template is saved after every plots, i.e 3 png/svg/pdf are generated the first two being overwritten essentially by the 3rd one. png/svf/pdf are time consuming we should avoid generating the first two pngs.

mcenerney1 commented 8 years ago

Agreed. The next generation of diags should correct this!

painter1 commented 8 years ago

This issue is why it's hard to get really good multi (aka combined, composite) plots and really good simple (single) plots in the same run. I'm working on it now.

painter1 commented 8 years ago

The problem lies in the method canvas.setcolormap(). Apparently its meaning in VCS is to set the color map for all parts of a compound plot. So it redraws the parts which have already been drawn. (The redrawn plots are incorrect, but that's another issue). What we want is for that method to set the color map only for what happens next, with no redrawing. That is, we don't want the update() call. My solution is to replace "canvas.setcolormap(spam) with "canvas.colormap=spam".

This is less modular than it should be; it would be better to add an argument to setcolormap() to skip the update call. I'll create a VCS issue about that.

painter1 commented 8 years ago

The updated (recomputed) plots are sometimes preferred by the automated test baselines, and in one case I think they're better. We should do things right the first time, but for now I put in some special-case coding to handle them.

Also, the section which writes compound plot files was indented wrong, which made it run in an inner loop. I fixed that. This was probably what had instigated this issue in the first place.

Timings will be noticeably faster with these changes, but not dramatically so (maybe dramatically faster for plot set 11).

doutriaux1 commented 8 years ago

@painter1 yes the badly indented section for compound plots is definitely what triggered this issue I could see my plot being cleared and replotted 3 times when debugging plotset 5.