Giter Club home page Giter Club logo

mantidgeometry's Introduction

Code Climate

This repository is intended to store the python helper scripts for generating the Mantid IDFs. Each instrument is supported in its own python script.

Using

The classes that will help with creating geometry are helper.py, rectangle.py, and sns_column.py. A quick example

from helper import MantidGeom

inst_name = "VISION"

xml_outfile = inst_name+"_Definition.xml"

comment = " Created by G. Fawkes "
valid_from = "2013-11-5 00:00:01"

instr = MantidGeom(inst_name, comment=comment, valid_from=valid_from)
instr.addSnsDefaults(indirect=True)
instr.addComment("SOURCE AND SAMPLE POSITION")
instr.addModerator(-16.0)
instr.addSamplePosition()

instr.writeGeom(xml_outfile)

Testing

The test harness is small and will (generically) generate false positives, but you should run it anyway.

  1. Do your work and commit it locally
  2. git checkout origin/master or just git checkout master if you did your work on a branch
  3. ./test_unchanged.py --setup will create all the geometry files before you do your work
  4. git checkout - to go back to your latest commit/branch
  5. ./test_unchaged.py to see what (if anything) has changed

There are also tests for some of the helper classes. This is run automatically by travis-ci and can be found in the .travis.yml in the script section.

Stories in Ready Travis-CI Build Status

mantidgeometry's People

Contributors

andreisavici avatar ckendrick avatar darominski avatar eurydice76 avatar gemmaguest avatar granrothge avatar gui-co avatar gvardany avatar ianbush avatar jmborr avatar kedokudo avatar lamarmoore avatar mareuter avatar martyngigg avatar mathieutillet avatar mdoucet avatar mguthriem avatar owenarnold avatar peterfpeterson avatar ricleal avatar rosswhitfield avatar stuartcampbell avatar tweber-ill avatar vickielynch avatar waffle-with-pears avatar wdzhou avatar yraoul avatar zjmorgan avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mantidgeometry's Issues

IDF schema location changed

Note in trac #9907 IDF schema reference has been changed from:

xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 Schema/IDFSchema.xsd"

to

xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"

Change the generator follow allong.

Standardize the TOPAZ geometry

The TOPAZ geometry uses much of the infrastructure from the main directory. Modify it so it is in the main directory.

Replace boiler-plate code for coordinate system

Error: Invalid attribute ‘axis’ within tag.

This means replacing

<reference-frame>
  <along-beam axis="z"/>
  <pointing-up axis="y"/>
  <handedness axis="right"/>
</reference-frame>

with

<reference-frame>
  <along-beam axis="z"/>
  <pointing-up axis="y"/>
  <handedness val="right"/>
</reference-frame>

Implement IDF generator for HB3A with 3 2x2 detectors

Implement script to generator IDF for HB3A with 3 2x2 detectors in a column. The new detector will be installed in October 2018.

Here is a brief description for the new detector.

It is information from the DCD regarding the active area and resolution of the new Si PM 2x2 detector for HB-3A. We will have a column of 3 detectors with a small gap between—Rick may have information on the gap between the active areas.

Each 2x2 detector has an active area of 116 mm x 116 mm with an estimated resolution of 700 μm and efficiency of 80% at 2 Å.

Add writeGeom to ILL generator scripts

Replace *.showGeom with *.writeGeom("./ILL/IDF/" + instrumentName + "_Definition.xml") for sans and reflectometry IDFs and add .upper() to instrumentName Figaro

New POWGEN geometry

They moved detectors around. Create a new geometry valid starting Feb 1, 2014 in response to this.

B6_1,57.855466,1.213482,0.674091
B6_2,57.967719,1.164372,1.050815
B6_3,58.285133,1.875244,1.052451
B6_4,58.172879,1.924354,0.675727
D6_1,58.810428,2.555850,0.681996
D6_2,58.878736,2.454100,1.057951
D6_3,59.534155,2.875716,1.058052
D6_4,59.465847,2.977466,0.682097
F4_1,60.277403,3.312002,-0.188698
F4_2,60.278515,3.311844,0.202842
F4_3,61.053021,3.371437,0.204600
F4_4,61.052188,3.370665,-0.186525
F5_1,60.276712,3.306714,0.249271
F5_2,60.283922,3.245203,0.639954
F5_3,61.059267,3.305252,0.638932
F5_4,61.052227,3.366152,0.247982
I4_1,62.603586,2.764479,-0.207008
I4_2,62.607118,2.764153,0.188512
I4_3,63.279216,2.370184,0.182681
I4_4,63.275821,2.370369,-0.213787
J4_1,63.285182,2.348050,-0.211768
J4_2,63.280675,2.343069,0.183108
J4_3,63.843166,1.806989,0.185768
J4_4,63.847437,1.810977,-0.209587
K4_1,63.863537,1.810435,-0.210987
K4_2,63.864805,1.808857,0.182668
K4_3,64.317117,1.175031,0.179468
K4_4,64.316123,1.176763,-0.214073

Update IDF generator scripts for ILL sans

Similar to the updated IDF generator scripts for the ILL reflectometers, sans IDFs and its generator files must be verified. Using helper.py again will increase readability.

