miriad 4.1.0.6 → 4.1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/miriad.rb +38 -28
- metadata +2 -2
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: Rakefile
|
1
|
+
# $Id: Rakefile 26 2008-05-09 23:28:16Z davidm $
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake/gempackagetask'
|
@@ -14,7 +14,7 @@ run_swig unless test ?e, 'ext/miriad_wrap.c'
|
|
14
14
|
spec = Gem::Specification.new do |s|
|
15
15
|
# Basics
|
16
16
|
s.name = 'miriad'
|
17
|
-
s.version = '4.1.0.
|
17
|
+
s.version = '4.1.0.8'
|
18
18
|
s.summary = 'Ruby interface to MIRIAD'
|
19
19
|
s.description = <<-EOS
|
20
20
|
The MIRIAD-Ruby package...
|
data/lib/miriad.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
# astronomy related methods to Ruby classes.
|
8
8
|
#
|
9
9
|
#--
|
10
|
-
# $Id: miriad.rb
|
10
|
+
# $Id: miriad.rb 25 2008-05-09 23:12:54Z davidm $
|
11
11
|
#++
|
12
12
|
|
13
13
|
require 'rbconfig'
|
@@ -276,7 +276,7 @@ module Miriad
|
|
276
276
|
# The version of mirlib on which this package is based.
|
277
277
|
MIRLIB_VERSION = "4.1.0"
|
278
278
|
|
279
|
-
|
279
|
+
a_lookup_table = {
|
280
280
|
1 => 'I' ,
|
281
281
|
2 => 'Q' ,
|
282
282
|
3 => 'U' ,
|
@@ -306,9 +306,9 @@ module Miriad
|
|
306
306
|
# POLMAP is a Hash that can be used to map polarization codes to strings and
|
307
307
|
# vice versa.
|
308
308
|
#
|
309
|
-
# *
|
309
|
+
# * When mapping from codes (i.e. numbers), uppercase strings are returned.
|
310
310
|
#
|
311
|
-
# *
|
311
|
+
# * When mapping from strings, either uppercase or lowercase (but *not* mixed
|
312
312
|
# case) can be used.
|
313
313
|
#
|
314
314
|
# The values follow the AIPS/FITS conventions. Here is the mapping:
|
@@ -325,7 +325,7 @@ module Miriad
|
|
325
325
|
# -6:: 'YY' (Linear YY)
|
326
326
|
# -7:: 'XY' (Linear XY)
|
327
327
|
# -8:: 'YX' (Linear YX)
|
328
|
-
POLMAP =
|
328
|
+
POLMAP = a_lookup_table
|
329
329
|
|
330
330
|
# call-seq: Miriad.xyz2uvw(xyz1, xyz2, obsra, obsdec, lst) -> [u, v, w]
|
331
331
|
#
|
@@ -634,15 +634,15 @@ module Miriad
|
|
634
634
|
end
|
635
635
|
# call-seq: coord() -> [u, v, w]
|
636
636
|
#
|
637
|
-
# Returns the [u,v,w] coordinates from this Visibility's preamble.
|
638
|
-
#
|
639
|
-
# Uvio#read was called.
|
640
|
-
#
|
641
|
-
#
|
642
|
-
def coord() preamble[0..2]; end
|
643
|
-
# Computes the uv angle (in radians
|
644
|
-
# <tt>atan2(v
|
645
|
-
def uvangle() Math.atan2(preamble[
|
637
|
+
# Returns the [u,v,w] coordinates from this Visibility's preamble. This
|
638
|
+
# method always returns an Array, regardless of how
|
639
|
+
# Uvio#read was called. This allows you to do multiple assignment like:
|
640
|
+
#
|
641
|
+
# u, v, w = vis.coord
|
642
|
+
def coord() preamble[0..2].to_a; end
|
643
|
+
# Computes the uv position angle (in radians, clockwise from the v axis)
|
644
|
+
# from this Visibility's preamble using <tt>atan2(u,v)</tt>.
|
645
|
+
def uvangle() Math.atan2(preamble[0], preamble[1]); end
|
646
646
|
# Computes the uv distance from this Visibility's preamble.
|
647
647
|
def uvdist() Math.hypot(preamble[0], preamble[1]); end
|
648
648
|
# Returns the Julian date from this Visibility's preamble.
|
@@ -754,8 +754,8 @@ module Miriad
|
|
754
754
|
dlen = flen = n
|
755
755
|
dlen *= 2 if Array === d
|
756
756
|
# Shorten data and flags
|
757
|
-
|
758
|
-
|
757
|
+
vis.data = d[0...dlen] if dlen != d.length
|
758
|
+
vis.flags = f[0...flen] if flen != f.length
|
759
759
|
|
760
760
|
# Return Visibility
|
761
761
|
vis
|
@@ -909,12 +909,12 @@ module Miriad
|
|
909
909
|
getvr('lst') - getvr('obsra') rescue 0.0
|
910
910
|
end
|
911
911
|
|
912
|
-
# Computes the uv angle (in radians
|
913
|
-
#
|
914
|
-
# undefined or maldefined.
|
912
|
+
# Computes the uv position angle (in radians, clockwise from the v axis)
|
913
|
+
# from the current value of the _coord_ uv variable using
|
914
|
+
# <tt>atan2(u,v)</tt>. Returns 0.0 if _coord_ is undefined or maldefined.
|
915
915
|
def uvangle
|
916
916
|
u, v, w = getvr('coord')
|
917
|
-
(u && v) ? Math.atan2(
|
917
|
+
(u && v) ? Math.atan2(u, v) : 0.0
|
918
918
|
end
|
919
919
|
|
920
920
|
# Computes the uv distance from the current value of the _coord_ uv
|
@@ -938,17 +938,27 @@ module Miriad
|
|
938
938
|
end
|
939
939
|
|
940
940
|
# Computes the Earth rotation synthesis fringe rate in Hz using the current
|
941
|
-
#
|
942
|
-
#
|
943
|
-
#
|
944
|
-
# be
|
941
|
+
# value of the _obsdec_ uv variable and _u_ from the _coord_ us variable.
|
942
|
+
#
|
943
|
+
# +freq_ghz+ is the sky frequency, in GHz, for which the fringe rate will
|
944
|
+
# be determined. If it is not given, the value of the _freq_ uv variable
|
945
|
+
# will be used.
|
945
946
|
def fringe_hz(freq_ghz = getvr('freq'))
|
946
|
-
|
947
|
-
obsra = getvr('obsra') || 0.0
|
947
|
+
u = getvr('coord')[0] rescue 0.0
|
948
948
|
obsdec = getvr('obsdec') || 0.0
|
949
|
-
lst = getvr('lst') || 0.0
|
950
949
|
freq_ghz ||= 0.0
|
951
|
-
|
950
|
+
-freq_ghz * DateTime::OMEGA * u * Math.cos(obsdec)
|
951
|
+
end
|
952
|
+
|
953
|
+
# Computes the Earth rotation synthesis fringe period in seconds using the
|
954
|
+
# current value of the _obsdec_ uv variable and _u_ from the _coord_ us
|
955
|
+
# variable.
|
956
|
+
#
|
957
|
+
# +freq_ghz+ is the sky frequency, in GHz, for which the fringe rate will
|
958
|
+
# be determined. If it is not given, the value of the _freq_ uv variable
|
959
|
+
# will be used.
|
960
|
+
def fringe_sec(freq_ghz = getvr('freq'))
|
961
|
+
1.0 / fringe_hz(freq_ghz)
|
952
962
|
end
|
953
963
|
|
954
964
|
# Returns <tt>getvr('inttime')</tt> or 0.0 if it is not (yet) defined.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miriad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.0.
|
4
|
+
version: 4.1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David MacMahon
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|