firemodels / smv

Smokeview
Other
45 stars 177 forks source link

File names with frame number from smokeview GUI #2035

Closed obscureed closed 1 month ago

obscureed commented 1 month ago

It used to be that images saved to disk by pressing "r" would be labelled with frame number by default. (This is assuming that some results are loaded.) This worked in (I think) SMV6.7.21 (corresponding to FDS6.7.9). Now, in SMV6.9.1 (on Linux), it seems to be broken; all image files are saved with frame number 0000. If I change to the time-based suffix, that still works (but see below for an enhancement request). Frame suffixing still works for RENDERALL in a .ssf script, but not in the GUI.

As an enhancement request, it would be really convenient for me if the time suffix could have a controllable format, and/or if the default/hardwired format could be changed to have leading zeros, something like "%07.1f". This would allow files to be sortable by name in the correct order. Currently casename_2.000s.png comes after casename_12.00.png.

Another enhancement request: it would also often be really convenient if the automatically named image files could avoid clobbering (ie, overwriting) existing image files (presumably at the same frame number or time). Maybe if casename_0001.png exists, the new file would have an additional suffix and become casename_0001_01.png, casename_0001_02.png, casename_0001_03.png, etc. Something like this currently happens with the geometry-only files, which have sequential suffixes _s0000, _s0001, etc -- but this is controlled by a counter (rather than checking whether image files already exist). The counter resets and starts clobbering the previous files if smokeview is restarted, and I have lost many images that way.

As far as I know, the bug about frame-number suffix is always present, but I'll include a testcase just so that we can talk about the same run if necessary: open-fire0002.fds.txt

Thanks! Ed

drjfloyd commented 1 month ago

Ed,

In case you are not aware, in the Motion/Vierw/Render dialog box you can define a prefix for the file names written by render. So if you were rendering a temperature slice and a velocity slice to different sets of png files, you could edit the file prefix to be casename_T and casename_V (which IMO is more meaningful later on when working with multiple sets of images than _1 and _2 would be). Then files would not clobber. My two cents is I would not want anti-clobber to be the default behavior for rendering.

On your render by keypress, are you saying that if you set smokeview to a frame > 0 and hit r, that the file name is always 0000? I just tried doing some single frame renders using the windows SMV test version from a couple of days ago and it is correctly using the frame number in the filename. If you are using an old version of SMV, try the current test release (https://github.com/firemodels/test_bundles/releases).

Jason

obscureed commented 1 month ago

Yes, your second paragraph describes the bug I see on Linux using the current release, SMV-6.9.1-0-gd0b04d001-release.

I mostly use the keypress to save a few snapshots, so I would be happy to sift through them and work out which is which with any kind of differentiation. (For methodical sets of images, I use RENDERDIR and the second argument to RENDERALL in .ssf scripts.) Currently, though, if I want to have a record of velocity and temperature at the end of the simulation, I have to press "r", move the file to a new name, load some new results (or a new viewpoint), and repeat.

If I could control default behavior in my smokeview.ini, I would pick no-clobber: definitely for the -s0000.png geometry images, and probably for the _0000.png results images.

One alternative would be to have the option to add a timestamp suffix (of date and clocktime to the nearest second, say), as well as (and after) the frame-number suffix.

gforney commented 1 month ago

I'll take a look

gforney commented 1 month ago

I don't see this bug in the latest smokeview, 6.9.3 . install smokeview at https://github.com/firemodels/smv/releases/tag/SMV-6.9.3 and let me know if you still see the problem

gforney commented 1 month ago

I'll change the time suffix option so that the field width is the same for all times adding leading 0s for small times

obscureed commented 1 month ago

I had not spotted that there was a new SMV release -- I've installed that on Linux, but I still see the bug.

I've noticed a quirk: When I load the slice and it is running through the frames in a looped animation, then pressing "r" produces images for all the frames, and these have correct suffixes. The bug occurs only when I stop the animation ("t"), step to a particular frame (" " etc, or left-click on the timebar) and request a single image ("r"). I tried to restart the animation ("t") and regenerate all the images, but "r" then produces only a single image.

gforney commented 1 month ago

should be fixed in smokeview posted here. I also made the file suffixes a consistent length when using times https://github.com/gforney/test_bundles/releases/tag/SMOKEVIEW_TEST

obscureed commented 1 month ago

I can confirm that this has fixed the bug for me on Linux -- thanks!

I've also tested the zero-padded time suffixes, and that works too. The number of zeros seems to be deduced from the maximum time simulated so far -- I would have had a slight preference for using T_END instead (so that the padding is consistent with future results as well as current results in mid-simulation), but this is a minor point.

I'll close this issue. Thanks for your efforts.

gforney commented 1 month ago

smokeview's posted here use T_END

https://github.com/gforney/test_bundles/releases/tag/SMOKEVIEW_TEST

On Fri, Sep 27, 2024 at 8:42 AM obscureed @.***> wrote:

I can confirm that this has fixed the bug for me on Linux -- thanks!

I've also tested the zero-padded time suffixes, and that works too. The number of zeros seems to be deduced from the maximum time simulated so far -- I would have had a slight preference for using T_END instead (so that the padding is consistent with future results as well as current results in mid-simulation), but this is a minor point.

I'll close this issue. Thanks for your efforts.

— Reply to this email directly, view it on GitHub https://github.com/firemodels/smv/issues/2035#issuecomment-2379187262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6UCRQO7LXBAMRCUJHXTSDZYVHD3AVCNFSM6AAAAABO27STVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZZGE4DOMRWGI . You are receiving this because you commented.Message ID: @.***>

-- Glenn Forney