Some updates/changes:

  • pixel_rectangular_horizontal defined but not used (D33)
  • changed sign for rectangular detector y steps (D11, D22, D33)
  • general change of detector IDs (D33)
  • changed width of detector (122 pixels) (D22)
  • added factor to account for different resolutions in x and y direction (D11)
  • enable checking if IDF gets modified during development/improvement (helper.py) via test_unchanged.py (D17, D33, D22, D11)

Cleanup /ILL/Test directory: remove d33_print_nexus.py

At least, the content of d22_print_nexus.py and d33_print_nexus.py differ only by the instrument name

f.opengroup('D22') line 45
f.opengroup('D33')

It seems to me that this does not justify two 80 line python scripts. At least one can be enough.

Maybe the variable filename can be propagated, if this file is needed

Group inelastic detectors by continous ranges of physical pixels

The idlist of every bank consists of one entry per pixel, but the can be grouped with [start,end] ranges for every tube.
For instance, the idlist of the first tube:

    <id val="5"/>
    <id val="6"/>
    <id val="7"/>
    <id val="8"/>
    <id val="9"/>
    <id val="10"/>
    <id val="11"/>
    <id val="12"/>
    <id val="13"/>
    <id val="14"/>
    <id val="15"/>
    <id val="16"/>
    <id val="17"/>
    <id val="18"/>
    <id val="19"/>
    <id val="20"/>
    <id val="21"/>
    <id val="22"/>
    <id val="23"/>
    <id val="24"/>
    <id val="25"/>
    <id val="26"/>
    <id val="27"/>
    <id val="28"/>
    <id val="29"/>
    <id val="30"/>
    <id val="31"/>
    <id val="32"/>
    <id val="33"/>
    <id val="34"/>
    <id val="35"/>
    <id val="36"/>
    <id val="37"/>
    <id val="38"/>
    <id val="39"/>
    <id val="40"/>
    <id val="41"/>
    <id val="42"/>
    <id val="43"/>
    <id val="44"/>
    <id val="45"/>
    <id val="46"/>
    <id val="47"/>
    <id val="48"/>
    <id val="49"/>

will be grouped into:
<id start="5" end="49"/>

Change in monitor designation

Just to say that I have made, to the best of my ability, changes to IDFs in instrument folder, which is to replace all mark-as=”monitor” with is=”monitor”, see http://www.mantidproject.org/IDF#mark-as.3D.22monitor.22 for more.

I had to do this manually, I have tried to be careful and all systemtests + unit test passes after change,
but if an instrument suddenly is not loading monitors correctly you know who to blame.

Anders

Create HB2B geometry file

L2 = 0.95 (m)
Detector size = 0.3 (m) x 0.3 (m)
Pixel number = 1024 x 1024

Requirement:

  1. movable 2theta
  2. rotx, roty and rotz shall be editable.

Fix newly added generator scripts

The ARCS, CNCS, and SEQUOIA generator scripts need to have the following issues corrected:

  • Wrong exception type
  • Correct default input file

Reinstate real positions for all banks, and 311 energies for bank2

In solving mantid issue #19258 and related issue in this repository (#89), the real space positions for all detectors, and the energies corresponding to the 311 analyzer for bank2 were lost because script basis_geometry.py in this repository could not reproduce those.
To-do: modify basis_geometry.py to reproduced real space positions for all detectors and appropriate energies for bank2

CNCS geometry update

Georg found a bug in his input file, so we need the new one to generate a new CNCS geometry.

Update IN4 IDF generator

The instrument definition for IN4 at ILL requires updating. The main purposes of the update are to:

  • set correct shape and dimensions for the wide-angle detector tubes
  • group the wide-angle detectors into 'boxes'
  • apply correct rotations for the boxes
  • adjust the pixel shape and dimension of the small-angle detectors
  • group the small-angle pixels into logical units
  • set the correction position and tilting for the small-angle detectors

Testing if ILL instrument definitions change

4 SANS and 2 Reflectometry IDFs will be generated using Python depending now on helper.py.
Thus, it is important to test them when modifying helper.py.

The ILL keeps its Python scripts for instrument definitions in folder /ILL/IDF/ using different naming scheme and test_unchanged.py will not check them.

To overcome this, I generalized in terms of

  • full search of the current and all sub-directories for _geometry.py and _generateIDF.py files

Major updates in terms of

  • using argparse
  • version of test_unchanged.py to 0.1.1
  • style of debug logs (not its content)
  • pylint exit code 0 (except 4 due to redefined-outer-name's)

Not modified options

  • --copy-from-mantid
  • --script
  • --help

Minimum modified option

  • --loglevel (description only)

The behavior of test_unchanged.py should not have changed.

Add testing harness

There should be a way to verify that geometries haven't been changed when working with the shared code.

New Test issue

updating issue to see what happens with slack integration.

Update HYSPEC geometry for polarization mirrors

Barry sent out the document with the equations, but here are the names for the virtual motors to make the whole thing work.

For HYSPEC, using legacy motors, please add two virtual nonmoving motors to both the satellite app and the CPA:

PSDA: polarizing supermirror deflection angle (deg), default value 0 deg
PSR: polarizing supermirror radius (mm), default value 635 mm

We don’t need them until the 2015A cycle, so no need to stop by HYSPEC this week.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.