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

Handling of the "silence" parameter in program_segments #21

Open
jonaskeller opened this issue Jan 26, 2018 · 1 comment
Open

Handling of the "silence" parameter in program_segments #21

jonaskeller opened this issue Jan 26, 2018 · 1 comment
Labels

Comments

@jonaskeller
Copy link

It seems like this line

silence = data.pop("silence", False)

is looking for the silence parameter one level too high and should actually be called for target_data in the loop a few lines below (if at all). Besides always setting silence to False, it also causes a KeyError exception when silence gets passed to getattr(segment, target)() twice, once by itself and once within **kwargs.

@jordens jordens added the bug label Feb 27, 2018
@jonaskeller
Copy link
Author

To add more context, the current version works with the waveform defined here:

pdq/pdq/test/test_dac.py

Lines 53 to 94 in 702c069

_test_program = [
[
{
"trigger": True,
"duration": 20,
"channel_data": [
{"bias": {"amplitude": [0, 0, 2e-3]}},
{"bias": {"amplitude": [1, 0, -7.5e-3, 7.5e-4]}},
{"dds": {
"amplitude": [0, 0, 4e-3, 0],
"phase": [.25, .025],
}},
],
},
{
"duration": 40,
"channel_data": [
{"bias": {"amplitude": [.4, .04, -2e-3]}},
{
"bias": {"amplitude": [.5]},
"silence": True,
},
{"dds": {
"amplitude": [.8, .08, -4e-3, 0],
"phase": [.25, .025, .02/40],
"clear": True,
}},
],
},
{
"duration": 20,
"channel_data": [
{"bias": {"amplitude": [.4, -.04, 2e-3]}},
{"bias": {"amplitude": [.5, 0, -7.5e-3, 7.5e-4]}},
{"dds": {
"amplitude": [.8, -.08, 4e-3, 0],
"phase": [-.25],
}},
],
},
]
]

However, this definition contradicts the description and example at http://pdq.readthedocs.io/en/v3.0-rc2/manual.html#wavesynth-format , where silence is an entry of the spline_data dictionary rather than the spline dictionary.

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

No branches or pull requests

2 participants