Bug in astrodrizzle (altwcs) - Keyword 'MJD-OBS' not found

avilaavila Member, Institute_Staff Posts: 10
We have found that in some cases the astrodrizzle task throws the error stated above. Here is a quick solution found by the Drizzlepac team that users can implement while the code is fixed in the distribution. This is a quick fix that has not been tested in any way. USE AT YOUR OWN RISK.

In the file /path/to/python/packages/lib/python2.7/site-packages/stwcs/wcsutil/altwcs.py changes lines starting at 352 from:

for k in hwcs:

del hdr[k]


for k in hwcs.keys():

del hwcs[k]


  • mack@stsci.edumack@stsci.edu Member, Institute_Staff, Moderator_DrizzlePac Posts: 30
    edited September 2016
    An update to the code was made on July 23rd to prevent stripping important keywords.

    The fix can be obtained by updating the software using the command:
    $ conda update -n astroconda --all

    Alternately, to update only the stwcs portion:
    $ conda update -n astroconda stwcs

    For details, see 'Updating Packages Individually' on this page

    This is the equivalent of the previous 'SSBX' version philosophy, and it enables users to obtain any bug fixes or enhancements to the official AstroConda release.
  • mcaramcara Member Posts: 4
    edited November 2016
    I just want to let you know that as of October 28th 2016, an update to astroconda fixes the issue ("Keyword 'MJD-OBS' not found.") described in this thread. To obtain this update, simply run

    conda update -n environment_name -c http://ssb.stsci.edu/astroconda --all

    or, to update *only* 'stwcs' package:

    conda update -n environment_name -c http://ssb.stsci.edu/astroconda stwcs

    In the commands above 'environment_name' is the name of the conda environment that you wish to update, e.g., 'astroconda'.

    You should see that 'stwcs' package is going to be updated to a version >= 1.2.4:

    The following packages will be UPDATED: stwcs: 1.2.3-np111py35_0 --> 1.2.4-np111py35_0 Proceed ([y]/n)?

    In addition, you can verify 'stwcs' version after update. From a Python window run:
    >>> import stwcs >>> stwcs.__version__ '1.2.4'
Sign In or Register to comment.