Skip to content
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

HDF and H5 files in the same directory #64

Open
mbennun opened this issue Sep 16, 2022 · 5 comments
Open

HDF and H5 files in the same directory #64

mbennun opened this issue Sep 16, 2022 · 5 comments
Labels
Bug Something isn't working
Milestone

Comments

@mbennun
Copy link
Collaborator

mbennun commented Sep 16, 2022

If there are H5 and HDf files in the same directory (both from the same run/time steps) PsiPy will read both of them which is problematic of course.

@dstansby
Copy link
Contributor

dstansby commented Sep 16, 2022

Oops that doesn't sound good! I'll see what I can do. Out of interest what happens? A crash?

@mbennun
Copy link
Collaborator Author

mbennun commented Sep 16, 2022

No it does not crash. It reads everything but there seems to be junk, NaN everywhere

@dstansby dstansby modified the milestones: 0.3.1, 0.4 Sep 16, 2022
@dstansby dstansby added the Documentation Improvements or additions to documentation label Sep 17, 2022
@mbennun
Copy link
Collaborator Author

mbennun commented Sep 22, 2022

A related issue is the following: Sometimes we create cuts of the HDF files or manipulate them and write the results in the same directory, for example I have this in one directory:
b_ratio.h5 bp_rp.h5 br_1d.h5 bt_1d.h5 hmasip01 rho_rp.h5 vr002.h5 vt_rp.h5
bp_1d.h5 br002.h5 br_rp.h5 bt_rp.h5 rho002.h5 vp_rp.h5 vr_rp.h5

PsiPy reads all the files and this messes things up..

@dstansby
Copy link
Contributor

dstansby commented Nov 4, 2022

When there are both .h5 and .hdf files present for the same variables in the same folder, what do you think should happen? Raise an error? Or read one set of files, but warn about the duplicate files?

For the cuts, is there a clear naming structure for the cut files that is different from the naming structure for the full 3D (original) files?

@thepeteriley
Copy link
Collaborator

When there are both .h5 and .hdf files present for the same variables in the same folder, what do you think should happen? Raise an error? Or read one set of files, but warn about the duplicate files?

an optional parameter argument specifying hdf_type = 'h5' or 'hdf' would allow the user to specify. Then it would be their responsibility.

For the cuts, is there a clear naming structure for the cut files that is different from the naming structure for the full 3D (original) files?

Unfortunately not. If they are BC files, then yes "br_r0.hdf", etc., but if a user has created 2D files, they can be anything. Limiting the readable files to 001 to 000001 formats should address this, and if we add lower-level routines to read in the HDF files that would provide a way for all files to be read.

@dstansby dstansby added Bug Something isn't working and removed Documentation Improvements or additions to documentation labels Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants