Skip to content

Commit 8678efc

Browse files
committed
Fix a problem that the option --format in petar.movie is not read properly due to a bug in Python; Add an example of resuming simulations in README
1 parent 838059f commit 8678efc

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,12 @@ Any snapshot of particle data generated during a simulation can be utilized to r
489489
```shell
490490
petar -p input.par [options] [snapshot filename]
491491
```
492-
Here, _input.par_ stores the previous parameter choices used in a simulation, automatically generated from the prior simulation. Users can modify _input.par_ directly to adjust parameters before resuming, or specify new parameters in `[options]` within the aforementioned `petar` command.
492+
Here, _input.par_ stores the previous parameter choices used in a simulation, automatically generated from the prior simulation.
493493

494-
It is important to note that if users wish to introduce new options in addition to _input.par_, these options must be placed after "-p input.par"; otherwise, they will be overwritten by the parameters stored in _input.par_.
494+
It is possible to modify the options for resumed simulations in two ways. Users can either directly modify _input.par_ to adjust parameters before resuming or specify new parameters in `[options]` within the `petar` command mentioned earlier. It is crucial to place `[options]` after `-p input.par` to prevent them from being overwritten by the parameters stored in _input.par_. For instance, to update the end time of the simulation to 10 after resuming simulations from the snapshot file `data.5`, use the following command:
495+
```shell
496+
petar -p input.par -t 10 data.5
497+
```
495498

496499
By default, after resuming, the snapshot files with the same name will be replaced. However, for other output files, new data will be appended to the existing ones (e.g., filenames with suffixes like esc, group, etc.).
497500

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1231
1+
1233

tools/movie.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ def usage():
10181018
print(" --marker-scale [F] Amplify the size of markers in x-y plot: 1.0")
10191019
print(" --mass-power [F] The power index of mass to obtain sizes of markers: 1.0")
10201020
print(" --suppress-images Do not plot snapshot images (PNG files) and use matplotlib.animation instead of imageio; this cannot use multiprocessing, much slower")
1021-
print(" --format [S] Video format, requires imageio installed; for some formats (e.g., AVI, MP4) may require FFmpeg and imageio-FFmpeg installed: ", plot_format)
1021+
print(" --format-file [S] Video format, requires imageio installed; for some formats (e.g., AVI, MP4) may require FFmpeg and imageio-FFmpeg installed: ", plot_format)
10221022
print(" --dpi [F] DPI of image: ", dpi)
10231023
print("Important notes")
10241024
print(" 1) Ensure correct options are set for '-i', '-t', and '-G' to read snapshots accurately and calculate Kepler orbital parameters correctly.")
@@ -1038,7 +1038,7 @@ def usage():
10381038
'unit-length=','unit-vel=','format-time=',
10391039
'skiprows=','generate-binary=',
10401040
'plot-ncols=','plot-xsize=','plot-ysize=',
1041-
'suppress-images','format=','cm-mode=','core-file=',
1041+
'suppress-images','format-file=','cm-mode=','core-file=',
10421042
'n-layer-cross=','n-layer-point=','layer-alpha=','marker-scale=','mass-power=',
10431043
'cm-boxsize=','compare-in-column','dpi=']
10441044
opts,remainder= getopt.getopt( sys.argv[1:], shortargs, longargs)
@@ -1190,7 +1190,7 @@ def usage():
11901190
kwargs['mass_power'] = float(arg)
11911191
elif opt in ('--suppress-images'):
11921192
plot_images = False
1193-
elif opt in ('--format'):
1193+
elif opt in ('--format-file'):
11941194
plot_format = arg
11951195
elif opt in ('--dpi'):
11961196
dpi = float(arg)

0 commit comments

Comments
 (0)