opencadc / caom2tools

Common Archive Observation Model - data engineering tools
2 stars 13 forks source link

caom2utils: unexpected Interval() use when testing Chunk.position.axis.function #68

Open dr-rodriguez opened 6 years ago

dr-rodriguez commented 6 years ago

When running the caom2utils validator, I ran into an error I think might not be expected. The function _validate_spatial_wcs runs:

_check_transform(Interval(float(fn2D.dimension.naxis1/2),
                             float(fn2D.dimension.naxis2/2)))

when attempting to validate the position.axis.function tags. However, this can fail if the naxis1 dimension is larger than the naxis2 dimension since Interval expects the first parameter to be lower than the second one. Since naxis really isn't an interval but rather a note on the size of the array, it shouldn't be testing that one is larger than the other.