-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adjustements to include .rod downloads and parsing other rod files
- Loading branch information
Ron Hildebrandt
authored and
Ron Hildebrandt
committed
Dec 13, 2024
1 parent
2241edf
commit e092d14
Showing
7 changed files
with
77 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Downloading multiple .rod files | ||
|
||
## download_rods_script.sh | ||
|
||
Adjust the file `download_rods_script.sh`to the range of download you want. | ||
Default start is `1` and default end is `3`. | ||
Be careful: Do not trigger unneccsary amounts of downloads. | ||
|
||
Take a look [here](https://solsa.crystallography.net/rod/1000679.html), to get valid .rod IDs. For this example its e.g. `1000679`. | ||
|
||
## Add the command as script | ||
|
||
`chmod +x download_rods_script.sh` | ||
|
||
## Exectutute the script | ||
|
||
`./download_rods_script.sh` | ||
|
||
|
||
## Convert the downloaded .rod files | ||
|
||
via the pynxtools-raman command: | ||
|
||
`dataconverter <PATH_TO>/1000679.rod src/pynxtools_raman/config/config_file_rod.json --reader raman --nxdl NXraman --output rod_example_neuxs.nxs` | ||
|
||
|
||
# Automatec conversion of all .rod files to .nxs files | ||
|
||
## Add the command as script | ||
`chmod +x convert_all_rod_to_nxs.sh` | ||
|
||
## Call the script | ||
`./src/download_rod_files/convert_all_rod_to_nxs.sh` | ||
|
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,14 @@ | ||
#!/bin/bash | ||
|
||
# Define the folder containing the .rod files | ||
folder_path="./src/download_rod_files" | ||
|
||
# Loop over all .rod files in the folder | ||
for file in "$folder_path"/*.rod; do | ||
# Extract the base name (without extension) | ||
base_name=$(basename "$file" .rod) | ||
|
||
# Execute the command with the base name | ||
dataconverter "$file" src/pynxtools_raman/config/config_file_rod.json \ | ||
--reader raman --nxdl NXraman --output "${base_name}.nxs" | ||
done |
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,6 @@ | ||
#!/bin/bash | ||
|
||
#for X in {1..3}; do | ||
for X in {1000004..1000005}; do | ||
download_rod_file "$X" | ||
done |
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
Binary file not shown.
Binary file not shown.