\(\renewcommand\AA{\unicode{x212B}}\)

SaveDspacemap v1

Summary

Saves an OffsetsWorkspace into a POWGEN-format binary dspace map file.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

OffsetsWorkspace

Mandatory

An input OffsetsWorkspace to save.

DspacemapFile

Input

string

Mandatory

The DspacemapFile on output contains the d-space mapping. Allowed extensions: [‘.dat’]

PadDetID

Input

number

300000

Pad Data to this number of pixels

Description

The POWGEN d-space map file format is a binary list of the conversion. It needs to be a minimum size, determined by the PadDetID parameter.

Usage

Example - Save an OffsetsWorkspace to d-space map file:

import os

filepath = config["default.savedirectory"]
if filepath == "":
  filepath = config["defaultsave.directory"]
savefilename = os.path.join(filepath, "test_offset.dat")

ws = LoadEmptyInstrument(Filename="POWGEN_Definition_2015-08-01.xml")
LoadCalFile(InputWorkspace=ws,CalFilename=r'PG3_golden.cal',MakeGroupingWorkspace='0',MakeMaskWorkspace='0',WorkspaceName='PG3_gold')
SaveDspacemap(InputWorkspace="PG3_gold_offsets", DspacemapFile=savefilename)

print("File created =  {} , file size =  {}".format(os.path.exists(savefilename),  os.path.getsize(savefilename)))

Output:

File created =  True , file size =  8168616

Categories: AlgorithmIndex | DataHandling\Text

Source

C++ header: SaveDspacemap.h

C++ source: SaveDspacemap.cpp