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

Ignore ERFA dubious year warning #25

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Conversation

taldcroft
Copy link
Member

Description

This patch sets warnings to globally ignore the ERFA dubious year warning that gets emitted for UTC dates either before around 1950 or well after the last known leap second (e.g. CxoTime('2099:001')). This warning is conservatively indicating that UTC is not well-defined in those regimes, but we don't care.

One annoying side effect is that this is really global, meaning that once cxotime is imported then it applies also to pure astropy.time.Time or any calls to the erfa package directly. Another strategy would be to catch these warnings individually in application code where they get emitted. But overall I think this warning is useless in the context of Chandra operations work.

Testing

  • Passes unit tests on MacOS
  • Functional testing

Functional testing

Prior to the patch running acisfp_check produced two ERFA warnings about dubious year. With this patch in place the following is warning free:

(ska3-2021.2rc4) ➜ env PYTHONPATH=/Users/aldcroft/git/cxotime acisfp_check \
   --outdir=out \
   --oflsdir=${SKA}/data/ska_testr/test_loads/2019/MAY2019/oflsa \
   --nlet_file=${SKA}/data/ska_testr/test_loads/2019/MAY2019/oflsa/NonLoadTrackedEvents.txt \
   --state-builder=sql \
   --run-start=2019:135

@javierggt
Copy link
Contributor

why does such a date appear in acis packages anyway?

@javierggt
Copy link
Contributor

The code is simple enough and I believe it does what we expect. Anyway I wanted to check, just to see myself.

When you run that command with the older version, where do you see the warnings? I ran the command as you ran it, which is also the command in ska_testr/packages/acisfp_check/test_regress.sh, but I see no log file anywhere.

@jeanconn
Copy link
Contributor

With regard to why the date comes up, I think in the ACIS package context there's stuff that uses year 2098 or 2099 for "end of time" type things like:

jeanconn-fido> tail -n3 /proj/sot/ska/data/ska_testr/test_loads/2019/MAY2019/oflsa/dahtbon_history.rdb 
2016:202:04:12:23.359	0
2098:001:00:00:00.000	0
2098:001:00:00:01.000	0

It isn't uncommon for us to use a 2099 time more directly as the last state from cmd_states.

I don't know if there might be something convenient with more limited scope to work with those "end of time" times, but ignoring these ERFA warns seems reasonable to me. If we want a separate warning from cxotime when working with a fictitious future date that could be some kind of enhancement request.

Copy link
Contributor

@jeanconn jeanconn left a comment

Choose a reason for hiding this comment

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

I'm fine with this. I note I also ran one of the full acis module tests and saw the warnings stay away.

@taldcroft taldcroft merged commit ea7f54a into master Feb 11, 2021
@taldcroft taldcroft deleted the ignore-dubious-year-warning branch February 11, 2021 11:38
@javierggt javierggt mentioned this pull request Mar 2, 2021
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.

3 participants