wcs 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d05d7ad45c2129e7f4c6e8b032072ac4d5849f7a
4
- data.tar.gz: 34df92539c4c3f9aba2e36e4549f7b828ca9a33f
3
+ metadata.gz: 89d7dbd8514f7a4f6fd22f306752695a0720b02b
4
+ data.tar.gz: 2da1e5bf5bb64587115113b4c75bfe4f8411f3e9
5
5
  SHA512:
6
- metadata.gz: 5b22d2b13f0aea26587f9f1c95126a63581e06aa8f8b8c1c710d56df3868dac53370de273f3ddeae7a251b1034dd11b26ab6a1e0962fb12bea251052e000d572
7
- data.tar.gz: 69d5f6852d84c48044a69a9cdd569ebc7b914c01e62fb740103e25825e633b8e082c73c45128980f9b1d408d27ea086136c4501d7d1b5ae0fbcb93df0921b81d
6
+ metadata.gz: 381d726a63269a6da7cf657fbfcd57366a124e7803b24b74ce0a90806c358f56a8637a71fc74508be64f96eac0929013ed42d87e51e3abea1cc78eb9b7f1d497
7
+ data.tar.gz: d6a39cec4ae74a70f0db97cc78e9db3124fd5a937e91c756d490aecf7fb35ff432555dc157f379d6e26f4e07d906374dfdae59f2d69dc4b65024179177908299
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Ruby/WCS
2
2
 
