-
Notifications
You must be signed in to change notification settings - Fork 5
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
DEV: created filter objects with attenuation #25
Open
brookeferber
wants to merge
22
commits into
xpdAcq:master
Choose a base branch
from
brookeferber:filter
base: master
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 11 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
76f8ca4
DEV: created filter objects with attenuation
brookeferber 3f99215
STY: Changed "filter" and added line at file's end
brookeferber bf87a08
STY: Removed extra blank line @ end file
brookeferber 5871e33
ENH: Added filter object to attenuate image
brookeferber 474d983
STY: renamed get_attenuation and XRayFilter
brookeferber b471dda
TST: Added filter test and revised to meet test
brookeferber 8a30964
ENH: Revised to add filters to det factory
brookeferber ed33c69
ENH: Added testing for filters pertaining to det
brookeferber f2b544f
TST: Developed filter tests
brookeferber 4dc3391
DEV: Revised det for trigger_read; fixd filter bug
brookeferber 373d44e
BUG: Get attenuation if filter is installed
brookeferber 8369f1b
BUG: Updated image cycles
brookeferber 3288cb5
BUG: if filter_bank never executes
brookeferber 60a79aa
BUG: Fixed filter tests
brookeferber 8f2b446
BUG: Revised shutter assertion
brookeferber 365f441
BUG: Adjusted data used in dets test
brookeferber 2e9e93b
BUG: Switched shutter set position
brookeferber 1a89d76
ENH: Added updated detector tests
brookeferber 48b367c
ENH: add tests file
brookeferber 7e4a2dc
BUG: Adjusted shutter test for cycle inc
brookeferber 0614614
BUG: Updated travis for bluesky
brookeferber b7cd3fa
STY: Revised code for flake8 errors
brookeferber 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 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 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import bluesky.examples as be | ||
|
||
|
||
class FilterBank(): | ||
def __init__(self, attenuations=None): | ||
if attenuations is None: | ||
attenuations = {'filter1': .5, 'filter2': .5, 'filter3': .5, | ||
'filter4': .5} | ||
self.filter_list = [] | ||
for k, v in attenuations.items(): | ||
f = XRayFilter(k, {'rad': lambda x: x}, {'x': 0}, v) | ||
self.filter_list.append(f) | ||
setattr(self, k, f) | ||
|
||
def get_attenuation(self): | ||
totalAttenuation = 1 | ||
for i in self.filter_list: | ||
totalAttenuation *= i.get_XRayFilter_attenuation() | ||
return totalAttenuation | ||
|
||
|
||
class XRayFilter(be.Mover): | ||
def __init__(self, name, fields, initial_set, attenuation, **kwargs): | ||
self.attenuation = attenuation | ||
super().__init__(name, fields, initial_set, **kwargs) | ||
|
||
def get_XRayFilter_attenuation(self): | ||
########################################### | ||
print(self.read) | ||
########################################### | ||
position_info = self.read() | ||
if (position_info.get('x') == 0): | ||
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. Put your print here print('######################')
print(position_info)
print('######################') 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. Ok! I'll do that now. Thank you. |
||
return 0 | ||
else: | ||
return self.attenuation | ||
|
||
|
||
XRayFilterBankExample = FilterBank() | ||
|
This file contains 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 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.
Need empty line at the end of the file.