forked from pool/python-astropy
25 lines
1000 B
Diff
25 lines
1000 B
Diff
|
From 4ddb4e94c67a4d8712fc656bcd9882b8f7e2b2f4 Mon Sep 17 00:00:00 2001
|
||
|
From: Mihai Cara <mihail.cara@gmail.com>
|
||
|
Date: Wed, 3 Jun 2020 16:31:22 -0400
|
||
|
Subject: [PATCH] Do not issue datfix warning when MJDREF has default value
|
||
|
|
||
|
---
|
||
|
CHANGES.rst | 2 ++ (removed for rebase)
|
||
|
astropy/wcs/wcs.py | 3 +++
|
||
|
2 files changed, 5 insertions(+)
|
||
|
|
||
|
diff --git a/astropy/wcs/wcs.py b/astropy/wcs/wcs.py
|
||
|
index 7f5f79bbc95..aa3a4d77951 100644
|
||
|
--- a/astropy/wcs/wcs.py
|
||
|
+++ b/astropy/wcs/wcs.py
|
||
|
@@ -681,6 +681,9 @@ def fix(self, translate_units='', naxis=None):
|
||
|
fixes = self.wcs.fix(translate_units, naxis)
|
||
|
for key, val in fixes.items():
|
||
|
if val != "No change":
|
||
|
+ if (key == 'datfix' and '1858-11-17' in val and
|
||
|
+ not np.count_nonzero(self.wcs.mjdref)):
|
||
|
+ continue
|
||
|
warnings.warn(
|
||
|
("'{0}' made the change '{1}'.").
|
||
|
format(key, val),
|