Class: Miriad::Visibility
- Inherits:
-
Object
- Object
- Miriad::Visibility
- 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
-
#data ⇒ Object
The MIRIAD visdata.
-
#flags ⇒ Object
The MIRIAD flags.
-
#preamble ⇒ Object
The MIRIAD preamble.
Class Method Summary collapse
-
.[](nchan) ⇒ Object
call-seq: Visibility.
Instance Method Summary collapse
-
#auto? ⇒ Boolean
True if this Visibility’s baseline is an autocorrelation.
-
#basant ⇒ Object
Returns the two antenna numbers corresponding to the baseline number from this Visibility’s preamble.
-
#baseline ⇒ Object
Returns the baseline number from this Visibility’s preamble.
-
#coord ⇒ Object
call-seq: coord() -> [u, v, w].
-
#cross? ⇒ Boolean
True if this Visibility’s baseline is a cross correlation.
-
#initialize(preamble, data, flags) ⇒ Visibility
constructor
Constructs a new Visibility object containing the given
preamble,data, andflagsobjects. -
#jd ⇒ Object
Returns the Julian date from this Visibility’s preamble.
-
#time ⇒ Object
Returns a DateTime object corresponding to the Julian date from this Visibility’s preamble.
-
#uvangle ⇒ Object
Computes the uv position angle (in radians, clockwise from the v axis) from this Visibility’s preamble using
atan2(u,v). -
#uvdist ⇒ Object
Computes the uv distance from this Visibility’s preamble.
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
#data ⇒ Object
The MIRIAD visdata
766 767 768 |
# File 'lib/miriad.rb', line 766 def data @data end |
#flags ⇒ Object
The MIRIAD flags
768 769 770 |
# File 'lib/miriad.rb', line 768 def flags @flags end |
#preamble ⇒ Object
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.
811 |
# File 'lib/miriad.rb', line 811 def auto?() a1,a2=Miriad.basant(baseline); a1 == a2; end |
#basant ⇒ Object
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 |
#baseline ⇒ Object
Returns the baseline number from this Visibility’s preamble.
803 |
# File 'lib/miriad.rb', line 803 def baseline() preamble[4].to_i; end |
#coord ⇒ Object
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.
813 |
# File 'lib/miriad.rb', line 813 def cross?() a1,a2=Miriad.basant(baseline); a1 != a2; end |
#jd ⇒ Object
Returns the Julian date from this Visibility’s preamble.
801 |
# File 'lib/miriad.rb', line 801 def jd() preamble[3]; end |
#time ⇒ Object
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 |
#uvangle ⇒ Object
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 |
#uvdist ⇒ Object
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 |