def update_state (self,mystate):
   """Standard function to update our state""";
   mystate('filename_real',[]);
   mystate('filename_imag',[]);
   mystate('spline_order',3);
   mystate('normalize',False);
   mystate('ampl_interpolation',False);
   mystate('l_0',0.0);
   mystate('m_0',0.0);
   mystate('verbose',0);
   mystate('missing_is_null',False);
   # Check filename arguments: we must be created with two identical-length lists
   if isinstance(self.filename_real,(list,tuple)) and isinstance(self.filename_imag,(list,tuple)) \
       and len(self.filename_real) == len(self.filename_imag) and not len(self.filename_real)%1:
     self._vb_key = tuple(zip(self.filename_real,self.filename_imag));
   else:
     raise ValueError,"filename_real/filename_imag: two lists of filenames of 2N elements each expected";
   # other init
   mequtils.add_axis('l');
   mequtils.add_axis('m');
   self._freqaxis = mequtils.get_axis_number("freq");
   _verbosity.set_verbose(self.verbose);
Пример #2
0
 def update_state(self, mystate):
     """Standard function to update our state"""
     mystate('filename_real', [])
     mystate('filename_imag', [])
     mystate('spline_order', 3)
     mystate('normalize', False)
     mystate('ampl_interpolation', False)
     mystate('l_0', 0.0)
     mystate('m_0', 0.0)
     mystate('verbose', 0)
     mystate('missing_is_null', False)
     # Check filename arguments: we must be created with two identical-length lists
     if isinstance(self.filename_real,(list,tuple)) and isinstance(self.filename_imag,(list,tuple)) \
         and len(self.filename_real) == len(self.filename_imag) and not len(self.filename_real)%1:
         self._vb_key = tuple(zip(self.filename_real, self.filename_imag))
     else:
         raise ValueError, "filename_real/filename_imag: two lists of filenames of 2N elements each expected"
     # other init
     mequtils.add_axis('l')
     mequtils.add_axis('m')
     self._freqaxis = mequtils.get_axis_number("freq")
     _verbosity.set_verbose(self.verbose)
        vells = meq.complex_vells(beam.shape);
        vells[...] = beam[...];
        # make vells and return result
        vellsets.append(meq.vellset(vells));
    # create result object
    cells = request.cells if hasfreq else getattr(lm,'cells',None);
    result = meq.result(vellsets[0],cells=cells);
    result.vellsets[1:] = vellsets[1:];
    result.dims = (2,len(vellsets)/2);
    return result;



# test clause
if __name__ == "__main__":
  _verbosity.set_verbose(5);

  vb = LMVoltageBeam(spline_order=3);
  vb.read("beam_xx_re.fits","beam_xx_im.fits");

  l0 = numpy.array([-2,-1,0,1,2])*DEG;
  l = numpy.vstack([l0]*len(l0));

  print vb.interpolate(l,l.T);

  vb = LMVoltageBeam(spline_order=3);
  vb.read("XX_0_Re.fits","XX_0_Im.fits");

  l0 = numpy.array([-4,-2,0,2,4])*DEG;
  l = numpy.vstack([l0]*len(l0));
Пример #4
0
                    beam /= beam_max
                vells = meq.complex_vells(beam.shape)
                vells[...] = beam[...]
                # make vells and return result
                vellsets.append(meq.vellset(vells))
        # create result object
        cells = request.cells if hasfreq else getattr(lm, 'cells', None)
        result = meq.result(vellsets[0], cells=cells)
        result.vellsets[1:] = vellsets[1:]
        result.dims = (2, len(vellsets) // 2)
        return result


# test clause
if __name__ == "__main__":
    _verbosity.set_verbose(5)

    vb = LMVoltageBeam(spline_order=3)
    vb.read("beam_xx_re.fits", "beam_xx_im.fits")

    l0 = numpy.array([-2, -1, 0, 1, 2]) * DEG
    l = numpy.vstack([l0] * len(l0))

    print(vb.interpolate(l, l.T))

    vb = LMVoltageBeam(spline_order=3)
    vb.read("XX_0_Re.fits", "XX_0_Im.fits")

    l0 = numpy.array([-4, -2, 0, 2, 4]) * DEG
    l = numpy.vstack([l0] * len(l0))