diff options
author | hack <hack@stsci.edu> | 2010-06-15 14:27:00 -0400 |
---|---|---|
committer | hack <hack@stsci.edu> | 2010-06-15 14:27:00 -0400 |
commit | 36281d4b8086a8488c113aaffaa9919c94573a6b (patch) | |
tree | 5c413f1b7fe749e74ef4bc793da98732e84ff9bc /updatewcs/corrections.py | |
parent | 9a9af9c9fa0e93875a7b59f0c048f28105c65e75 (diff) | |
download | stwcs_hcf-36281d4b8086a8488c113aaffaa9919c94573a6b.tar.gz |
The logic for printing out the warning message about using the hard-coded TDD coeffs in STWCS.updatewcs has been slightly revised to only print the message for post-SM4 data, as per Andy's request. WJH
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@9675 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'updatewcs/corrections.py')
-rw-r--r-- | updatewcs/corrections.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/updatewcs/corrections.py b/updatewcs/corrections.py index 861b8ab..fa0a290 100644 --- a/updatewcs/corrections.py +++ b/updatewcs/corrections.py @@ -83,27 +83,29 @@ class TDDCorr(object): alpha = 0.095 + 0.090*(rday-dday)/2.5 beta = -0.029 - 0.030*(rday-dday)/2.5 """ - skew_coeffs = ext_wcs.idcmodel.refpix['skew_coeffs'] - if skew_coeffs is None: - err_str = "------------------------------------------------------------------------ \n" - err_str += "WARNING: the IDCTAB geometric distortion file specified in the image \n" - err_str += " header did not have the time-dependent distortion coefficients. \n" - err_str += " The pre-SM4 time-dependent skew solution will be used by default.\n" - err_str += " Please update IDCTAB with new reference file from HST archive. \n" - err_str += "------------------------------------------------------------------------ \n" - print err_str - # Using default pre-SM4 coefficients - skew_coeffs = {'TDD_A':[0.095,0.090/2.5], - 'TDD_B':[-0.029,-0.030/2.5], - 'TDD_DATE':2004.5,'TDDORDER':1} - if not isinstance(ext_wcs.date_obs,float): year,month,day = ext_wcs.date_obs.split('-') rdate = datetime.datetime(int(year),int(month),int(day)) rday = float(rdate.strftime("%j"))/365.25 + rdate.year else: rday = ext_wcs.date_obs - + + skew_coeffs = ext_wcs.idcmodel.refpix['skew_coeffs'] + if skew_coeffs is None: + # Only print out warning for post-SM4 data where this may matter + if rday > 2009.0: + err_str = "------------------------------------------------------------------------ \n" + err_str += "WARNING: the IDCTAB geometric distortion file specified in the image \n" + err_str += " header did not have the time-dependent distortion coefficients. \n" + err_str += " The pre-SM4 time-dependent skew solution will be used by default.\n" + err_str += " Please update IDCTAB with new reference file from HST archive. \n" + err_str += "------------------------------------------------------------------------ \n" + print err_str + # Using default pre-SM4 coefficients + skew_coeffs = {'TDD_A':[0.095,0.090/2.5], + 'TDD_B':[-0.029,-0.030/2.5], + 'TDD_DATE':2004.5,'TDDORDER':1} + alpha = 0 beta = 0 # Compute skew terms, allowing for non-linear coefficients as well |