Class: Miriad::Visibility

Inherits:
Object
  • Object
show all
Defined in:
lib/miriad.rb

Overview

The Visibility class holds preamble, visdata, and flags for one integration on one baseline. It also provides convenience methods to query and access these attributes and their sub-attributes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(preamble, data, flags) ⇒ Visibility

Constructs a new Visibility object containing the given preamble, data, and flags objects. Not often used directly. Usually Visibility objects are obtained from Uvio#read.



772
773
774
775
776
# File 'lib/miriad.rb', line 772

def initialize(preamble, data, flags)
  @preamble = preamble
  @data = data
  @flags = flags
end

Instance Attribute Details

#dataObject

The MIRIAD visdata



766
767
768
# File 'lib/miriad.rb', line 766

def data
  @data
end

#flagsObject

The MIRIAD flags



768
769
770
# File 'lib/miriad.rb', line 768

def flags
  @flags
end

#preambleObject

The MIRIAD preamble



764
765
766
# File 'lib/miriad.rb', line 764

def preamble
  @preamble
end

Class Method Details

.[](nchan) ⇒ Object

call-seq: Visibility

Contruct a Visibility object capable of holding nchan channels of data.



780
781
782
783
784
785
786
# File 'lib/miriad.rb', line 780

def self.[](nchan)
  self.new(
    NArray.dfloat(5),
    NArray.scomplex(nchan),
    NArray.int(nchan)
  )
end

Instance Method Details

#auto?Boolean

True if this Visibility’s baseline is an autocorrelation.

Returns:

  • (Boolean)


811
# File 'lib/miriad.rb', line 811

def auto?() a1,a2=Miriad.basant(baseline); a1 == a2; end

#basantObject

Returns the two antenna numbers corresponding to the baseline number from this Visibility’s preamble.



809
# File 'lib/miriad.rb', line 809

def basant() Miriad.basant(baseline); end

#baselineObject

Returns the baseline number from this Visibility’s preamble.



803
# File 'lib/miriad.rb', line 803

def baseline() preamble[4].to_i; end

#coordObject

call-seq: coord() -> [u, v, w]

Returns the [u,v,w] coordinates from this Visibility’s preamble. This method always returns an Array, regardless of how Uvio#read was called. This allows you to do multiple assignment like:

u, v, w = vis.coord


794
# File 'lib/miriad.rb', line 794

def coord() preamble[0..2].to_a; end

#cross?Boolean

True if this Visibility’s baseline is a cross correlation.

Returns:

  • (Boolean)


813
# File 'lib/miriad.rb', line 813

def cross?() a1,a2=Miriad.basant(baseline); a1 != a2; end

#jdObject

Returns the Julian date from this Visibility’s preamble.



801
# File 'lib/miriad.rb', line 801

def jd() preamble[3]; end

#timeObject

Returns a DateTime object corresponding to the Julian date from this Visibility’s preamble.



806
# File 'lib/miriad.rb', line 806

def time() DateTime.ajd(jd); end

#uvangleObject

Computes the uv position angle (in radians, clockwise from the v axis) from this Visibility’s preamble using atan2(u,v).



797
# File 'lib/miriad.rb', line 797

def uvangle() Math.atan2(preamble[0], preamble[1]); end

#uvdistObject

Computes the uv distance from this Visibility’s preamble.



799
# File 'lib/miriad.rb', line 799

def uvdist() Math.hypot(preamble[0], preamble[1]); end