Giter Club home page Giter Club logo

Comments (3)

brechmos-stsci avatar brechmos-stsci commented on August 17, 2024

I went through these to see where the issues are. I created a branch https://github.com/brechmos-stsci/jwst/tree/74_datamodel_tests where I made the changes. I am not going to create a PR at this point.

Below are things that will need to be discussed at some point ( @nden ). Not today :-)

test_extra_fits()

Not sure if this is what was happening previously. Are these causing the failures?

/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: 'N/A' is not valid in keyword 'CONT_ID'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '2011-06-17T02:00:54.193000' is not valid in keyword 'EXPSTART'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '2011-06-17T02:00:54.193000' is not valid in keyword 'EXPMID'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '2011-06-17T02:07:56.405000' is not valid in keyword 'EXPEND'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: 'fast' is not valid in keyword 'READPATT'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '1' is not valid in keyword 'NUMDTHPT'
 warnings.warn(msgfmt.format(result, fits_keyword))
WARNING: VerifyWarning: Card is too long, comment will be truncated. [astropy.io.fits.card]

test_extra_fits_update()
Not sure if this is what was happening previously. Are these causing the failures?

/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: 'N/A' is not valid in keyword 'CONT_ID'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '2011-06-17T02:00:54.193000' is not valid in keyword 'EXPSTART'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '2011-06-17T02:00:54.193000' is not valid in keyword 'EXPMID'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '2011-06-17T02:07:56.405000' is not valid in keyword 'EXPEND'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: 'fast' is not valid in keyword 'READPATT'
 warnings.warn(msgfmt.format(result, fits_keyword))
/Users/crjones/Documents/JWST/jwst/jwst/datamodels/fits_support.py:494: UserWarning: '1' is not valid in keyword 'NUMDTHPT'
 warnings.warn(msgfmt.format(result, fits_keyword))

test_schema.test_date()
The date is supposed to be a string (at least according to the schema). I added a date validation check in properties.__setattr__ to make sure the date makes sense by calling dateutil.parser.parse. This now properly returns a ValidationError if it is not correct.

test_schema.test_date2()
I changed the check to see if it is a string as the schema appears to want a string.

test_schema.test_list2()
This seems to be fine when I run it from within my python environment.

test_schema.test_multislit_garbage()
This seems to be fine when I run it from within my python environment.

test_wcs.test_wcs()
This seems to be working too, now. There are some warnings but I think they are all right.

In [14]: test_wcs()
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING: Some non-standard WCS keywords were excluded: B_0_3, A_1_1, B_ORDER, BP_0_2, A_1_2, A_3_0, B_0_2, AP_0_1, AP_ORDER, BP_2_0, A_ORDER, BP_1_2, AP_0_3, AP_2_0, B_1_1, BP_3_0, B_1_2, AP_3_0, A_2_0, BP_1_1, AP_2_1, BP_0_3, BP_0_1, B_3_0, AP_1_2, BP_ORDER, A_0_2, AP_1_0, AP_0_2, BP_1_0, BP_2_1, AP_1_1, B_2_0, B_2_1, A_2_1, A_0_3 Use the ``relax`` kwarg to control this. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]

Note: There is one line that I needed to comment out as the CRPIX1 is not in the extra_fits.PRIMARY.header. Not sure why on that one.

from jwst.

hbushouse avatar hbushouse commented on August 17, 2024

All of the UserWarnings from fits_support.py are simply due to the fact that we've changed the expected data types and/or contents of several header keywords since the .fits file being used in the test was created (which is likely many years ago already).

CONT_ID must now be an integer
EXPSTART, EXPMID, and EXPEND must now be floats (in units of MJD)
NUMDTHPT must now be a string (e.g. '1' instead of the integer 1)
READPATT: still a string, but allowed values can be found in core.schema.yaml. FAST is one of the allowed values, but I'm wondering if it's case sensitive?

Simply updating these keyword values in the test .fits file will make the warnings go away.

from jwst.

nden avatar nden commented on August 17, 2024

This was fixed at some point in build 7.

from jwst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.