original_docstring: Print List of selected pair of files with information on velocity resolution 
      
      Parameters
      ----------
      ctx : :class:`wise.project.AnalysisContext`
      delta_time_unit : :class:`astropy.units.Unit`, optional
      angular_velocity_unit : :class:`astropy.units.Unit`, optional
      proper_velocity_unit : :class:`astropy.units.Unit`, optional
  
  
      .. _tags: task_general
      
docstring: Print List of selected pair of files with information on velocity resolution
  Parameters
  
  
  
  
docstring_tokens: Print List of selected pair of files with information on velocity resolution Parameters
code: def info_files_delta(ctx, delta_time_unit=u.day, angular_velocity_unit=u.mas / u.year,
                       proper_velocity_unit=unit_c):
      '''Print List of selected pair of files with information on velocity resolution 
      
      Parameters
      ----------
      ctx : :class:`wise.project.AnalysisContext`
      delta_time_unit : :class:`astropy.units.Unit`, optional
      angular_velocity_unit : :class:`astropy.units.Unit`, optional
      proper_velocity_unit : :class:`astropy.units.Unit`, optional
  
  
      .. _tags: task_general
      '''
      all_delta_time = []
      all_velocity_c_px = []
      all_velocity_px = []
      data = []
      header = ["Date 1", "Date 2", "Delta (%s)" % delta_time_unit, 
              "Angular vel. res. (%s)" % angular_velocity_unit, 
              "Proper vel. res. (%s)" % proper_velocity_unit]
      has_distance = ctx.config.data.object_distance or ctx.config.data.object_z
      for file1, file2 in nputils.pairwise(ctx.files):
          img1 = ctx.open_file(file1)
          img2 = ctx.open_file(file2)
          prj = ctx.get_projection(img1)
          date1 = img1.get_epoch(str_format='%Y-%m-%d')
          date2 = img2.get_epoch(str_format='%Y-%m-%d')
          if not isinstance(date1, datetime.date):
              print "Images have no date information"
              return
          delta_t = ((img2.get_epoch() - img1.get_epoch()).total_seconds() * u.second).to(delta_time_unit)
          all_delta_time.append(delta_t)
  
          velocity_px = prj.angular_velocity([0, 0], [0, 1], delta_t).to(angular_velocity_unit)
          all_velocity_px.append(velocity_px)
  
          if has_distance:
              velocity_c_px = prj.proper_velocity([0, 0], [0, 1], delta_t).to(proper_velocity_unit)
              all_velocity_c_px.append(velocity_c_px)
  
          if has_distance:
              data.append([date1, date2, delta_t.value, velocity_px.value, velocity_c_px.value])
          else:
              data.append([date1, date2, delta_t.value, velocity_px.value, '-'])
  
          # print "{0} -> {1}: Delta time: {2}, Velocity resolution: {3:.3f}, {4:.3f}".format(*data)
  
      all_delta_time = nputils.quantities_to_array(all_delta_time)
      all_velocity_px = nputils.quantities_to_array(all_velocity_px)
  
      print nputils.format_table(data, header)
  
      print "Mean Delta time: %s +- %s" % (np.mean(all_delta_time), np.std(all_delta_time))
      print "Mean Velocity resolution: %s +- %s" % (np.mean(all_velocity_px), np.std(all_velocity_px))
      if has_distance:
          all_velocity_c_px = nputils.quantities_to_array(all_velocity_c_px)
          print "Mean Velocity resolution: %s +- %s" % (np.mean(all_velocity_c_px), np.std(all_velocity_c_px))
code_tokens: def info_files_delta ( ctx , delta_time_unit = u . day , angular_velocity_unit = u . mas / u . year , proper_velocity_unit = unit_c ) : all_delta_time = [ ] all_velocity_c_px = [ ] all_velocity_px = [ ] data = [ ] header = [ "Date 1" , "Date 2" , "Delta (%s)" % delta_time_unit , "Angular vel. res. (%s)" % angular_velocity_unit , "Proper vel. res. (%s)" % proper_velocity_unit ] has_distance = ctx . config . data . object_distance or ctx . config . data . object_z for file1 , file2 in nputils . pairwise ( ctx . files ) : img1 = ctx . open_file ( file1 ) img2 = ctx . open_file ( file2 ) prj = ctx . get_projection ( img1 ) date1 = img1 . get_epoch ( str_format = '%Y-%m-%d' ) date2 = img2 . get_epoch ( str_format = '%Y-%m-%d' ) if not isinstance ( date1 , datetime . date ) : print "Images have no date information" return delta_t = ( ( img2 . get_epoch ( ) - img1 . get_epoch ( ) ) . total_seconds ( ) * u . second ) . to ( delta_time_unit ) all_delta_time . append ( delta_t ) velocity_px = prj . angular_velocity ( [ 0 , 0 ] , [ 0 , 1 ] , delta_t ) . to ( angular_velocity_unit ) all_velocity_px . append ( velocity_px ) if has_distance : velocity_c_px = prj . proper_velocity ( [ 0 , 0 ] , [ 0 , 1 ] , delta_t ) . to ( proper_velocity_unit ) all_velocity_c_px . append ( velocity_c_px ) if has_distance : data . append ( [ date1 , date2 , delta_t . value , velocity_px . value , velocity_c_px . value ] ) else : data . append ( [ date1 , date2 , delta_t . value , velocity_px . value , '-' ] ) all_delta_time = nputils . quantities_to_array ( all_delta_time ) all_velocity_px = nputils . quantities_to_array ( all_velocity_px ) print nputils . format_table ( data , header ) print "Mean Delta time: %s +- %s" % ( np . mean ( all_delta_time ) , np . std ( all_delta_time ) ) print "Mean Velocity resolution: %s +- %s" % ( np . mean ( all_velocity_px ) , np . std ( all_velocity_px ) ) if has_distance : all_velocity_c_px = nputils . quantities_to_array ( all_velocity_c_px ) print "Mean Velocity resolution: %s +- %s" % ( np . mean ( all_velocity_c_px ) , np . std ( all_velocity_c_px ) )
short_docstring: Print List of selected pair of files with information on velocity resolution
  Parameters
short_docstring_tokens: Print List of selected pair of files with information on velocity resolution Parameters
comment: '''Print List of selected pair of files with information on velocity resolution 
      
      Parameters
      ----------
      ctx : :class:`wise.project.AnalysisContext`
      delta_time_unit : :class:`astropy.units.Unit`, optional
      angular_velocity_unit : :class:`astropy.units.Unit`, optional
      proper_velocity_unit : :class:`astropy.units.Unit`, optional
  
  
      .. _tags: task_general
      '''$SEP$# print "{0} -> {1}: Delta time: {2}, Velocity resolution: {3:.3f}, {4:.3f}".format(*data)