3
- [WCSTools](http://tdc-www.harvard.edu/wcstools/) wrapper for Ruby.
3
+ Ruby wrapper of [WCSTools](http://tdc-www.harvard.edu/wcstools/) using SWIG.
4
4
  Provides calculation and conversion of sky positions in astronomical coordinates.
5
5
 
6
+ This is **NOT** [WCSLIB](http://www.atnf.csiro.au/people/mcalabre/WCS/wcslib/) wrapper.
7
+
6
8
  * [GitHub](https://github.com/masa16/ruby-wcs)
7
9
  * [RubyGems](https://rubygems.org/gems/wcs)
8
10
  * [Class Documentation](http://rubydoc.info/gems/wcs/frames/)
@@ -35,30 +37,37 @@ Provides calculation and conversion of sky positions in astronomical coordinates
35
37
  ## Usage
36
38
 
37
39
  require 'wcs'
38
- naxis1 = 100 # Number of pixels along x-axis
39
- naxis2 = 100 # Number of pixels along y-axis
40
- ctype1 = "RA--TAN" # FITS WCS projection for axis 1
41
- ctype2 = "DEC-TAN" # FITS WCS projection for axis 2
42
- crpix1 = 0 # Reference pixel coordinates
43
- crpix2 = 0 # Reference pixel coordinates
44
- crval1 = 0 # Coordinate at reference pixel in degrees
45
- crval2 = 0 # Coordinate at reference pixel in degrees
46
- cd = nil # Rotation matrix, used if not NULL
47
- cdelt1 = 0.1 # scale in degrees/pixel, if cd is NULL
48
- cdelt2 = 0.1 # scale in degrees/pixel, if cd is NULL
49
- crota = 0 # Rotation angle in degrees, if cd is NULL
50
- equinox = 2000 # Equinox of coordinates, 1950 and 2000 supported
51
- epoch = 2000 # Epoch of coordinates, for FK4/FK5 conversion
40
+
41
+ ra = 0
42
+ dec = 0
43
+ l,b = Wcs.wcscon(Wcs::J2000,Wcs::GALACTIC,0,0,ra,dec,2000)
44
+ #=> [96.33726964987589, -60.188551749437046]
45
+
46
+ naxis1 = 100 # Number of pixels along x-axis
47
+ naxis2 = 100 # Number of pixels along y-axis
48
+ ctype1 = "RA--TAN" # FITS WCS projection for axis 1
49
+ ctype2 = "DEC-TAN" # FITS WCS projection for axis 2
50
+ crpix1 = 0 # Reference pixel coordinates
51
+ crpix2 = 0 # Reference pixel coordinates
52
+ crval1 = 0 # Coordinate at reference pixel in degrees
53
+ crval2 = 0 # Coordinate at reference pixel in degrees
54
+ cd = nil # Rotation matrix, used if not NULL
55
+ cdelt1 = 0.1 # scale in degrees/pixel, if cd is NULL
56
+ cdelt2 = 0.1 # scale in degrees/pixel, if cd is NULL
57
+ crota = 0 # Rotation angle in degrees, if cd is NULL
58
+ equinox = 2000 # Equinox of coordinates, 1950 and 2000 supported
59
+ epoch = 2000 # Epoch of coordinates, for FK4/FK5 conversion
52
60
 
53
61
  wcs = Wcs::WorldCoor.new(naxis1,naxis2,ctype1,ctype2,
54
62
  crpix1,crpix2,crval1,crval2,cd,cdelt1,cdelt2,
55
63
  crota,equinox,epoch)
56
- xpix,ypix = wcs.wcs2pix(0.5,0.5)
57
- xpos,ypos = wcs.pix2wcs(50,50)
58
64
 
59
- ra = 0
60
- dec = 0
61
- l,b = Wcs.wcscon(Wcs::J2000,Wcs::GALACTIC,0,0,ra,dec,2000)
65
+ xpix,ypix,offscl = wcs.wcs2pix(0.5,0.5)
66
+ #=> [5.000126927791313, 5.000317324553201, 0]
67
+
68
+ xpos,ypos = wcs.pix2wcs(12,34)
69
+ #=> [1.1998245865308625, 3.395274673610471]
70
+
62
71
 
63
72
  ## Platforms tested
64
73
 
@@ -7,6 +7,6 @@ require "mkmf"
7
7
 
8
8
  dir_config("wcs")
9
9
  exit unless have_header("wcs/wcs.h")
10
- exit unless have_library("wcs")
10
+ exit unless have_library("wcs","wcscon")
11
11
  $objs = ["wcs_wrap.o"]
12
12
  create_makefile("wcs")
data/ext/wcs.i CHANGED
@@ -415,10 +415,10 @@ typedef int BOOLEAN;
415
415
  // char **header, /* Pointer to start of FITS header */
416
416
  // char *cwcs); /* Keyword suffix character for output WCS */
417
417
 
418
- void savewcscoor( /* Save output coordinate system */
419
- char *wcscoor); /* coordinate system (J2000, B1950, galactic) */
420
-
421
- char *getwcscoor(void); /* Return output coordinate system */
418
+ // void savewcscoor( /* Save output coordinate system */
419
+ // char *wcscoor); /* coordinate system (J2000, B1950, galactic) */
420
+ //
421
+ // char *getwcscoor(void); /* Return output coordinate system */
422
422
 
423
423
 
424
424
  /* Coordinate conversion subroutines in wcscon.c */
@@ -122,11 +122,11 @@ class WorldCoor
122
122
 
123
123
  # Return image center and size in RA and Dec
124
124
  #
125
- # @return [[cra,cdec,ora,odec]]
125
+ # @return [[cra,cdec,hwra,hwdec]]
126
126
  # * cra: Right ascension of image center (deg)
127
127
  # * cdec: Declination of image center (deg)
128
- # * dra: Half-width in right ascension (deg)
129
- # * ddec: Half-width in declination (deg)
128
+ # * hwra: Half-width in right ascension (deg)
129
+ # * hwdec: Half-width in declination (deg)
130
130
  def wcssize
131
131
  # This function is defined in C
132
132
  end
@@ -165,6 +165,7 @@ class WorldCoor
165
165
  # @param [Float] cdelt1 degrees/pixel in first axis (or both axes)
166
166
  # @param [Float] cdelt2 degrees/pixel in second axis if nonzero
167
167
  # @param [Array] pc Rotation matrix, ignored if NULL
168
+ # @return [nil]
168
169
  def wcspcset(cdelt1,cdelt2,pc)
169
170
  # This function is defined in C
170
171
  end
@@ -303,7 +304,7 @@ class WorldCoor
303
304
  # Set third dimension for cube projections
304
305
  #
305
306
  # @param [Integer] izpix Set coordinate in third dimension (face)
306
- # @return [Integer]
307
+ # @return [Integer] saved izpix
307
308
  def wcszin(izpix)
308
309
  # This function is defined in C
309
310
  end
@@ -317,24 +318,24 @@ class WorldCoor
317
318
  end
318
319
 
319
320
 
320
- # Save output coordinate system
321
- #
322
- # @param [String] wcscoor coordinate system (J2000, B1950, galactic)
323
- # @return [nil]
324
- def savewcscoor(wcscoor)
325
- # This function is defined in C
326
- end
327
-
328
- # Return output coordinate system
329
- # @return [String]
330
- def getwcscoor
331
- end
321
+ # # Save output coordinate system
322
+ # #
323
+ # # @param [String] wcscoor coordinate system (J2000, B1950, galactic)
324
+ # # @return [nil]
325
+ # def savewcscoor(wcscoor)
326
+ # # This function is defined in C
327
+ # end
328
+ #
329
+ # # Return output coordinate system
330
+ # # @return [String]
331
+ # def getwcscoor
332
+ # end
332
333
 
333
334
  # Convert from coordinate system sys1 to coordinate system sys2, converting
334
335
  # proper motions, too, and adding them if an epoch is specified
335
336
  #
336
- # @param [Integer] sys1 Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC
337
- # @param [Integer] sys2 Output coordinate system (J2000, B1950, ECLIPTIC, G ALACTIC
337
+ # @param [Integer] sys1 Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC)
338
+ # @param [Integer] sys2 Output coordinate system (J2000, B1950, ECLIPTIC, GALACTIC)
338
339
  # @param [Float] eq1 Input equinox (default of sys1 if 0.0)
339
340
  # @param [Float] eq2 Output equinox (default of sys2 if 0.0)
340
341
  # @param [Float] ep1 Input Besselian epoch in years
@@ -359,8 +360,8 @@ class WorldCoor
359
360
  # Convert from coordinate system sys1 to coordinate system sys2, converting
360
361
  # proper motions, too, and adding them if an epoch is specified
361
362
  #
362
- # @param [Integer] sys1 Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC
363
- # @param [Integer] sys2 Output coordinate system (J2000, B1950, ECLIPTIC, GALACTIC
363
+ # @param [Integer] sys1 Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC)
364
+ # @param [Integer] sys2 Output coordinate system (J2000, B1950, ECLIPTIC, GALACTIC)
364
365
  # @param [Float] eq1 Input equinox (default of sys1 if 0.0)
365
366
  # @param [Float] eq2 Output equinox (default of sys2 if 0.0)
366
367
  # @param [Float] ep1 Input Besselian epoch in years (for proper motion)
@@ -379,8 +380,8 @@ class WorldCoor
379
380
 
380
381
  # Convert between coordinate systems and equinoxes
381
382
  #
382
- # @param [Integer] sys1 Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC
383
- # @param [Integer] sys2 Output coordinate system (J2000, B1950, ECLIPTIC, G ALACTIC
383
+ # @param [Integer] sys1 Input coordinate system (J2000, B1950, ECLIPTIC, GALACTIC)
384
+ # @param [Integer] sys2 Output coordinate system (J2000, B1950, ECLIPTIC, GALACTIC)
384
385
  # @param [Float] eq1 Input equinox (default of sys1 if 0.0)
385
386
  # @param [Float] eq2 Output equinox (default of sys2 if 0.0)
386
387
  # @param [Float] dtheta Longitude or right ascension in degrees
@@ -1,3 +1,3 @@
1
1
  module Wcs
2
- VERSION="0.1.1"
2
+ VERSION="0.1.2"
3
3
  end
@@ -406,20 +406,20 @@ describe "Wcs" do
406
406
  end
407
407
 
408
408
 
409
- # Save output coordinate system
410
- #
411
- # @param [String] wcscoor coordinate system (J2000, B1950, galactic)
412
- # @return [String]
413
- wcscoor = 'J2000'
414
- describe Wcs.savewcscoor(wcscoor) do
415
- it{should == ''}
416
- end
417
-
418
- # Return output coordinate system
419
- # @return [String]
420
- describe Wcs.getwcscoor do
421
- it{should == 'J2000'}
422
- end
409
+ # # Save output coordinate system
410
+ # #
411
+ # # @param [String] wcscoor coordinate system (J2000, B1950, galactic)
412
+ # # @return [String]
413
+ # wcscoor = 'J2000'
414
+ # describe Wcs.savewcscoor(wcscoor) do
415
+ # it{should == ''}
416
+ # end
417
+ #
418
+ # # Return output coordinate system
419
+ # # @return [String]
420
+ # describe Wcs.getwcscoor do
421
+ # it{should == 'J2000'}
422
+ # end
423
423
 
424
424
  # Convert from coordinate system sys1 to coordinate system sys2, converting
425
425
  # proper motions, too, and adding them if an epoch is specified
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro TANAKA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-23 00:00:00.000000000 Z
11
+ date: 2013-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler