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

DM-43169: Create utility function to check for timebase errors #87

Merged
merged 6 commits into from Mar 5, 2024

Conversation

mfisherlevine
Copy link
Contributor

No description provided.

Copy link
Contributor

@isullivan isullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check whether you want the absolute value of the difference.

)
return False

return np.max(np.diff(cRIOtimestamps.values)) > maxDiff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be checking for np.max(np.abs(... instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, kinda, but honestly, if time is running backwards then I think bets are so far off I'm happy to let it slide or explode in some other way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, then I suggest you make this raise if the diff is negative.

client : `lsst_efd_client.efd_helper.EfdClient`
The EFD client to use.
maxDiff : `float`, optional
The maximum difference in cRIO timestamps to consider as a timebase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Units are seconds? Also, is this the absolute value of the difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, will add comment on being seconds, though it's hard-coded in the cRIO, so it's somewhat irrelevant and would need re-crafting for other topics depending on how they're packed.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from .mount import *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just import hasTimebaseErrors instead of *

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, thanks 👍

@mfisherlevine mfisherlevine merged commit ab51f28 into main Mar 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants