-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from rayosborn/VDS
Virtual Fields
- Loading branch information
Showing
5 changed files
with
298 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python | ||
# ----------------------------------------------------------------------------- | ||
# Copyright (c) 2019-2022, NeXpy Development Team. | ||
# | ||
# Distributed under the terms of the Modified BSD License. | ||
# | ||
# The full license is in the file COPYING, distributed with this software. | ||
# ----------------------------------------------------------------------------- | ||
import argparse | ||
|
||
from nexusformat import __version__ | ||
from nexusformat.nexus import NXentry, NXroot, nxconsolidate | ||
|
||
|
||
def main(): | ||
|
||
parser = argparse.ArgumentParser( | ||
description="Copy a NeXus file to another file") | ||
parser.add_argument('files', action='store', nargs='*', | ||
help="name of NeXus input files (wild cards allowed)") | ||
parser.add_argument('-d', '--data', required=True, | ||
help="path to the NXdata group") | ||
parser.add_argument('-s', '--scan', help="path to the scan variable") | ||
parser.add_argument('-e', '--entry', default='entry', | ||
help="name of NXentry group") | ||
parser.add_argument('-o', '--output', required=True, | ||
help="name of NeXus output file") | ||
parser.add_argument('-v', '--version', action='version', | ||
version=f'nxconsolidate v{__version__}') | ||
|
||
args = parser.parse_args() | ||
|
||
scan_data = nxconsolidate(args.files, args.data, scan_path=args.scan) | ||
NXroot(NXentry(scan_data, name=args.entry)).save(args.output, 'w-') | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
# ----------------------------------------------------------------------------- | ||
# Copyright (c) 2019-2021, NeXpy Development Team. | ||
# | ||
# Distributed under the terms of the Modified BSD License. | ||
# | ||
# The full license is in the file COPYING, distributed with this software. | ||
# ----------------------------------------------------------------------------- | ||
import argparse | ||
|
||
from nexusformat import __version__ | ||
from nexusformat.nexus import nxdir | ||
|
||
|
||
def main(): | ||
|
||
parser = argparse.ArgumentParser( | ||
description="Print a NeXus file tree") | ||
parser.add_argument('file', action='store', help="name of NeXus file") | ||
parser.add_argument('-s', '--short', action='store_true', | ||
help="print only the first level") | ||
parser.add_argument('-v', '--version', action='version', | ||
version=f'nxdir v{__version__}') | ||
|
||
args = parser.parse_args() | ||
|
||
nxdir(args.file, short=args.short) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.