Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
82d03525
Commit
82d03525
authored
12 years ago
by
David Rafferty
Browse files
Options
Downloads
Patches
Plain Diff
Task #3743: Removed pyrap-specific calls to find equinox.
parent
2c8b1c4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CEP/PyBDSM/src/python/readimage.py
+21
-56
21 additions, 56 deletions
CEP/PyBDSM/src/python/readimage.py
with
21 additions
and
56 deletions
CEP/PyBDSM/src/python/readimage.py
+
21
−
56
View file @
82d03525
...
@@ -234,26 +234,6 @@ class Op_readimage(Op):
...
@@ -234,26 +234,6 @@ class Op_readimage(Op):
if
img
.
opts
.
beam
is
not
None
:
if
img
.
opts
.
beam
is
not
None
:
beam
=
img
.
opts
.
beam
beam
=
img
.
opts
.
beam
else
:
else
:
# if img.use_io == 'rap':
# iminfo = hdr['imageinfo']
# if iminfo.has_key('restoringbeam'):
# beaminfo = iminfo['restoringbeam']
# if beaminfo.has_key('major') and beaminfo.has_key('minor') and beaminfo.has_key('major'):
# bmaj = beaminfo['major']['value']
# bmin = beaminfo['minor']['value']
# bpa = beaminfo['positionangle']['value']
# # make sure all values are in degrees
# if beaminfo['major']['unit'] == 'arcsec':
# bmaj = bmaj / 3600.0
# if beaminfo['minor']['unit'] == 'arcsec':
# bmin = bmin / 3600.0
# if beaminfo['major']['unit'] == 'rad':
# bmaj = bmaj * 180.0 / N.pi
# if beaminfo['minor']['unit'] == 'rad':
# bmin = bmin * 180.0 / N.pi
# beam = (bmaj, bmin, bpa) # all degrees
# found = True
# if img.use_io == 'fits':
try
:
try
:
beam
=
(
hdr
[
'
BMAJ
'
],
hdr
[
'
BMIN
'
],
hdr
[
'
BPA
'
])
beam
=
(
hdr
[
'
BMAJ
'
],
hdr
[
'
BMIN
'
],
hdr
[
'
BPA
'
])
found
=
True
found
=
True
...
@@ -371,43 +351,28 @@ class Op_readimage(Op):
...
@@ -371,43 +351,28 @@ class Op_readimage(Op):
"""
"""
code
=
-
1
code
=
-
1
year
=
None
year
=
None
if
img
.
use_io
==
'
rap
'
:
hdr
=
img
.
header
hdr
=
img
.
header
[
'
coordinates
'
][
'
direction0
'
]
if
'
EQUINOX
'
in
hdr
:
code
=
-
1
year
=
hdr
[
'
EQUINOX
'
]
year
=
None
if
isinstance
(
year
,
str
):
# Check for 'J2000' or 'B1950' values
if
hdr
.
has_key
(
'
system
'
):
tst
=
year
[:
1
]
year
=
hdr
[
'
system
'
]
if
(
tst
==
'
J
'
)
or
(
tst
==
'
B
'
):
if
isinstance
(
year
,
str
):
# Check for 'J2000' or 'B1950' values
year
=
float
(
year
[
1
:])
tst
=
year
[:
1
]
if
tst
==
'
J
'
:
code
=
3
if
(
tst
==
'
J
'
)
or
(
tst
==
'
B
'
):
if
tst
==
'
B
'
:
code
=
2
year
=
float
(
year
[
1
:])
if
tst
==
'
J
'
:
code
=
3
if
tst
==
'
B
'
:
code
=
2
else
:
code
=
0
if
img
.
use_io
==
'
fits
'
:
hdr
=
img
.
header
if
'
EQUINOX
'
in
hdr
:
year
=
hdr
[
'
EQUINOX
'
]
if
isinstance
(
year
,
str
):
# Check for 'J2000' or 'B1950' values
tst
=
year
[:
1
]
if
(
tst
==
'
J
'
)
or
(
tst
==
'
B
'
):
year
=
float
(
year
[
1
:])
if
tst
==
'
J
'
:
code
=
3
if
tst
==
'
B
'
:
code
=
2
else
:
code
=
0
else
:
else
:
if
'
EPOCH
'
in
hdr
:
# Check EPOCH if EQUINOX not found
code
=
0
year
=
hdr
[
'
EPOCH
'
]
else
:
code
=
1
if
'
EPOCH
'
in
hdr
:
# Check EPOCH if EQUINOX not found
else
:
year
=
hdr
[
'
EPOCH
'
]
if
'
RADECSYS
'
in
hdr
:
code
=
1
sys
=
hdr
[
'
RADECSYS
'
]
else
:
code
=
4
if
'
RADECSYS
'
in
hdr
:
if
sys
[:
3
]
==
'
ICR
'
:
year
=
2000.0
sys
=
hdr
[
'
RADECSYS
'
]
if
sys
[:
3
]
==
'
FK5
'
:
year
=
2000.0
code
=
4
if
sys
[:
3
]
==
'
FK4
'
:
year
=
1950.0
if
sys
[:
3
]
==
'
ICR
'
:
year
=
2000.0
if
sys
[:
3
]
==
'
FK5
'
:
year
=
2000.0
if
sys
[:
3
]
==
'
FK4
'
:
year
=
1950.0
return
year
,
code
return
year
,
code
def
get_rot
(
self
,
img
,
location
=
None
):
def
get_rot
(
self
,
img
,
location
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment