EDNA Plugin: EDPluginSPDCakev1_1

Name:EDPluginSPDCakev1_1
Project:execPlugins
Path:execPlugins/plugins/EDPluginGroupSPD-v1.0/plugins/EDPluginSPDCakev1_1.py
Author:Jérôme Kieffer
Date:
Copyright:European Synchrotron Radiation Facility, Grenoble, France
License:GPLv3+
Module doc:This is an alernative to the very first implementation of the SPD plugin for azimuthal integration.
It is no more used, just here for demonstration purpose
Class doc:The purpose of this plugin is to use SPD to do "cake" azimuthal integration,
i.e. azimutal integration of powder diffraction images.
The version 1.0 of EDPluginSPDCake will just call spd as strand alone version of the program, so this implementation is far from being optimal in performances.
Few tips and tricks about SPD ...
* When doing azimuthal integration, spd keeps the first axis in length (meter of detector) and not in 2Theta as expected (or Fit2D does).
This is why there is a numpy transformation with ArcTan in the post process with a subsequent rebinning.
* This version includes a full 2pi azimuthal integration from SPD. This is the main difference with plugin v1_0
* Last but not least, there is currently NO tilt, only spline distortion of the image

Datamodels: XSDataInputSPDCake
targetNamespace "http://www.edna-site.org"

import XSDataCommon.XSData
import XSDataCommon.XSDataInput
import XSDataCommon.XSDataResult
import XSDataCommon.XSDataImage
import XSDataCommon.XSDataImageExt
import XSDataCommon.XSDataWavelength
import XSDataCommon.XSDataBoolean
import XSDataCommon.XSDataFile
import XSDataCommon.XSDataDouble
import XSDataCommon.XSDataInteger
import XSDataCommon.XSDataString
import XSDataCommon.XSDataStatus
import XSDataCommon.XSDataImage
import XSDataCommon.XSDataLength
import XSDataCommon.XSDataAngle

complex type XSDataInputSPD extends XSDataInput {
    angleOfTilt : XSDataAngle optional
    beamCentreInPixelsX : XSDataDouble optional
    beamCentreInPixelsY : XSDataDouble     optional
    bufferSizeX : XSDataInteger optional
    bufferSizeY : XSDataInteger optional
    darkCurrentImageFile : XSDataFile optional
    distortionFileX : XSDataFile optional
    distortionFileY : XSDataFile     optional
    flatFieldImageFile : XSDataFile optional
    inputFile : XSDataFile
    outputFileType : XSDataString optional
    pixelSizeX : XSDataLength optional
    pixelSizeY : XSDataLength optional
    sampleToDetectorDistance : XSDataLength    optional
    spatialDistortionFile : XSDataFile optional
    tiltRotation : XSDataAngle
    wavelength : XSDataWavelength     optional
    outputDir : XSDataFile optional
}

complex type XSDataInputSPDCake extends XSDataInputSPD {
    innerRadius : XSDataDouble optional
    outerRadius : XSDataDouble optional
    outputAxis : XSDataString optional
    outputDirCake : XSDataFile optional
    deleteCorImg : XSDataBoolean optional
    startAzimuth : XSDataAngle optional
    stepAzimuth : XSDataAngle optional
    stopAzimuth : XSDataAngle optional
    maskFile : XSDataFile optional
    intensityScaleFactor : XSDataDouble optional
    correctTiltMask : XSDataBoolean optional
}

complex type XSDataResultSPD extends XSDataResult {
    correctedFile : XSDataFile optional
}

complex type XSDataResultSPDCake extends XSDataResultSPD {
    cakedFile : XSDataFile
}

complex type XSDataPeakPosition extends XSData {
    "Set of pixel coordinates and the associated 2Theta diffraction angle"
    position1 : XSDataDouble
    position2 : XSDataDouble
    twoTheta  : XSDataDouble
}

complex type XSDataInputRefineDiffractionGeometry extends XSDataInput {
    points : XSDataPeakPosition []
    pixelSize1 : XSDataLength
    pixelSize2 : XSDataLength
    splineFile : XSDataFile optional
    guessSampleDetectorDistance : XSDataLength optional
    guessPointOfNormalIncidence1 : XSDataLength optional
    guessPointOfNormalIncidence2 : XSDataLength optional
    guessRotation1: XSDataAngle optional
    guessRotation2: XSDataAngle optional
    guessRotation3: XSDataAngle optional
}

complex type XSDataResultRefineDiffractionGeometry extends XSDataResult {
    sampleDetectorDistance : XSDataLength 
    pointOfNormalIncidence1 : XSDataLength 
    pointOfNormalIncidence2 : XSDataLength 
    rotation1: XSDataAngle 
    rotation2: XSDataAngle 
    rotation3: XSDataAngle 
}