{"id":21602908,"url":"https://github.com/dials/isis_utils","last_synced_at":"2025-03-18T13:36:44.463Z","repository":{"id":40554423,"uuid":"315261892","full_name":"dials/isis_utils","owner":"dials","description":"Additional methods outside of the DIALS workflow for working with ISIS neutron diffraction data","archived":false,"fork":false,"pushed_at":"2022-05-02T22:23:07.000Z","size":192,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-24T18:36:52.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dials.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-23T09:22:49.000Z","updated_at":"2022-05-03T08:05:39.000Z","dependencies_parsed_at":"2022-08-09T23:00:39.930Z","dependency_job_id":null,"html_url":"https://github.com/dials/isis_utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dials%2Fisis_utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dials%2Fisis_utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dials%2Fisis_utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dials%2Fisis_utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dials","download_url":"https://codeload.github.com/dials/isis_utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244232383,"owners_count":20420089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T19:14:38.966Z","updated_at":"2025-03-18T13:36:44.439Z","avatar_url":"https://github.com/dials.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# isis_utils\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n![basic_tests](https://github.com/dials/isis_utils/workflows/basic%20tests/badge.svg)\n[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)\n\nThe DIALS project provides an extensible framework to analyse X-ray diffraction data.\nMuch of this work is agnostic to the method used to obtain diffraction patterns, and can equally be applied to neutron diffraction data.\nThis repository provides a bridge between data obtained from the ISIS Neutron and Muon source and DIALS, converting raw output to formats that\nDIALS can read and, additional post-processing for integration into other packages (e.g. Mantid).\n\n### Installation\n\n```\ngit clone git@github.com:dials/isis_utils.git\ncd isis_utils\npip install -r requirements.txt\n```\n\n### Convert ISIS RAW files to TOFRAW\n\n[TOFRAW format](https://www.nexusformat.org/TOFRaw.html) | [ISIS formats](https://www.isis.stfc.ac.uk/Pages/ISIS-Raw-File-Format.aspx) | [Example data](https://doi.org/10.5281/zenodo.4415768)\n\nRaw files can also be read using [OpenGenie](http://www.opengenie.org/Main_Page) and [Mantid](https://www.mantidproject.org/).\n\n\n**Convert single .raw file**\n```\npython isis_raw_reader.py my_raw_file.raw --convert_to_tofraw\nReading my_raw_file.raw into memory..\nOutputting data to my_raw_file.nxs..\n```\n\n**Convert multiple .raw files**\n```\npython isis_raw_reader.py my_raw_file_1.raw my_raw_file_2.raw --convert_to_tofraw\nReading my_raw_file_1.raw into memory..\nOutputting data to my_raw_file_1.nxs..\nReading my_raw_file_2.raw into memory..\nOutputting data to my_raw_file_2.nxs..\n```\n**Convert directory of .raw files**\n```\npython isis_raw_reader.py my_dir/*.raw --convert_to_tofraw\nReading my_dir/my_raw_file_1.raw into memory..\nOutputting data to my_dir/my_raw_file_1.nxs..\netc.\n```\n\n**Known Issues**\n\nAlthough the data in a generated TOFRAW file aims to be as close as possible to the RAW file, there are some known issues with the conversion used here.\nThis is due to changes/additions/removal of parameters between the two formats, inconsistencies between the two formats, and unknown parameters (the main source of truth for parameter names used when writing this code was [Mantid](https://github.com/mantidproject/mantid/tree/master/Framework/DataHandling/src/LoadRaw)).\n\n*The following TOFRAW params are not found (by the author!) in RAW files*\n\nraw_data_1/instrument/dae/vetos/fermi_chopper3 \\\nraw_data_1/instrument/dae/vetos/fifo \\\nraw_data_1/instrument/dae/vetos/msmode \\\nraw_data_1/instrument/dae/vetos/writing_table_file \\\nraw_data_1/instrument/detector_table_file \\\nraw_data_1/instrument/spectra_table_file \\\nraw_data_1/instrument/dae/type \\\nraw_data_1/instrument/dae/vetos/ISIS_50Hz \\\nraw_data_1/instrument/dae/vetos/TS2_pulse \\\nraw_data_1/instrument/dae/vetos/ext2 \\\nraw_data_1/instrument/dae/vetos/ext3 \\\nraw_data_1/instrument/moderator/distance \\\nraw_data_1/instrument/source/name \\\nraw_data_1/instrument/source/probe \\\nraw_data_1/instrument/source/type \\\nraw_data_1/measurement/first_run \\\nraw_data_1/measurement/id \\\nraw_data_1/measurement/label \\\nraw_data_1/measurement/subid \\\nraw_data_1/measurement/type \\\nraw_data_1/monitor_events_not_saved \\\nraw_data_1/notes \\\nraw_data_1/periods/good_frames_daq \\\nraw_data_1/periods/highest_used \\\nraw_data_1/periods/labels \\\nraw_data_1/periods/output \\\nraw_data_1/periods/sequences \\\nraw_data_1/periods/total_counts \\\nraw_data_1/run_cycle \\\nraw_data_1/run_log/* \\\nraw_data_1/sample/distance \\\nraw_data_1/sample/id \\\nraw_data_1/sample/name \\\nraw_data_1/sample/shape \\\nraw_data_1/script_name \\\nraw_data_1/seci_config \\\nraw_data_1/selog \\\nraw_data_1/total_counts \\\nraw_data_1/total_uncounted_counts\n\n*The following TOFRAW params are not consistent (as far as I can tell!) between formats*\n\ndetector_1/spectrum_index \\\nraw_data_1/framelog \\\nraw_data_1/instrument/detector_1/distance \\\nraw_data_1/instrument/detector_1/polar_angle \\\nraw_data_1/monitor_*/* \\\nraw_data_1/periods/proton_charge \\\nraw_data_1/periods/proton_charge_raw \\\nraw_data_1/periods/type \\\nraw_data_1/run_number \\\nraw_data_1/sample/type\n\nE.g. the .raw spectrum_number_table is inconsistent with the .nxs detector_1/spectrum_index.\nThe former gives a 1D array from the top right of each detector moving down each column (i.e for 64x64 detector [64,63,..]).\nThe .nxs index just gives [i for i in range(num pixels)].\nWhen visualising both give the same laue plots, consistent with SXD2001 only when using the indexing e.g. for a 64x64 detector:\n```\nnp.arange(min_pixel_idx_range, max_pixel_idx_range).reshape(64,64).T\n```\n\n### Update SXD Mantid Workspace with DIALS Output\n\n```\npython update_experiment.py mantid_workspace.nxs -take_data dials_experiment.expt\nINFO: Update Experiment:mantid_workspace.nxs copied to mantid_workspace_updated.nxs\nINFO: Update Experiment:Replacing detector panels in mantid_workspace_updated.nxs with those in dials_experiment.expt\n```\n\n### Update SXD Mantid Peaks Workspace with DIALS Output\n```\npython update_experiment.py mantid_peaks_workspace.nxs -take_data dials_experiment.expt dials_reflection_table.refl\nINFO: Update Experiment:mantid_peaks_workspace.nxs copied to mantid_peaks_workspace_updated.nxs\nINFO: Update Experiment:Replacing detector panels in mantid_peaks_workspace_updated.nxs with those in dials_experiment.expt\nINFO: Update Experiment:Replacing peak table in mantid_peaks_workspace_updated.nxs with table from dials_reflection_table.refl\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdials%2Fisis_utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdials%2Fisis_utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdials%2Fisis_utils/lists"}