Exemplo n.º 1
0
 def get_coord_axis1d(self):
     coord_axis1d = wcs.CoordAxis1D(wcs.Axis("axisCtype", "axisCunit"))
     if self.complete:
         coord_axis1d.error = wcs.CoordError(1.0, 1.5)
         coord_axis1d.range = wcs.CoordRange1D(wcs.RefCoord(2.0, 2.5),
                                                wcs.RefCoord(3.0, 3.5))
         coord_axis1d.function = (
             wcs.CoordFunction1D(4, 4.5, wcs.RefCoord(5.0, 5.5)))
         bounds = wcs.CoordBounds1D()
         bounds.samples.append(wcs.CoordRange1D(wcs.RefCoord(6.0, 6.5),
                                                wcs.RefCoord(7.0, 7.5)))
         bounds.samples.append(wcs.CoordRange1D(wcs.RefCoord(8.0, 8.5),
                                                wcs.RefCoord(9.0, 9.5)))
         coord_axis1d.bounds = bounds
     return coord_axis1d
Exemplo n.º 2
0
    def bad_range_wcs():
        px = float(0.5)
        sx = float(54321.0)
        nx = 200
        ds = float(0.01)
        axis_1d = wcs.CoordAxis1D(wcs.Axis("UTC", "d"))
        temporal_wcs = chunk.TemporalWCS(axis_1d)
        temporal_wcs.exposure = 300.0
        temporal_wcs.resolution = 0.1

        # divide into 2 samples with a gap between
        c1 = wcs.RefCoord(px, sx)
        c2 = wcs.RefCoord(0.0, 0.0)
        c3 = wcs.RefCoord(px + nx * 0.66, sx + nx * ds * 0.66)
        c4 = wcs.RefCoord(px + nx, sx + nx * ds)
        temporal_wcs.axis.bounds = wcs.CoordBounds1D()
        temporal_wcs.axis.bounds.samples.append(wcs.CoordRange1D(c1, c3))
        temporal_wcs.axis.bounds.samples.append(wcs.CoordRange1D(c4, c2))

        return temporal_wcs