Closed msyriac closed 7 years ago
I have fixed this now, in commit 10b9eb760792489157931fe77025847e39bc413d.
It looks like it is still incompatible.
Say I make a new enmap
>>> px = 0.5
>>> arc = 300
>>> hwidth = arc/2.
>>> deg = utils.degree
>>> arcmin = utils.arcmin
>>> shape, wcs = enmap.geometry(pos=[[-hwidth*arcmin,-hwidth*arcmin], hwidth*arcmin,hwidth*arcmin]], res=px*arcmin, proj="car")
>>> thetaMap = enmap.posmap(shape, wcs)
>>> thetaMapMod = np.sum(thetaMap**2,0)**0.5
and then try to make a liteMap out of it
>>> templateLm = enmap.to_flipper(thetaMap).reshape(-1)[0]
>>> templateLm.info()
Dimensions (Ny,Nx) = (600,600)
Pixel Scales: (0.499167,35.500833) arcmins.
Map Bounds: [(x0,y0), (x1,y1)]: [(357.504167,-2.495833),(2.495833,2.495833)] (degrees)
Map Bounds: [(x0,y0), (x1,y1)]: [(23:50:01.000,-02:29:45.00),(00:09:59.000,+02:29:45.00)]
Map area = 1772.083264 sq. degrees.
Map mean = 0.000045
Map std = 0.001294
The x-pixel scale has been messed up. So flipper is expecting something different in the wcs?
OK, I've found out what this is. Flipper doesn't like it when cdelt[0] > 0
. When you built the geometry, you specified a coordinate system with RA increasing in the pixel direction (because pos[1,1]>pos[0,1]
), so you got a map that flipper doesn't like. I flipper's problems with cdelt[0] < 0
to be a bug in flipper.
I can make to_flipper
flip the map in the x direction to ensure that cdelt[0] < 0
. But that may be confusing in its own right. What do you think?
Now we know why it's called flipper! I think your proposed solution of flipping the map in the x direction is the way to go, rather than trying to fix flipper, which may break other people's code that depends on it.
Ok, the flipping is implemented.
I tried using
enmap.to_flipper
to convert an enmap to a liteMap, but it fails. Flipper requires aheader
inside thewcs
object.