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

Allow Tube Calibration File for Each Bank #10390

Closed
PeterParker opened this issue May 30, 2014 · 7 comments
Closed

Allow Tube Calibration File for Each Bank #10390

PeterParker opened this issue May 30, 2014 · 7 comments
Labels
ESS Team Issue and pull requests managed by the ESS development team ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS SANS Issues and pull requests related to SANS Stale This label is automatically applied to issues that are automatically closed by the stale bot

Comments

@PeterParker
Copy link
Contributor

sans_feature
This issue was originally TRAC 9547

The TUBECALIBFILE command in User Files can be used to specify a calibration file for the SANS2D instrument. Currently, this is set up so that only one file can be specified.

Unfortunately, each bank in SANS2D will have it's own calibration file, and so we need some way to specify ''two'' files, and then merge the detector positions of one bank into a workspace containing the detectors positions of the other.

I'm not yet sure how we should change the command to accommodate this. Maybe TUBECALIBFILE/REAR and TUBECALIBFILE/FRONT is the best way, but I'd like to try and make things as generic as possible.

Meanwhile, I provided a script to Richard so that he can merge the files manually so that he only has to specify one file. It may come in useful when implementing this ticket:

  #!python
# Files in \\isis\inst$\Instruments$\NDXSANS2D\user\Masks:
rear_calib_file = "TubeCalibrationTable_512pixel_23563rear_29May14.nxs"
front_calib_file = "TubeCalibrationTable_512pixel_23610front_28May14.nxs"

rear_calib = Load(rear_calib_file)
front_calib = Load(front_calib_file)

det_id_list = []
for ws_index in range(rear_calib.getNumberHistograms()):
    spectrum = rear_calib.getSpectrum(ws_index)
    if spectrum.getSpectrumNo() < 0:
        continue
    for det_id in spectrum.getDetectorIDs():
        if det_id > 2523511:
            continue
        det_id_list.append(det_id)

rear_inst = rear_calib.getInstrument()

# Creating an unmanaged version of the algorithm is important here.  Otherwise,
# things get really slow, and the workspace history becomes unmanageable.
move = AlgorithmManager.createUnmanaged('MoveInstrumentComponent')
move.initialize()
move.setChild(True)
move.setProperty("Workspace", "front_calib")
move.setProperty("RelativePosition", False)

for det_id in det_id_list:
    det = rear_inst.getDetector(det_id)
    if "rear-detector" in det.getFullName():
        move.setProperty("DetectorID", det_id)
        move.setProperty("X", det.getPos().getX())
        move.setProperty("Y", det.getPos().getY())
        move.setProperty("Z", det.getPos().getZ())
        move.setProperty("DetectorID", det_id)
        move.execute()

RenameWorkspace(InputWorkspace="front_calib", OutputWorkspace="merged")
DeleteWorkspace(Workspace="rear_calib")
@PeterParker PeterParker added the SANS Issues and pull requests related to SANS label Jun 3, 2015
@PeterParker PeterParker self-assigned this Jun 3, 2015
@AntonPiccardoSelg
Copy link
Contributor

@Mantid-Matthew Ask the scientists if this is relevant (It would only be relevant for SANS2D)

@gemmaguest gemmaguest added the ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS label Aug 29, 2019
@gemmaguest
Copy link
Member

Check with Richard what, if anything, needs doing

@RichardHeenan
Copy link

SANS2d does still have to run a script to merge two tubecalibfiles, would be useful to keep them separate! (Thinking ahead to ESS, where LoKI will start with 5 detector banks, and eventually reach 9, with many more tubes in each, keeping them separate would be essential !)

@smk78
Copy link
Contributor

smk78 commented Jul 16, 2020

After review by the SANS Group, ISIS SANS wishes to continue with the two tube calibrations in the one file. But RKH says ESS SANS will want them separate! The ticket should remain open, but it is not a priority for ISIS SANS.

@smk78 smk78 added the ESS SANS label Jul 16, 2020
@gemmaguest gemmaguest added ESS Team Issue and pull requests managed by the ESS development team and removed ESS SANS labels Jul 29, 2020
@stale
Copy link

stale bot commented Feb 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you feel this is incorrect please comment to keep it alive, with a reason why.

To prevent closure, e.g. for long-term planning issues, add the "Never Stale" label.

@stale stale bot added the Stale This label is automatically applied to issues that are automatically closed by the stale bot label Feb 22, 2021
@smk78 smk78 added Never Stale and removed Stale This label is automatically applied to issues that are automatically closed by the stale bot labels Feb 22, 2021
@stale
Copy link

stale bot commented Aug 30, 2021

This issue has been automatically marked as stale because it has not had activity in 6 months. It will be closed in 7 days if no further activity occurs.
Allowing issues to close as stale helps us filter out issues which can wait for future development time. All issues closed by stale bot act like normal issues; they can be searched for, commented on or reopened at any point.
If you'd like a closed stale issue to be considered, feel free to either re-open the issue directly or contact a developer.
To extend the lifetime of an issue please comment below, it helps us see that this is still affecting you and you want it fixed in the near-future. Extending the lifetime of an issue may cause the development team to prioritise it over other issues, which may be closed as stale instead.

@stale stale bot added the Stale This label is automatically applied to issues that are automatically closed by the stale bot label Aug 30, 2021
@stale
Copy link

stale bot commented Sep 6, 2021

This issue has been closed automatically. If this still affects you please re-open this issue with a comment or contact us so we can look into resolving it.

@stale stale bot closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ESS Team Issue and pull requests managed by the ESS development team ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS SANS Issues and pull requests related to SANS Stale This label is automatically applied to issues that are automatically closed by the stale bot
Projects
Status: Stale
Development

No branches or pull requests

7 participants