Exemple #1
0
    def test_nans(self):
        # Test that less than 2 texp will yield a NaN for u_I_mean
        data = {'temporal': {'texp': [0, 1]}, 'spatial': {}}
        r = Results1288(data)
        self.assertIs(r.u_I_mean, np.nan)

        # Test that a negative slope for t vs s2_ydark will yield Nan for
        # u_I_var
        data['temporal']['s2_ydark'] = [1, 0]
        r = Results1288(data)
        self.assertIs(r.u_I_var, np.nan)

        # Test that a negative s2y_dark will yield a Nan for DSNU1288
        data['spatial'] = {
            'avg_var_dark': 0.,
            'var_mean_dark': 1.,
            'L_dark': 3
        }
        r = Results1288(data)
        self.assertIs(r.DSNU1288, np.nan)
        self.assertIs(r.DSNU1288_DN(), np.nan)

        del r
Exemple #2
0
def _init(pixel_area=0, **kwargs):
    # create dataset
    dataset = DatasetGenerator(**kwargs)
    # parse dataset
    parser = ParseEmvaDescriptorFile(dataset.descriptor_path)
    # load image data
    loader = LoadImageData(parser.images)
    # create data
    data = Data1288(loader.data)
    # Make results object
    px = pixel_area
    if pixel_area == 0:
        px = dataset.cam.pixel_area
    results = Results1288(data.data, pixel_area=px)
    return dataset, parser, loader, data, results
Exemple #3
0
 def __init__(self, fname):
     parser = ParseEmvaDescriptorFile(fname)
     imgs = LoadImageData(parser.images)
     dat = Data1288(imgs.data)
     self._results = Results1288(dat.data)