예제 #1
0
 def setup(self):
     sane_parameters()
     self.VF1 = imtio.import_from_file("VF1.cimt")
     self.VF1_nomask = imtio.import_from_file("VF1_nomask.cimt")
     self.VF2 = imtio.import_from_file("VF2.cimt")
     self.VF_notevenlyspaced = imtio.import_from_file(
         "VF_notevenlyspaced.cimt")
예제 #2
0
 def setup(self):
     sane_parameters()
     self.VF1 = imtio.import_from_file("VF1.cimt")
     self.VF1_nomask = imtio.import_from_file("VF1_nomask.cimt")
     self.SF1 = imtio.import_from_file("SF1.cimt")
     self.SF2 = imtio.import_from_file("SF2.cimt")
     self.TVF1 = imtio.import_from_file("TVF1.cimt")
     self.Prof1 = imtio.import_from_file("Prof1.cimt")
예제 #3
0
 def setup(self):
     sane_parameters()
     self.im = import_from_image("./tests/res/image.bmp",
                                 dx=0.12,
                                 dy=0.12,
                                 unit_x="mm",
                                 unit_y="um",
                                 cache_infos=False,
                                 dtype=np.uint8)
     self.basept1 = np.array([13, 27.3 * 12 / 14])
     self.basept2 = np.array([83.88, 26.88 * 12 / 14])
     self.im.set_baseline(self.basept1, self.basept2)
예제 #4
0
 def setup(self):
     sane_parameters()
     # data
     self.x = np.linspace(0, 13.5, 98)
     self.y = np.linspace(0, 8.19892, 125)
     X, Y = np.meshgrid(self.x, self.y, indexing='ij')
     self.comp_x = 3 * np.cos(X) - 5 * np.sin(0.43 * Y)
     self.comp_y = 5.4 * np.cos(.25 * X) - 3 * np.sin(1.43 * Y)
     self.comp_x_int = np.array(3 * np.cos(X) - 5 * np.sin(0.43 * Y),
                                dtype=int)
     self.comp_y_int = np.array(5.4 * np.cos(.25 * X) -
                                3 * np.sin(1.43 * Y),
                                dtype=int)
     self.comp_x_nans = self.comp_x.copy()
     self.comp_y_nans = self.comp_y.copy()
     self.comp_x_nans[self.comp_x > 5] = np.nan
     self.comp_y_nans[self.comp_x > 5] = np.nan
     self.mask = self.comp_x > 4
     # create vector fields
     self.VF = VectorField(axis_x=self.x,
                           axis_y=self.y,
                           mask=None,
                           comp_x=self.comp_x,
                           comp_y=self.comp_y,
                           unit_x='m',
                           unit_y='mm',
                           unit_values='m/s')
     self.VF_int = VectorField(axis_x=self.x,
                               axis_y=self.y,
                               mask=None,
                               comp_x=self.comp_x_int,
                               comp_y=self.comp_y_int,
                               unit_x='m',
                               unit_y='mm',
                               unit_values='m/s')
     self.VF_mask = VectorField(axis_x=self.x,
                                axis_y=self.y,
                                mask=self.mask,
                                comp_x=self.comp_x,
                                comp_y=self.comp_y,
                                unit_x='m',
                                unit_y='mm',
                                unit_values='m/s')
     self.VF_nans = VectorField(axis_x=self.x,
                                axis_y=self.y,
                                mask=None,
                                comp_x=self.comp_x_nans,
                                comp_y=self.comp_y_nans,
                                unit_x='m',
                                unit_y='mm',
                                unit_values='m/s')
     self.VFs = [self.VF, self.VF_mask, self.VF_nans, self.VF_int]
예제 #5
0
 def setup(self):
     sane_parameters()
     self.x = np.linspace(0, 13.5, 98)
     self.y = np.linspace(0, 8.19892, 125)
     self.F = Field(axis_x=self.x, axis_y=self.y, unit_x='m', unit_y='s')
     self.F_nounits = Field(axis_x=self.x, axis_y=self.y,
                            unit_x='', unit_y='')
     self.F_reversed_axis = Field(axis_x=self.x[::-1],
                                  axis_y=self.y[::-1],
                                  unit_x='m', unit_y='s')
     self.x_irreg = [xi**2 for xi in self.x]
     self.y_irreg = [yi**2 for yi in self.y]
     self.F_irregular_axis = Field(axis_x=self.x_irreg,
                                   axis_y=self.y_irreg,
                                   unit_x='m', unit_y='s')
     self.Fs = [self.F, self.F_nounits, self.F_reversed_axis,
                self.F_irregular_axis]
     self.Fs_reg = [self.F, self.F_nounits, self.F_reversed_axis]
예제 #6
0
 def setup(self):
     sane_parameters()
     # VF1 = VectorField()
     # VF1.import_from_arrays(np.linspace(0, 24, 40),
     #                        np.linspace(-15.5, 15.5, 40),
     #                        (np.random.rand(40, 40) - .5)*12.3,
     #                        (np.random.rand(40, 40) - .5)*4.35,
     #                        mask=False,
     #                        unit_x='m',
     #                        unit_y='m',
     #                        unit_values='m/s')
     # VF1.smooth(tos='gaussian', size=2, inplace=True)
     # TVF1 = TemporalVectorFields()
     # for i in range(10):
     #     TVF1.add_field(VF1*np.cos(i/5*np.pi), i*0.834)
     # # imtio.export_to_file(VF1, 'VF1_nomask.cimt')
     # # imtio.export_to_file(TVF1, 'TVF1_nomask.cimt')
     self.VF1_nomask = imtio.import_from_file('VF1_nomask.cimt')
     self.TVF1_nomask = imtio.import_from_file('TVF1_nomask.cimt')
예제 #7
0
 def setup(self):
     sane_parameters()
     # unit_x = make_unit('m')
     # unit_y = make_unit('dm')
     # unit_v = make_unit('m/s**2')
     # x = np.genfromtxt('points_x')
     # y = np.genfromtxt('points_y')
     # v = np.genfromtxt('points_v')
     # x2 = np.genfromtxt('points_x2')
     # y2 = np.genfromtxt('points_y2')
     # v2 = np.genfromtxt('points_v2')
     # self.P1 = Points(list(zip(x, y)), v, unit_x=unit_x,
     #                  unit_y=unit_y, unit_v=unit_v)
     # self.P2 = Points(list(zip(x2, y2)), v2, unit_x=unit_x,
     #                  unit_y=unit_y, unit_v=unit_v)
     # imtio.export_to_file(self.P1, "P1.cimt")
     # imtio.export_to_file(self.P2, "P2.cimt")
     self.P1 = imtio.import_from_file("P1.cimt")
     self.P2 = imtio.import_from_file("P2.cimt")
예제 #8
0
 def setup(self):
     sane_parameters()
     # data
     self.x = np.linspace(0, 13.5, 98)
     self.y = np.linspace(0, 8.19892, 125)
     X, Y = np.meshgrid(self.x, self.y, indexing='ij')
     self.values = 3*np.cos(X) - 5*np.sin(0.43*Y)
     self.values_int = np.array(3*np.cos(X) - 5*np.sin(0.43*Y), dtype=int)
     self.values_nans = self.values.copy()
     self.values_nans[self.values >5] = np.nan
     self.mask = self.values > 4
     # create scalar fields
     self.SF = ScalarField(axis_x=self.x,
                           axis_y=self.y,
                           mask=None,
                           values=self.values,
                           unit_x='m',
                           unit_y='mm',
                           unit_values='m/s')
     self.SF_int = ScalarField(axis_x=self.x,
                               axis_y=self.y,
                               mask=None,
                               values=self.values_int,
                               unit_x='m',
                               unit_y='mm',
                               unit_values='m/s')
     self.SF_mask = ScalarField(axis_x=self.x,
                                axis_y=self.y,
                                mask=self.mask,
                                values=self.values,
                                unit_x='m',
                                unit_y='mm',
                                unit_values='m/s')
     self.SF_nans = ScalarField(axis_x=self.x,
                                axis_y=self.y,
                                mask=None,
                                values=self.values_nans,
                                unit_x='m',
                                unit_y='mm',
                                unit_values='m/s')
     self.SFs = [self.SF, self.SF_mask, self.SF_nans, self.SF_int]
예제 #9
0
 def setup(self):
     sane_parameters()
     # unit_x = make_unit('m')
     # unit_y = make_unit('m/s')
     # x = np.genfromtxt('prof_x')
     # y = np.genfromtxt('prof_y')
     # y2 = np.genfromtxt('prof_y2')
     # mask = np.genfromtxt('prof_mask')
     # self.Prof1 = Profile(x, y, mask=mask, unit_x=unit_x,
     #                      unit_y=unit_y)
     # self.Prof2 = Profile(x, y2, mask=mask, unit_x=unit_x,
     #                      unit_y=unit_y)
     # self.Prof_evenlyspaced = Profile(np.linspace(0, 30, 100),
     #                                  y, mask=mask, unit_x=unit_x,
     #                                  unit_y=unit_y)
     # self.Prof2_evenlyspaced = Profile(np.linspace(0, 30, 100),
     #                                   y2, mask=mask, unit_x=unit_x,
     #                                   unit_y=unit_y)
     # self.Prof_nomask = Profile(x, y, mask=False, unit_x=unit_x,
     #                            unit_y=unit_y)
     # self.Prof_evenlyspaced_nomask = Profile(np.linspace(0, 30, 100),
     #                                         y, mask=False, unit_x=unit_x,
     #                                         unit_y=unit_y)
     # imtio.export_to_file(self.Prof1, "Prof1.cimt")
     # imtio.export_to_file(self.Prof2, "Prof2.cimt")
     # imtio.export_to_file(self.Prof_evenlyspaced, "Prof_evenlyspaced.cimt")
     # imtio.export_to_file(self.Prof2_evenlyspaced, "Prof2_evenlyspaced.cimt")
     # imtio.export_to_file(self.Prof_nomask, "Prof_nomask.cimt")
     # imtio.export_to_file(self.Prof_evenlyspaced_nomask,
     #                      "Prof_evenlyspaced_nomask.cimt")
     self.Prof1 = imtio.import_from_file('Prof1.cimt')
     self.Prof2 = imtio.import_from_file('Prof2.cimt')
     self.Prof_evenlyspaced = imtio.import_from_file(
         'Prof_evenlyspaced.cimt')
     self.Prof2_evenlyspaced = imtio.import_from_file(
         'Prof2_evenlyspaced.cimt')
     self.Prof_nomask = imtio.import_from_file('Prof_nomask.cimt')
     self.Prof_evenlyspaced_nomask = imtio.import_from_file(
         'Prof_evenlyspaced_nomask.cimt')
예제 #10
0
 def setup(self):
     sane_parameters()
     self.blpt1 = np.array([13, 27.3 * 12 / 14])
     self.blpt2 = np.array([83.88, 26.88 * 12 / 14])
     self.bl = Baseline([self.blpt1, self.blpt2])
예제 #11
0
 def setup(self):
     sane_parameters()
     self.u1 = units.m / units.s
     self.u2 = units.Hz / units.kg
예제 #12
0
 def setup(self):
     sane_parameters()