Ticket #5669 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

New algorithm: ModifyDetectorDotDatFile

Reported by: Anders Markvardsen Owned by: Karl Palmen
Priority: critical Milestone: Release 2.3
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Anders Markvardsen

Description

Parameters:

InputWorkspace Filename OutputFilename (optional)

Take a workspace and overwrite the detector positions in an ISIS detector dot dat file, with the detector positions in the workspace.

An example detector dot file is attached with this ticket.

Hence this algorithm reads the detector dot dat file. For each detector listed in that file it overwrites the columns l2, theta and phi (where l2, theta and phi are assumed to be the spherical coordinates over a detector position in the workspace)

This algorithm is to allow ISIS scientists to take an existing .dat file which may vary somewhat it the details of their format, but should always have the four columns: det no, l2, theta and phi. And overwrite it with now detector positions.

Attachments

detector_all.dat (9.1 KB) - added by Anders Markvardsen 8 years ago.
parts of Merlin detector dot dat file

Change History

Changed 8 years ago by Anders Markvardsen

parts of Merlin detector dot dat file

comment:1 Changed 8 years ago by Anders Markvardsen

  • Status changed from new to assigned
  • Owner set to Karl Palmen

comment:2 Changed 8 years ago by Karl Palmen

I hope that existing code that reads a .dat file is reusable and can also form a basis for code writing a .dat file.

comment:3 Changed 8 years ago by Karl Palmen

I find this .dat file reading code as a private function LoadDetectorInfo::readDAT( filename ). This would need a public wrapper to make it accessible to the new algorithm.

comment:4 Changed 8 years ago by Karl Palmen

Actually this algorithm needs to behave quite differently when reading a .dat file. It must read all data that LoadDetectorInfo::readDAT ignores to transfer it unchanged to the output file. It may ignore the data that LoadDetectorInfo::readDAT does not ignore and replace it with data obtained from the instrument in the workspace.

comment:5 Changed 8 years ago by Karl Palmen

  • Status changed from assigned to accepted

comment:6 Changed 8 years ago by Karl Palmen

I'm going to call it ModifyDetectorDotDatFile. Most of the data will be unchanged and Overwrite seems to be too aggressive.

comment:7 Changed 8 years ago by Karl Palmen

Create skeleton algorithm re #5669

This algorithm modifies the header as planned and copies all other lines.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 45868deb83fe193f0c91453ad975a81d7aa761f9

comment:8 Changed 8 years ago by Karl Palmen

Early work on modifying the position data re #5669

More work is needed to get the format correct before taking data from the workspace.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 3e7bfefca522bc069c8d5d075a6c577d0af411b1

comment:9 Changed 8 years ago by Karl Palmen

Fixed format with test data re #5669

Still to get data from workspace.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: b15862a4860923b1a9747d919f4b9cbfa64a4651

comment:10 Changed 8 years ago by Karl Palmen

Change positions to those got from Workspace re #5669

Test showed algorithm took just over 6 seconds and changed the position columns slightly (as expected).

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 16804ac932be5759b1c5be6ab846e74cfed2f120

comment:11 Changed 8 years ago by Karl Palmen

Unit test to be written under #5797

comment:12 Changed 8 years ago by Karl Palmen

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:13 Changed 8 years ago by Karl Palmen

Create skeleton algorithm re #5669

This algorithm modifies the header as planned and copies all other lines.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 45868deb83fe193f0c91453ad975a81d7aa761f9

comment:14 Changed 8 years ago by Karl Palmen

Early work on modifying the position data re #5669

More work is needed to get the format correct before taking data from the workspace.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 3e7bfefca522bc069c8d5d075a6c577d0af411b1

comment:15 Changed 8 years ago by Karl Palmen

Fixed format with test data re #5669

Still to get data from workspace.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: b15862a4860923b1a9747d919f4b9cbfa64a4651

comment:16 Changed 8 years ago by Karl Palmen

Change positions to those got from Workspace re #5669

Test showed algorithm took just over 6 seconds and changed the position columns slightly (as expected).

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 16804ac932be5759b1c5be6ab846e74cfed2f120

comment:17 Changed 8 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:18 Changed 8 years ago by Anders Markvardsen

  • Status changed from verifying to closed
  • Summary changed from New algorithm: OverwriteDetectorDotDatFile to New algorithm: ModifyDetectorDotDatFile

Tested this using a .dat file from Merlin and outputfile = boevs.test. And algorithm worked

comment:19 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6515

Note: See TracTickets for help on using tickets.