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

EMU: "booster heater" scripts #5133

Closed
Tom-Willemsen opened this issue Jan 30, 2020 · 6 comments
Closed

EMU: "booster heater" scripts #5133

Tom-Willemsen opened this issue Jan 30, 2020 · 6 comments

Comments

@Tom-Willemsen
Copy link
Contributor

Tom-Willemsen commented Jan 30, 2020

As an instrument scientist on EMU I would like to be able to use the "booster heater" with all of my cryostat. This is an additional heater that helps the cryostat to warm up faster when it is near the top of it's range (between about 200-300K).

They have not previously had this functionality on EMU, but there are scripts from HiFi which implement the control required for the "booster heater". They would like this functionality on EMU.

Currently this is implemented by overwriting the settemp script with some other GCL code. We will need to think about a different solution in IBEX.

Acceptance criteria:

  • settemp varies it's behaviour depending on whether the booster heater is being used.

Notes:

  • This is not required for cycle by EMU for start of cycle. However it may become required during cycle, depending on which exact pieces of kit are used for particular experiments.
  • The code is on the share under \\isis\shares\ISIS_Experimental_Controls\data for tickets\Ticket5133_muon_boost_scripts
@JamesKingWork
Copy link
Contributor

Have created a branch of the instconfigs repo named NDXEMU_booster_scripts where this will be implemented

@JamesKingWork
Copy link
Contributor

Method for selecting how we are using the booster heater (if at all) is to create a block in the config called Cryostat_Booster with one of the three values: "WHITE_CRYOSTAT", "CCR", "MUSR_CRYOSTAT".
There must also be Temp_HeaterAuto_2 and Temp_Power_2 blocks present in order to be able to use a booster heater. Temp_HeaterAuto_2 is set to 1 when using the booster heater or if not using the booster heater both Temp_HeaterAuto_2 and Temp_Power_2 are set to 0.

If none of these blocks are available we default to using the regular settemp.

@Alistair-McGann-Tessella
Copy link

Alistair-McGann-Tessella commented Feb 28, 2020

Feedback:
in tpar_loader:

  • The exceptions should not print something when raised, instead print when the exceptions get caught
    in temp_routines:
  • I'm not a fan of the nested try statements in settemp_boost_ccr, can they be avoided?
  • Move print statements from within the exceptions to when these exceptions are caputured
  • In the open genie script booster_heater_white temp_heaterauto_2 refers to 'inverted logic' and is set to 1 when turning off and 0 when turning on. This doesn't appear to be done in the python script

@Alistair-McGann-Tessella

Feedback:
It seems more common to override the __str__ method of an exception rather than calling base Exception's __init__ method, see https://docs.python.org/3.3/tutorial/errors.html#user-defined-exceptions

By doing this, instead of having a call to hasattr, you would check if str(e) == 'None' or '', then print the error message if it exists.

@JamesKingWork
Copy link
Contributor

JamesKingWork commented Mar 9, 2020

Feedback:
It seems more common to override the __str__ method of an exception rather than calling base Exception's __init__ method, see https://docs.python.org/3.3/tutorial/errors.html#user-defined-exceptions

By doing this, instead of having a call to hasattr, you would check if str(e) == 'None' or '', then print the error message if it exists.

I've been doing it for ages the other way, the way you have suggested is a lot better though. Usually you wouldn't have to check hasattr as you often always expect a message, but in some cases this is not true (not a case I've come across until now.

@Alistair-McGann-Tessella

👍 This is ready to be merged. I've added a shutdown task to merge branch NDXEMU_booster_scripts -> NDXEMU, see #5324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants