Closed yejinhong10 closed 1 year ago
Hi @yejinhong10 I have transferred your question to or help repository in which we collect all questions.
Thank you for bringing this up. We have recently changed some of the internal code structure in discretisedfield and the documentation for ovf2vtk
unfortunately is outdated. For discretisedfield version >= 0.65.0 please use ovf2vtk
as follows:
python3 -m discretisedfield.io.ovf2vtk ...
You do not have to install anything else separately.
Thank you! Now trying the new command, Error while finding module specification for 'discretisedfield.io.ovf2vtk' (ModuleNotFoundError: No module named 'discretisedfield.io') I get this error message, any suggestion or help??
Which version of discretisedfield do you have (python3 -c "import discretisedfield; print(discretisedfield.__version__)"
)?
It is version 0.64.0. Hmm, now I tried (python3 -m discretisedfield.ovf2vtk -i _10ns_test1-Oxs_TimeDriver-Magnetization-0000000-0000079.omf —o my-ovf-file.vtk )
File "/Users/yejinhong/opt/anaconda3/envs/ubermag/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/yejinhong/opt/anaconda3/envs/ubermag/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/yejinhong/opt/anaconda3/envs/ubermag/lib/python3.9/site-packages/discretisedfield/ovf2vtk.py", line 42, in
I got this error message. Do you have any idea of what '-o not supported' would mean? Thank you.
Now it works with python3 -m discretisedfield.ovf2vtk -i filename.omf command.
I was wondering if this allows running all omf files given a directory? I am trying with
cd directory
for filename in *.omf; do python3 -m discretisedfield.ovf2vtk --add all $filename ${filename%.omf}.vtk; done
but this does not seem to work.
This or something similar should work. Which shell are you using (try echo $SHELL
). What exactly is the error message?
I am using /bin/zsh shell, and the error message is
usage: ovf2vtk [-h] --input INPUT [INPUT ...] [--output OUTPUT [OUTPUT ...]] ovf2vtk: error: the following arguments are required: --input/-i
Thanks !!
ovf2vtk
must be called with -i
(or --input
). It does not support an argument --all
When you omit -o
(the output file name) input file names are used and .omf
is replaced with .vtk
.
Multiple inputs are supported and you should be able to use wildcards and shell expansion as follows:
python3 -m discretisedfield.ovf2vtk -i *.omf
If this does not work try replacing --add all
with -i
and remove ${filename%.omf}.vtk
in your for loop.
Additionally, could you please try if replacing python3 -m discretisedfield.ovf2vtk
with ovf2vtk
works. If not, could you please post your error message? Thank you.
Thanks so much! Adding
-i *.omf
solved the problem.
When I was using ovf2vtk
instead of python3 -m discretisedfield.ovf2vtk
, the error message is as follows:
Traceback (most recent call last):
File "/Users/yejinhong/opt/miniconda3/bin/ovf2vtk", line 5, in
Thank you again!
I am trying the command shown on https://ubermag.github.io/documentation/notebooks/discretisedfield/ovf2vtk.html to convert omf to vtk, but it says the command is not found. Am I supposed to install ovf2vtk following https://fangohr.github.io/software/ovf2vtk/index.html ? However the link for the source file to install ovf2vtk seems to be broken. Thanks so much