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

Does not work off site and can't locate raw files #7

Open
chelberserker opened this issue Oct 25, 2022 · 0 comments
Open

Does not work off site and can't locate raw files #7

chelberserker opened this issue Oct 25, 2022 · 0 comments

Comments

@chelberserker
Copy link

This function


    def _src_data_path(self):
        """
        Returns the raw path to the data file. This is useless if you aren't on
        site, but used by islatu to guess where you've stored the data file
        locally.
        """
        # This is far from ideal; there currently seems to be no standard way
        # to refer to point at information stored outside of the nexus file.
        # If you're a human, it's easy enough to find, but with code this is
        # a pretty rubbish task. Here I just grab the first .h5 file I find
        # and run with it.
        found_h5_files = []
        print()
        def recurse_over_nxgroups(nx_object, found_h5_files):
            """
            Recursively looks for nxgroups in nx_object that, when cast to a
            string, end in .h5.
            """
            #print(self)
            for key in nx_object:
                new_obj = nx_object[key]
                if str(new_obj).endswith(".h5"):
                    found_h5_files.append(str(new_obj))
                if isinstance(new_obj, nx.NXgroup):
                    recurse_over_nxgroups(new_obj, found_h5_files)

        return found_h5_files[0]

should not be looking inside the .nxs files, but rather look for files IN THE SAME directory by mask '_src_data_path/Scan??????.h5'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant