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
598696f2
Commit
598696f2
authored
13 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
Task #2699
Use a try/except around import of TKP.config
parent
de23a5ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CEP/pyparmdb/src/gsmutils.py
+15
-5
15 additions, 5 deletions
CEP/pyparmdb/src/gsmutils.py
with
15 additions
and
5 deletions
CEP/pyparmdb/src/gsmutils.py
+
15
−
5
View file @
598696f2
...
@@ -9,12 +9,8 @@ import sys, pylab, string
...
@@ -9,12 +9,8 @@ import sys, pylab, string
import
numpy
as
np
import
numpy
as
np
import
monetdb.sql
as
db
import
monetdb.sql
as
db
import
logging
import
logging
from
tkp.config
import
config
DERUITER_R
=
config
[
'
source_association
'
][
'
deruiter_radius
'
]
def
expected_fluxes_in_fov
(
conn
,
ra_central
,
decl_central
,
fov_radius
,
assoc_theta
,
bbsfile
,
storespectraplots
=
False
,
deruiter_radius
=
0.
):
print
"
DERUITER_R =
"
,
DERUITER_R
def
expected_fluxes_in_fov
(
conn
,
ra_central
,
decl_central
,
fov_radius
,
assoc_theta
,
bbsfile
,
storespectraplots
=
False
):
"""
Search for VLSS, WENSS and NVSS sources that
"""
Search for VLSS, WENSS and NVSS sources that
are in the given FoV. The FoV is set by its central position
are in the given FoV. The FoV is set by its central position
(ra_central, decl_central) out to a radius of fov_radius.
(ra_central, decl_central) out to a radius of fov_radius.
...
@@ -23,11 +19,25 @@ def expected_fluxes_in_fov(conn, ra_central, decl_central, fov_radius, assoc_the
...
@@ -23,11 +19,25 @@ def expected_fluxes_in_fov(conn, ra_central, decl_central, fov_radius, assoc_the
All units are in degrees.
All units are in degrees.
deruiter_radius is a measure for the association uncertainty that takes
position errors into account (see thesis Bart Scheers). If not given
as a positive value, it is read from the TKP config file. If not
available, it defaults to 3.717.
The query returns all vlss sources (id) that are in the FoV.
The query returns all vlss sources (id) that are in the FoV.
If so, the counterparts from other catalogues are returned as well
If so, the counterparts from other catalogues are returned as well
(also their ids).
(also their ids).
"""
"""
DERUITER_R
=
deruiter_radius
if
DERUITER_R
<=
0
:
try
:
from
tkp.config
import
config
DERUITER_R
=
config
[
'
source_association
'
][
'
deruiter_radius
'
]
print
"
DERUITER_R =
"
,
DERUITER_R
except
:
DERUITER_R
=
3.717
if
ra_central
+
alpha
(
fov_radius
,
decl_central
)
>
360
:
if
ra_central
+
alpha
(
fov_radius
,
decl_central
)
>
360
:
"
This will be implemented soon
"
"
This will be implemented soon
"
raise
BaseException
(
"
ra = %s > 360 degrees, not implemented yet
"
%
str
(
ra_central
+
alpha
(
fov_radius
,
decl_central
)))
raise
BaseException
(
"
ra = %s > 360 degrees, not implemented yet
"
%
str
(
ra_central
+
alpha
(
fov_radius
,
decl_central
)))
...
...
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