Ejemplo n.º 1
0
def _test_forest (mqs,parent):
  from Timba.Meq import meq
  # run tests on the forest
  domain = meq.gen_domain(time=[0,7200],l=[0,math.pi/2],m=[0,2*math.pi],freq=[100,200]);
  cells = meq.gen_cells(domain,num_time=10,num_l=100,num_m=100,num_freq=10);
  request = meq.request(cells, rqtype='ev')
  mqs.execute('emf1',request);  
  mqs.execute('emf2',request);  
  mqs.execute('cube',request);  
Ejemplo n.º 2
0
def _test_forest (mqs,parent,wait=False,**kw):
  print "=== Evaluating %g*t%+g for t=[%g,%g]"%(a,b,t0,t1);
  print "=== Dummy values: %g %g"%(pipeline_test_constants.c0,pipeline_test_constants.c1);
  from Timba.Meq import meq
  # run tests on the forest
  domain = meq.gen_domain(time=[t0,t1]);
  cells = meq.gen_cells(domain,num_time=10);
  request = meq.request(cells,rqtype='ev',new_domain=True);
  res = mqs.execute('root',request,wait=wait);
  if wait:
    print res.result.vellsets[0].value;
Ejemplo n.º 3
0
def _test_forest (mqs,parent,wait=False,**kw):
  print("=== Evaluating %g*t%+g for t=[%g,%g]"%(a,b,t0,t1));
  print("=== Dummy values: %g %g"%(pipeline_test_constants.c0,pipeline_test_constants.c1));
  from Timba.Meq import meq
  # run tests on the forest
  domain = meq.gen_domain(time=[t0,t1]);
  cells = meq.gen_cells(domain,num_time=10);
  request = meq.request(cells,rqtype='ev',new_domain=True);
  res = mqs.execute('root',request,wait=wait);
  if wait:
    print(res.result.vellsets[0].value);
Ejemplo n.º 4
0
def _test_forest (mqs,parent,**kwargs):
  """test_forest() is a standard TDL name. When a forest script is
  loaded by, e.g., the browser, and the "test" option is set to true,
  this method is automatically called after define_forest() to run a 
  test on the forest. The 'mqs' argument is a meqserver proxy object.
  """;
  from Timba.Meq import meq
  # run tests on the forest
  dom = meq.gen_domain(time=(0,6),freq=(0,6),l=(0,6),m=(0,6));
  cells = meq.gen_cells(dom,num_freq=20,num_time=20,num_l=20,num_m=20);
  request = meq.request(cells,rqtype='ev');
  mqs.meq('Node.Execute',record(name='mux',request=request),wait=False);
Ejemplo n.º 5
0
 def envelope_cells(self, **num_cells):
     """Returns cells object which envelops all of the parmtable, and is regularly spaced. The number of points
 along each axis is equal to the number of subdomains along that axis, but the cells do not necessarily follow
 the structure of the subdomain if the subdomains are overlapping, spaced out, or irregular.
 """
     dom = self.envelope_domain()
     kw = {}
     for iaxis, stats in enumerate(self._axis_stats):
         if not stats.empty():
             kwname = 'num_' + str(mequtils.get_axis_id(iaxis)).lower()
             kw[kwname] = num_cells.get(kwname, len(stats.cells))
     return meq.gen_cells(dom, **kw)
Ejemplo n.º 6
0
 def subdomain_cells(self):
     """Returns cells object which envelops all of the parmtable, and contains a cells matching every subdomain."""
     dom = self.envelope_domain()
     kw = {}
     cells = meq.gen_cells(dom)
     for iaxis, stats in enumerate(self._axis_stats):
         if not stats.empty():
             grid = list(stats.cells.keys())
             grid.sort()
             meq.add_cells_axis(cells, mequtils.get_axis_id(iaxis), grid=grid, cell_size=[
                 stats.cells[x0] for x0 in grid])
     return cells
Ejemplo n.º 7
0
 def envelope_cells(self, **num_cells):
     """Returns cells object which envelops all of the parmtable, and is regularly spaced. The number of points
     along each axis is equal to the number of subdomains along that axis, but the cells do not necessarily follow
     the structure of the subdomain if the subdomains are overlapping, spaced out, or irregular.
     """
     dom = self.envelope_domain()
     kw = {}
     for iaxis, stats in enumerate(self._axis_stats):
         if not stats.empty():
             kwname = 'num_' + str(mequtils.get_axis_id(iaxis)).lower()
             kw[kwname] = num_cells.get(kwname, len(stats.cells))
     return meq.gen_cells(dom, **kw)
Ejemplo n.º 8
0
def _test_forest(mqs, parent, **kwargs):
    """test_forest() is a standard TDL name. When a forest script is
  loaded by, e.g., the browser, and the "test" option is set to true,
  this method is automatically called after define_forest() to run a 
  test on the forest. The 'mqs' argument is a meqserver proxy object.
  """
    from Timba.Meq import meq
    # run tests on the forest
    dom = meq.gen_domain(time=(0, 6), freq=(0, 6), l=(0, 6), m=(0, 6))
    cells = meq.gen_cells(dom, num_freq=20, num_time=20, num_l=20, num_m=20)
    request = meq.request(cells, rqtype='ev')
    mqs.meq('Node.Execute', record(name='mux', request=request), wait=False)
Ejemplo n.º 9
0
 def subdomain_cells(self):
     """Returns cells object which envelops all of the parmtable, and contains a cells matching every subdomain."""
     dom = self.envelope_domain()
     kw = {}
     cells = meq.gen_cells(dom)
     for iaxis, stats in enumerate(self._axis_stats):
         if not stats.empty():
             grid = list(stats.cells.keys())
             grid.sort()
             meq.add_cells_axis(cells,
                                mequtils.get_axis_id(iaxis),
                                grid=grid,
                                cell_size=[stats.cells[x0] for x0 in grid])
     return cells
Ejemplo n.º 10
0
def _test_forest(mqs, parent):
    from Timba.Meq import meq
    # run tests on the forest
    domain = meq.gen_domain(time=[0, 7200],
                            l=[0, math.pi / 2],
                            m=[0, 2 * math.pi],
                            freq=[100, 200])
    cells = meq.gen_cells(domain,
                          num_time=10,
                          num_l=100,
                          num_m=100,
                          num_freq=10)
    request = meq.request(cells, rqtype='ev')
    mqs.execute('emf1', request)
    mqs.execute('emf2', request)
    mqs.execute('cube', request)