.. algorithm:: .. summary:: .. relatedalgorithms:: .. properties:: Description ----------- Modifies an ISIS detector dot data file, so that the detector positions are as in the given workspace. This algorithm can be used to transfer a calibration done via the :ref:`algm-ApplyCalibration` algorithm to an ISIS detector dot dat file by selecting a workspace that has been modified by ApplyCalibration. A typical ISIS dot data file has a format like this:: DETECTOR.DAT generated by CREATE_DETECTOR_FILE 286729      14 det no.  offset    l2     code     theta        phi         w_x         w_y         w_z         f_x       ...     11   0.000  -3.25800     1   180.00000     0.00000     0.00000     0.00000     0.00000     0.00000    ...       21   0.000  -1.50400     1   180.00000     0.00000     0.00000     0.00000     0.00000     0.00000    ... 1110001   5.300   2.88936     3    52.28653  -140.67224     0.02540     0.02540     0.00283     0.02750   ...  1110002   5.300   2.88794     3    52.26477  -140.72720     0.02540     0.02540     0.00283     0.02750    ...    .... Each row corresponds to a detector whose type is indicated in the ``code`` column. The algorithm will only modify values in columns ``l2``, ``theta`` and ``phi`` and only if the value in the ``code`` column is 3, which indicates a PSD gas tube. For more details about the detector dot data file see `LoadDetectorInfo#File\_format `__. Usage ----- **Example - Modify a simple dot dat file** .. testcode:: ExModifyDotDatFileSimple import os result = Load("MUSR00015189") group = result[0] ws_1 = group[0] ws_2 = group[1] newFile = os.path.join(os.path.expanduser("~"), "detector_1_M.dat") # Run the Algorithm ModifyDetectorDotDatFile(ws_1, "detector_1.dat", newFile) # Check the output file print("File Exists: {}".format(os.path.exists(newFile))) f = open( newFile, 'r' ) file = f.read().split('\n') f.close() for line in file[0:4]: # print the line truncating before system dependent line break can take effect # also stripping off any trailing spaces print(line[0:89].rstrip()) Output: .. testoutput:: ExModifyDotDatFileSimple File Exists: True DETECTOR.DAT generated by CREATE_DETECTOR_FILE and edited by hand and modified by MANTID 286729 14 det no. offset l2 code theta phi w_x w_y w_z 1 5.300 0.20156 3 43.99491 -129.37500 0.02540 0.02540 0.0 .. testcleanup:: ExModifyDotDatFileSimple os.remove( newFile ) .. categories:: .. sourcelink::