-
Notifications
You must be signed in to change notification settings - Fork 92
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
Adding get_nbdata #15
base: master
Are you sure you want to change the base?
Conversation
…ding to request the wbdata as well
What about this? [wbvectors, nbdata]=ro.read_cphd('all', []); |
Yes, I see that does get at the desired output. I was thinking more from a discovery point of view, where there are functions that directly return the metadata, but not the narrowband data. From the My thinking was that there is a function If you go the route of instantiating a reader object, then you can get the metadata with the The content of this pull request seems (to me) like it fills in a gap of functionality that a newer user may be looking for. I do agree that your code example gives exactly the output that's desired, but it's not as apparent as a named method that gives just that content. |
If we were to do that, it seems that should hold true for all phase history formats, not just CPHD. Perhaps there should be a if exist(ro,'read_cphd') at the end of open_ph_reader.m? The would provide the same functionality for all formats, even for readers for formats that we haven't built yet (assuming you call the generic open_ph_reader, and not one of the subclasses directly.) |
…r every reader type based on what methods it has
… complicated to add the anonymous functions to the open_ph_reader since it has multiple outputs.
So I went down the path that you suggested, but there were a few issues. Your method using the anonymous functions was complicated due to the fact that What I have done in my most recent commits was to implement Then, the way I implemented it was to use your idea of calling the Lastly, in editing the Let me know what you think! |
To be clear, I'm not opposed to the new method, but I do want to work through a few issues before I accept the PR. Appreciate your patience with my pickiness. I'm not sure that I understand why read_cphd_data and read_raw would be a problem. They don't call the new get_nbdata method, so it shouldn't be an issue for them, and the new method only returns 1 output, so anonymous function should be fine, right? As for the gotcha reader, I think we have to maintain the unused input parameter because it's conceptually a subclass of a larger phase history reader class, so it has to maintain the same API across in that family. Someone may write code generically for CPHD, and this allows that same code to run on gotcha data, just as if it were a CPHD, even if it only has a single channel. If the CPHD code sees that the data has only one channel and asked to run on that one channel, we don't want that to cause it to crash. |
Allows users to request nbdata without needing to also get wbdata. This is particularly useful if you have a large CPHD file and you only want to look at the narrowband data.