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
5714d6fe
Commit
5714d6fe
authored
9 years ago
by
Adriaan Renting
Browse files
Options
Downloads
Patches
Plain Diff
Task #8886: Started adding first functions to update status and start/end times
parent
7099f39d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py
+66
-0
66 additions, 0 deletions
...ent/RAtoOTDBTaskSpecificationPropagator/lib/translator.py
with
67 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
5714d6fe
...
@@ -4955,6 +4955,7 @@ SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/__init__.py -text
...
@@ -4955,6 +4955,7 @@ SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/__init__.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/config.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/config.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/propagator.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/propagator.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/rotspservice.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/rotspservice.py -text
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py -text
SAS/ResourceAssignment/ResourceAssigner/CMakeLists.txt -text
SAS/ResourceAssignment/ResourceAssigner/CMakeLists.txt -text
SAS/ResourceAssignment/ResourceAssigner/bin/CMakeLists.txt -text
SAS/ResourceAssignment/ResourceAssigner/bin/CMakeLists.txt -text
SAS/ResourceAssignment/ResourceAssigner/bin/resourceassigner -text
SAS/ResourceAssignment/ResourceAssigner/bin/resourceassigner -text
...
...
This diff is collapsed.
Click to expand it.
SAS/ResourceAssignment/RAtoOTDBTaskSpecificationPropagator/lib/translator.py
0 → 100755
+
66
−
0
View file @
5714d6fe
#!/usr/bin/env python
# Copyright (C) 2015
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
#
# $Id: assignment.py 1580 2015-09-30 14:18:57Z loose $
"""
RAtoOTDBTaskSpecificationPropagator gets a task to be scheduled in OTDB,
reads the info from the RA DB and sends it to OTDB in the correct format.
"""
import
logging
from
datetime
import
datetime
import
time
from
lofar.messaging.RPC
import
RPC
,
RPCException
from
lofar.parameterset
import
parameterset
from
lofar.sas.resourceassignment.rotspservice.rpc
import
RARPC
from
lofar.sas.resourceassignment.rotspservice.config
import
DEFAULT_BUSNAME
as
RADB_BUSNAME
from
lofar.sas.resourceassignment.rotspservice.config
import
DEFAULT_SERVICENAME
as
RADB_SERVICENAME
from
lofar.sas.otdb.otdbservice.config
import
DEFAULT_BUSNAME
as
OTDB_BUSNAME
from
lofar.sas.otdb.otdbservice.config
import
DEFAULT_SERVICENAME
as
OTDB_SERVICENAME
logger
=
logging
.
getLogger
(
__name__
)
class
RAtoOTDBTranslator
():
def
__init__
(
self
):
"""
RAtoOTDBTranslator translates values from the RADB into parset keys
"""
def
doTranslation
(
self
,
otdbId
,
momId
,
RAinfo
):
logger
.
info
(
'
doTranslation: start=%s, stop=%s
'
%
(
RAinfo
[
'
startTime
'
],
RAinfo
[
'
stopTime
'
]))
#parse main parset...
mainParsetDict
=
parsets
[
str
(
sasId
)]
parset
=
parameterset
()
momId
=
parset
.
add
(
'
Observation.momID
'
,
momId
)
if
stations
in
RAinfo
:
parset
.
add
(
'
Observation.VirtualInstrument.stationList
'
,
stations
)
startTime
=
datetime
.
strptime
(
mainParset
.
getString
(
'
Observation.startTime
'
),
'
%Y-%m-%d %H:%M:%S
'
)
endTime
=
datetime
.
strptime
(
mainParset
.
getString
(
'
Observation.stopTime
'
),
'
%Y-%m-%d %H:%M:%S
'
)
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