-
Notifications
You must be signed in to change notification settings - Fork 10
Fail the measurement when InstrJob timeout #62
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
Open
lcontami
wants to merge
13
commits into
main
Choose a base branch
from
mag_sources
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ec0e859
Fail the measurement when InstrJob timeout
585eac0
Integrating the code of Madar
755e0d0
Stopping the sweep when the measure is stopped !
d1abdb4
correct the test ?
177f08a
for the test again
abe5ed2
mistakes
ce54d25
fix test
5c75205
test again
2c1c96a
small bug in c4g
b53565f
...
f53a5b6
...
55d670f
small typo
b032f3d
small mistake
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,8 @@ | |
|
||
class C4G(CS4): | ||
"""Driver for the superconducting magnet power supply Cryomagnetics 4G. | ||
|
||
The fields are read and given in kG (can't change it in G4) | ||
The display only is in T. | ||
""" | ||
|
||
def open_connection(self, **para): | ||
|
@@ -40,7 +41,7 @@ def open_connection(self, **para): | |
self.read_termination = '\n' | ||
# Need to write the lower limit in kG for source 4G | ||
#(LLIM needs to be lower than any ULIM) | ||
self.write('LLIM -70') | ||
self.write('LLIM -70;') | ||
|
||
@secure_communication() | ||
def read_output_field(self): | ||
|
@@ -62,7 +63,6 @@ def target_field(self): | |
"""Field that the source will try to reach. | ||
|
||
""" | ||
# in T | ||
return float(self.ask('ULIM?').strip(' kG')) / 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you keep the division the field is not given in kG. |
||
|
||
@target_field.setter | ||
|
@@ -76,6 +76,16 @@ def target_field(self, target): | |
# can't reuse CS4 class because a semi-colon is needed | ||
self.write('ULIM {};'.format(target * 10)) | ||
|
||
@instrument_property | ||
@secure_communication() | ||
def field_sweep_rate(self): | ||
"""Rate at which to ramp the field (T/min). | ||
|
||
""" | ||
# converted from A/s to T/min | ||
rate = float(self.ask('RATE? 0')) | ||
return rate * (60 * self.field_current_ratio) | ||
|
||
@field_sweep_rate.setter | ||
@secure_communication() | ||
def field_sweep_rate(self, rate): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change in behavior ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was specified in the job after job.cancel() was called (which in turn calls this method), it is more logical to integrate it directly to the method called as cancel()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, you may stop a sweep but need to run a new one right after in which case automatically closing the switch heater would be a bad idea (this is hypothetical). Also if you wanted to go that way you need to be sure all driver are consistent.