File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ module Reproject
3
3
using FITSIO, WCS
4
4
5
5
include (" parsers.jl" )
6
+ include (" utils.jl" )
6
7
7
8
end # module
Original file line number Diff line number Diff line change
1
+ """
2
+ wcs_to_celestial_frame(wcs::WCSTransform)
3
+
4
+ Returns the reference frame of a WCSTransform.
5
+ The reference frame supported in Julia are FK5, ICRS and Galactic.
6
+ """
7
+ function wcs_to_celestial_frame (wcs:: WCSTransform )
8
+ radesys = wcs. radesys
9
+
10
+ xcoord = wcs. ctype[1 ][1 : 4 ]
11
+ ycoord = wcs. ctype[2 ][1 : 4 ]
12
+
13
+ if radesys == " "
14
+ if xcoord == " GLON" && ycoord == " GLAT"
15
+ radesys = " Gal"
16
+ elseif xcoord == " TLON" && ycoord == " TLAT"
17
+ radesys = " ITRS"
18
+ end
19
+ end
20
+
21
+ return radesys
22
+ end
Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ rp = pyimport("reproject")
10
10
11
11
@testset " Reproject.jl" begin
12
12
include (" parsers.jl" )
13
+ include (" utils.jl" )
13
14
end
Original file line number Diff line number Diff line change
1
+ using Reproject: wcs_to_celestial_frame
2
+ @testset " wcs to celestial frame" begin
3
+ wcs1 = WCSTransform (2 ;
4
+ ctype = [" RA---AIR" , " DEC--AIR" ],
5
+ )
6
+ wcs2 = WCSTransform (2 ;
7
+ ctype = [" RA---AIR" , " DEC--AIR" ],
8
+ equinox = 1888.67
9
+ )
10
+ wcs3 = WCSTransform (2 ;
11
+ ctype = [" RA---AIR" , " DEC--AIR" ],
12
+ equinox = 2000
13
+ )
14
+ wcs4 = WCSTransform (2 ;
15
+ ctype = [" GLON--" , " GLAT--" ],
16
+ )
17
+ wcs5 = WCSTransform (2 ;
18
+ ctype = [" TLON" , " TLAT" ],
19
+ )
20
+ wcs6 = WCSTransform (2 ;
21
+ ctype = [" RA---AIR" , " DEC--AIR" ],
22
+ radesys = " UNK"
23
+ )
24
+
25
+ @test wcs_to_celestial_frame (wcs1) == " ICRS"
26
+ @test wcs_to_celestial_frame (wcs2) == " FK4"
27
+ @test wcs_to_celestial_frame (wcs3) == " FK5"
28
+ @test wcs_to_celestial_frame (wcs4) == " Gal"
29
+ @test wcs_to_celestial_frame (wcs5) == " ITRS"
30
+ @test wcs_to_celestial_frame (wcs6) == " UNK"
31
+ end
You can’t perform that action at this time.
0 commit comments