Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polygon Intersection Bug #14477

Closed
raquelalvarezbanos opened this issue Nov 17, 2015 · 0 comments
Closed

Polygon Intersection Bug #14477

raquelalvarezbanos opened this issue Nov 17, 2015 · 0 comments
Assignees
Labels
Reflectometry Issues and pull requests related to reflectometry
Milestone

Comments

@raquelalvarezbanos
Copy link
Contributor

We observed this problem via ConvertToReflectometryQ.
This was reported by Jos. The following script:

r=s.Runs()
dref=s.OurLoad(r[36265,36266,36267,36268])
MoveInstrumentComponent(dref,'DetectorBench',Y=0.0404)
#dtrans=s.OurLoad(r[36252])

Transo=CreateTransmissionWorkspaceAuto(dtrans,AnalysisMode="MultiDetectorAnalysis",ProcessingInstructions="380-428",WavelengthMin=2.0)
IvsQ2o, IvsLam2o, thetaOut=ReflectometryReductionOneAuto(dref,AnalysisMode="MultiDetectorAnalysis",ProcessingInstructions="390-450", FirstTransmissionRun=Transo, ThetaIn="0.64",WavelengthMin=2.0,CorrectionAlgorithm='None',StrictSpectrumChecking=False,CorrectDetectorPositions=False)#,NormalizeByIntegratedMonitors=False
IvsQo, IvsLamo, thetaOut=ReflectometryReductionOneAuto(dref,AnalysisMode="MultiDetectorAnalysis",ProcessingInstructions=','.join(map(str, range(250, 558))), FirstTransmissionRun=Transo, ThetaIn="0.64",WavelengthMin=2.0,CorrectionAlgorithm='None',StrictSpectrumChecking=False,CorrectDetectorPositions=False)#,NormalizeByIntegratedMonitors=False
TvLo = ConvertSpectrumAxis(IvsLamo,'SignedTheta')

ConvertToReflectometryQ(TvLo,IncidentTheta=0.64,DumpVertexes=True,OverrideIncidentTheta=True, OutputWorkspace="QxQz",OutputVertexes="Qtableo",Extents=[-1.2e-6,-6.67e-7,0.01034,0.010388],NumberBinsQz=4,NumberBinsQx=4,Method='NormalisedPolygon',OutputAsMDWorkspace=False)

produces a NaN value (white bin):

bug

The bug is caused by the V2D equality operator, which uses a standard tolerance value 1e-6 (too high in some cases). This makes PolygonIntersection fail when calculating the intersection if one of the polygons is small enough.

@raquelalvarezbanos raquelalvarezbanos added the Reflectometry Issues and pull requests related to reflectometry label Nov 17, 2015
@raquelalvarezbanos raquelalvarezbanos added this to the Release 3.6 milestone Nov 17, 2015
@raquelalvarezbanos raquelalvarezbanos self-assigned this Nov 17, 2015
raquelalvarezbanos added a commit that referenced this issue Nov 17, 2015
raquelalvarezbanos added a commit that referenced this issue Nov 18, 2015
@OwenArnold OwenArnold changed the title Fix a bug affecting ConvertToReflectometryQxQz Polygon Intersection Bug Nov 18, 2015
shahrozahmed1 pushed a commit that referenced this issue Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reflectometry Issues and pull requests related to reflectometry
Projects
None yet
Development

No branches or pull requests

1 participant