Ticket #6260 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

Expose several methods from Peaks and PeaksWorkspace to the new Python API

Reported by: Ruth Mikkelson Owned by: Peter Peterson
Priority: major Milestone: Release 2.4
Component: Python Keywords:
Cc: Blocked By:
Blocking: Tester: Karl Palmen

Description (last modified by Peter Peterson) (diff)

The following methods need to be exposed: PeaksWorkspace:

sample() mutableSample() getInstrument

Peak:

getRow() getCol() findDetector

Also EventWorkspaces should have sample and mutableSample exposed. Other MatrixWorkspaces do have those methods( after a loadIsawUB at least)

There are many methods in the PeaksWorkspace and Peak Objects that are already exposed.

Change History

comment:1 Changed 8 years ago by Peter Peterson

  • Owner set to Peter Peterson
  • Status changed from new to assigned
  • Cc petersonpf@… removed

comment:2 Changed 8 years ago by Peter Peterson

  • Description modified (diff)

comment:3 Changed 8 years ago by Peter Peterson

For PeaksWorkspace

import mantid
peaksws = mantid.simpleapi.LoadIsawPeaks('Test/AutoTestData/TOPAZ_3007.peaks')
print peaksws.sample()
print peaksws.mutableSample()
print peaksws.getInstrument()

Then to mess with the Peak itself

peak = peaksws.getPeak(0)
print peak.getRow()
print peak.getCol()

IPeak.findDetector is not currently exposed.

comment:4 Changed 8 years ago by Peter Peterson

  • Status changed from assigned to accepted

comment:5 Changed 8 years ago by Peter Peterson

For EventWorkspace

import mantid
eventws = mantid.simpleapi.LoadEventNexus('Test/AutoTestData/CNCS_7860_event.nxs')
print eventWS.sample()
print eventWS.mutableSample()

comment:6 Changed 8 years ago by Peter Peterson

Refs #6260. Added IPeak.findDetector() to python.

To test follow the script in the ticket comments and add the line print peak.findDetector() at the bottom.

Changeset: 1f6bb1e666033b0588af3be74489d2042b74da90

comment:7 Changed 8 years ago by Peter Peterson

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

To verify, run:

import mantid
peaksws = mantid.simpleapi.LoadIsawPeaks('Test/AutoTestData/TOPAZ_3007.peaks')
print peaksws.sample()
print peaksws.mutableSample()
print peaksws.getInstrument()
peak = peaksws.getPeak(0)
print peak.getRow()
print peak.getCol()
print peak.findDetector()

eventws = mantid.simpleapi.LoadEventNexus('Test/AutoTestData/CNCS_7860_event.nxs')
print eventWS.sample()
print eventWS.mutableSample()

All of the files suggested here are in github.

comment:8 Changed 8 years ago by Peter Peterson

Refs #6260. Added IPeak.findDetector() to python.

To test follow the script in the ticket comments and add the line print peak.findDetector() at the bottom.

Changeset: 1f6bb1e666033b0588af3be74489d2042b74da90

comment:9 Changed 8 years ago by Karl Palmen

  • Status changed from verify to verifying
  • Tester set to Karl Palmen

comment:10 Changed 8 years ago by Karl Palmen

  • Status changed from verifying to closed

Script runs without error after fixing simple errors not related to this ticket.

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7106

Note: See TracTickets for help on using tickets.