-
Notifications
You must be signed in to change notification settings - Fork 33
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
VlsvReader does not open new vlsv files #22
Comments
Cheers for the report, Ill look into it |
Is this still an issue? Im not sure if I have the time to work on it. I'm asking because I think there was a similar problem with vlsvextract, which led some people to believe this was a result of a bug. |
Yes this is still an issue, those function calls above are in python code and parameters vxblocks_ini etc. do not exist in new Vlasiator files. |
Master still writes out vxbloxks_ini, etc. In addition it also writes out the new velocity space metadata. Thus analysator still understands the distribution function data of the vlasiator files. The multipop branch only writes out hte new metadata form. Before merging that it would be good to fix this issue. It is important to still support also the old format though. |
In multipop it doesn't make sense to write vxblocks_ini etc. because there are multiple velocity meshes. Would it be possible to probe the existence of those parameters in Python code and only read them if they are defined? |
I guess so. If the new one is defined then that metadata, otherwise old style is read. |
Any fixes or workarounds for this issue? I get the same error when trying to use VlsvReader on vlsv files from the parallel hybrid code. |
No, this has not been fixed at the moment. Based on Arto's comments above one should be able to read the MESH_BBOX and pick the three correct values. |
I think none of the parameters required by VlsvReader (lines 37-57) are available in the current vlsv format. https://github.com/fmihpc/analysator/blob/master/pyVlsv/vlsvreader.py#L37 My MESH_BBOX looks like:
|
I'll take a look at this now |
Fixed the mesh metadata reading bug. It should read both old and new vlasiator files. This has not been verified thoroughly. @rjarvinen, you can test the fix_issue22 branch. I tested with BCS files, and one could not plot the velocity distribution function with the picker. This, I think, is a separate issue though. Also, to support multiple populations one would need to do more work, now it assumes there is only one "avgs" population. |
I have the fix for that picker somewhere, I haven't had time to go through everything to see whether it is a large-scale problem or only there. |
I already started some work on this, did not want to commit this unfinished thing here. In any case I guess that should be done in a separate branch |
Hi, my fixes for the vdf picker errors are in the branch https://github.com/fmihpc/analysator/tree/picker_fix now. |
I fixed another place where avgs are also read in the picker_fix branch |
@rjarvinen You were trying to open VLSV files from Corsair using Vlasiator analysator? These have never been exactly compatible. However, the required values should be stored in the Corsair output files as well. |
Most of the things which are not related to velocity space might work, that could at least be a good target. There has been/is a lot of vlasiator specific things there though this far. |
@ykempf, can you test the issue22 branch with multipop files and report the results? If that works, then we can merge this branch. Further incompabilities with @rjarvinen parallel hyb code could be handled by a separate issue. |
For the picker I opened a separate bug, #25 , let's discuss those things there. |
@galfthan Great, thanks! fix_issue22 branch can read the files from Corsair. Not everything works yet as you mentioned. E.g. calculations.cut_through tries to read xmin etc. using VlsvReader.read_parameter function, which fails of course for the new style vlsv files. It seems straightforward to fix these based on your update. @sandroos Yes, I'm reading VLSV files from Corsair. I guess there are no fundamental reasons why I shouldn't do this? |
@rjarvinen I'll provide a better answer to the file issue now that I have more time: Analysator assumes that VLSV files contain information about (one) spatial mesh and (one) velocity mesh. However, Corsair files typically do not contain velocity distributions like Vlasiator files do. https://github.com/fmihpc/analysator/blob/master/pyVlsv/vlsvreader.py#L37 Some of the parameters read above (vxblocks_ini, vx_min, etc) are specific to Vlasiator-type velocity distributions. If Analysator was improved so that it
then I think Analysator would work with Corsair VLSV files as well. |
These xmins are scattered around in many places: miscellaneous/rankine.py: xmin = vlsvReader.read_parameter("xmin") |
We should add functions to vlsvreader for returning xmin, etc. These are already stored in internal variables __xmin .. with the compability fixes. Better to have these compability things in just one place |
If no avgs mesh is defined in the file, then this branch initializes the velocity mesh to have a maximum size of 0 blocks. Some of the velocity space functions may exit gracefully, at least one could add checks for velocity spaces with a size of 0 x 0 x 0. If and when analysator properly supports multiple populations then the case with 0 should be taken care of at the same time. |
I tried replacing old style xmin etc. calls in cutthrough.py by vlsvReader._VlsvReader__xmin in fix_issue22 branch, and was able to use cut_through function successfully for new style vlsv files from Corsair. |
Good! we should though fix it in the main version by writing a get style function, these __ variables are supposed to be private: |
I added the interface, now it should be taken in use. |
I implemented the new interface in files pyCalculations/* |
Due to the multipop development the way how velocity mesh data is stored in vlsv files was changed to be more general. VlsvReader classes in python tools do not open the new files any more. The velocity meshes are now stored in the same way as spatial mesh(es).
Parameters
vxblocks_ini, vyblocks_ini, vzblocks_ini
are no longer used. This information is read from the MESH_BBOX arrays that contain mesh metadata.Here's a recap of the new format:
mesh=<species name>
orname=<species name>
For example, the bounding box arrays above define the velocity mesh extents (which used to be given in
vxblocks_ini
etc) for particle speciesElectron
andProton
.(This came up when I was trying to use analyzator to extract time series from n vlsv files, but ofc that didn't work out)
TODO:
The text was updated successfully, but these errors were encountered: