diff --git a/.gitattributes b/.gitattributes index 0a2c275f22a5f89a581de17738dbfeea34577789..5cae2e0d5626a17886d8445b423054530b1bafcd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1792,6 +1792,26 @@ Docker/lofar-pulp/sudoers -text Docker/lofar-tbbwriter/Dockerfile -text Docker/lofar-tbbwriter/bashrc -text Docker/lofar-tbbwriter/chuser.sh -text +Docker/lofar-triggerservices/Dockerfile -text +Docker/lofar-triggerservices/bld.yaml -text +Docker/lofar-triggerservices/build.ini -text +Docker/lofar-triggerservices/hosts -text +Docker/lofar-triggerservices/mom.ini -text +Docker/lofar-triggerservices/momdb_init.sql -text +Docker/lofar-triggerservices/roles/buildhostcentos7/.travis.yml -text +Docker/lofar-triggerservices/roles/buildhostcentos7/README.md -text +Docker/lofar-triggerservices/roles/buildhostcentos7/defaults/main.yml -text +Docker/lofar-triggerservices/roles/buildhostcentos7/files/nsswitch.conf -text +Docker/lofar-triggerservices/roles/buildhostcentos7/files/ssh-rsa -text +Docker/lofar-triggerservices/roles/buildhostcentos7/files/zabbix_agentd.conf -text +Docker/lofar-triggerservices/roles/buildhostcentos7/handlers/main.yml -text +Docker/lofar-triggerservices/roles/buildhostcentos7/meta/main.yml -text +Docker/lofar-triggerservices/roles/buildhostcentos7/tasks/main.yml -text +Docker/lofar-triggerservices/roles/buildhostcentos7/templates/ntp.conf.j2 -text +Docker/lofar-triggerservices/roles/buildhostcentos7/tests/inventory -text +Docker/lofar-triggerservices/roles/buildhostcentos7/tests/test.yml -text +Docker/lofar-triggerservices/roles/buildhostcentos7/vars/main.yml -text +Docker/lofar-triggerservices/startup.sh -text JAVA/GUI/Plotter/dist/lib/sgt.jar -text svneol=unset#unset JAVA/GUI/Plotter/doc/Plotter.EAP -text JAVA/GUI/Plotter/doc/javadoc/resources/inherit.gif -text @@ -4558,9 +4578,9 @@ SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice -text SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice.ini -text SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice.py -text SAS/MoM/MoMQueryService/test/CMakeLists.txt -text -SAS/MoM/MoMQueryService/test/test_momqueryservice.py -text -SAS/MoM/MoMQueryService/test/test_momqueryservice.run -text -SAS/MoM/MoMQueryService/test/test_momqueryservice.sh -text +SAS/MoM/MoMQueryService/test/t_momqueryservice.py -text +SAS/MoM/MoMQueryService/test/t_momqueryservice.run -text +SAS/MoM/MoMQueryService/test/t_momqueryservice.sh -text SAS/OTB/OTB-distribution/assembly.xml -text SAS/OTB/OTB-distribution/pom.xml -text SAS/OTB/OTB/assembly.xml -text @@ -5294,29 +5314,31 @@ SAS/SpecificationServices/lib/validation_service.py -text SAS/SpecificationServices/lib/validation_service_rpc.py -text SAS/SpecificationServices/test/CMakeLists.txt -text SAS/SpecificationServices/test/frombus.py -text +SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml -text +SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml -text +SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.py -text +SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.run -text +SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.sh -text +SAS/SpecificationServices/test/t_specification_service.py -text +SAS/SpecificationServices/test/t_specification_service.run -text +SAS/SpecificationServices/test/t_specification_service.sh -text SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.in_xml/telescope_model_xml_generator_type1.xml -text SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py -text SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.run -text SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.sh -text +SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1-minmax.xml -text +SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1.xml -text +SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar-minmax.xml -text +SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar.xml -text +SAS/SpecificationServices/test/t_translation_service.py -text +SAS/SpecificationServices/test/t_translation_service.run -text +SAS/SpecificationServices/test/t_translation_service.sh -text SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-lofar.xml -text SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-mom.xml -text SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-trigger.xml -text SAS/SpecificationServices/test/t_validation_service.py -text SAS/SpecificationServices/test/t_validation_service.run -text SAS/SpecificationServices/test/t_validation_service.sh -text -SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml -text -SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml -text -SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.py -text -SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.run -text -SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.sh -text -SAS/SpecificationServices/test/test_specification_service.py -text -SAS/SpecificationServices/test/test_specification_service.run -text -SAS/SpecificationServices/test/test_specification_service.sh -text -SAS/SpecificationServices/test/test_translation_service.in_xml/telescope_model_xml_generator_type1.xml -text -SAS/SpecificationServices/test/test_translation_service.in_xml/type-1-lofar.xml -text -SAS/SpecificationServices/test/test_translation_service.py -text -SAS/SpecificationServices/test/test_translation_service.run -text -SAS/SpecificationServices/test/test_translation_service.sh -text SAS/SpecificationServices/xml/CMakeLists.txt -text SAS/SpecificationServices/xml/telescope_model_type1_template.xml -text SAS/SpecificationServices/xml/telescope_model_type2_template.xml -text diff --git a/Docker/lofar-triggerservices/Dockerfile b/Docker/lofar-triggerservices/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7af649458e23cc35516f64e805661d62a3409ffe --- /dev/null +++ b/Docker/lofar-triggerservices/Dockerfile @@ -0,0 +1,69 @@ +# This docker needs a ./LOFAR/ directory with the software stack to build. +# +# For a local mom database, a momdb_init.sql is required. +# For momqueryservice, a mom.ini has to be present +# For mom-otdb-adapter, a custom config directory has to be present +# +# Further, startup.sh as an entry point for the docker +# +# +# Furthermore, a hostname should be used by the container which CMake can use to +# lookup the corresponding variants file. This is done by running the container +# with: +# -h lofarbuildandtestdocker +# +# +# The rest interface on port 8000 has to be exposed in order to access it on localhost. + +# Complete usage example: +# +# docker build -t lofarbuildandtestdocker . +# docker run -h lofarbuildandtestdocker -it -p 8000:8000 -p 5672:5672 lofarbuildandtestdocker:latest + +# Note: centos/systemd depends on centos7 +FROM centos/systemd +MAINTAINER "Joern Kuensemoeller" - This is based on Ruud Beukema's work + +RUN systemctl enable dbus.service + +# ------------------------------------------------------------------------------------- +# Install packages required by Ansible +RUN yum -y install python-yaml python-jinja2 git + +# ------------------------------------------------------------------------------------- +# Download Ansible and set paths +RUN mkdir -p /opt/ansible +RUN git clone http://github.com/ansible/ansible.git /opt/ansible + +ENV PATH /opt/ansible/bin:/sbin:/usr/sbin:/usr/bin +ENV ANSIBLE_LIBRARY /opt/ansible/library +ENV PYTHONPATH /opt/ansible/lib:$PYTHON_PATH + +# Place LOFAR stack in Container for RT-Task10875, so ansible can build packages +COPY LOFAR /opt/LOFAR +COPY momdb_init.sql / +COPY mom.ini /root/.lofar/dbcredentials/ +COPY build.ini / + +# Inject Ansible playbook and run it +RUN mkdir -p /etc/ansible +COPY roles /etc/ansible +COPY hosts /etc/ansible +COPY bld.yaml /etc/ansible + +RUN ansible-playbook -v /etc/ansible/bld.yaml -c local + +# Try to reduce the image size +RUN yum clean all + +# Give user SSH and local access (with set locale) +EXPOSE 22 3000 +EXPOSE 8000 +EXPOSE 5672 + +# Copy startup script as entry point (sets up queues and starts services) +COPY startup.sh / +CMD /bin/bash /startup.sh + + + diff --git a/Docker/lofar-triggerservices/bld.yaml b/Docker/lofar-triggerservices/bld.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c1765e615f7209c2c1b039b03175195c7a803564 --- /dev/null +++ b/Docker/lofar-triggerservices/bld.yaml @@ -0,0 +1,4 @@ +- hosts: local + user: root + roles: + - buildhostcentos7 diff --git a/Docker/lofar-triggerservices/build.ini b/Docker/lofar-triggerservices/build.ini new file mode 100644 index 0000000000000000000000000000000000000000..00aabe99bc0b3b54ca7c4245a21ab32a7a5a2b57 --- /dev/null +++ b/Docker/lofar-triggerservices/build.ini @@ -0,0 +1,3 @@ +[restinterface] + +secret_key=<redacted> diff --git a/Docker/lofar-triggerservices/hosts b/Docker/lofar-triggerservices/hosts new file mode 100644 index 0000000000000000000000000000000000000000..8bb7ba6b33ab7850e5679373027806b0b4187c18 --- /dev/null +++ b/Docker/lofar-triggerservices/hosts @@ -0,0 +1,2 @@ +[local] +localhost diff --git a/Docker/lofar-triggerservices/mom.ini b/Docker/lofar-triggerservices/mom.ini new file mode 100644 index 0000000000000000000000000000000000000000..eb88058bb6134931782919f6bb82b33ffdb03112 --- /dev/null +++ b/Docker/lofar-triggerservices/mom.ini @@ -0,0 +1,10 @@ +[database:MoM] +type = mysql +host = mysqltest1.control.lofar +user = <redacted> +password = <redacted> +database = lofar_mom_test_rt_trigger + +useradministration_database = lofar_mom_test_rt_trigger_useradmin +momprivilege_database = lofar_mom_test_rt_trigger_privileges + diff --git a/Docker/lofar-triggerservices/momdb_init.sql b/Docker/lofar-triggerservices/momdb_init.sql new file mode 100644 index 0000000000000000000000000000000000000000..b8488d6d38ec29307f3843f5cb62853d12fda180 --- /dev/null +++ b/Docker/lofar-triggerservices/momdb_init.sql @@ -0,0 +1,25 @@ +CREATE DATABASE useradministration; +CREATE TABLE useradministration.useraccount ( id int(11) NOT NULL AUTO_INCREMENT, userid int(11) NOT NULL DEFAULT '0', username varchar(20) NOT NULL DEFAULT '', password varchar(32) NOT NULL DEFAULT '', publickey varchar(32) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY useraccount_UNIQ (username) ) ENGINE=InnoDB AUTO_INCREMENT=1787 DEFAULT CHARSET=latin1; +CREATE TABLE useradministration.useraccountsystemrole (id int(11) NOT NULL AUTO_INCREMENT, useraccountid int(11) NOT NULL DEFAULT '0', systemroleid int(11) NOT NULL DEFAULT '0', indexid int(11) NOT NULL DEFAULT '0', PRIMARY KEY (id), KEY useraccount_useraccountsystemrole_IND (useraccountid), KEY systemrole_useraccountsystemrole_IND (systemroleid), KEY useraccount_index_useraccountsystemrole_IND (indexid) ) ENGINE=InnoDB AUTO_INCREMENT=3413 DEFAULT CHARSET=latin1; +CREATE TABLE useradministration.user ( id int(11) NOT NULL AUTO_INCREMENT, title varchar(100) DEFAULT NULL, firstname varchar(100) DEFAULT NULL, lastname varchar(100) NOT NULL DEFAULT '', email varchar(100) DEFAULT NULL, phone1 varchar(100) DEFAULT NULL, phone2 varchar(100) DEFAULT NULL, fax varchar(100) DEFAULT NULL, PRIMARY KEY (id), KEY user_lastname_IND (lastname) ) ENGINE=InnoDB AUTO_INCREMENT=1790 DEFAULT CHARSET=latin1; +# mom database +CREATE DATABASE mom; +USE mom; +CREATE TABLE mom2objectstatus ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(255) DEFAULT NULL, roles varchar(512) DEFAULT NULL, userid int(11) DEFAULT NULL, statusid int(11) DEFAULT NULL, mom2objectid int(11) DEFAULT NULL, indexid int(11) DEFAULT NULL, statustime datetime NOT NULL DEFAULT '1000-01-01 00:00:00.000000', pending tinyint(1) DEFAULT 0, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=1725902 DEFAULT CHARSET=latin1; +CREATE TABLE mom2object (id int(11) NOT NULL AUTO_INCREMENT, parentid int(11) DEFAULT NULL, indexid int(11) DEFAULT NULL, mom2id int(11) NOT NULL DEFAULT 0, mom2objecttype char(25) NOT NULL, name varchar(100) NOT NULL DEFAULT '', description varchar(255) DEFAULT NULL, ownerprojectid int(11) DEFAULT NULL, currentstatusid int(11) DEFAULT NULL, topology varchar(100) DEFAULT NULL, predecessor varchar(512) DEFAULT NULL, topology_parent tinyint(1) DEFAULT 0, group_id int(11) DEFAULT 0, datasize bigint(20) DEFAULT 0, PRIMARY KEY (id), UNIQUE KEY mom2object_UNIQ (mom2id) ) ENGINE=InnoDB AUTO_INCREMENT=331855 DEFAULT CHARSET=latin1; +CREATE TABLE status (id int(11) NOT NULL AUTO_INCREMENT, code char(15) NOT NULL DEFAULT '', type char(20) NOT NULL, description varchar(100) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY status_UNIQ (code,type) ) ENGINE=InnoDB AUTO_INCREMENT=712 DEFAULT CHARSET=latin1; +CREATE TABLE member ( id int(11) NOT NULL AUTO_INCREMENT, projectid int(11) DEFAULT NULL, indexid int(11) DEFAULT NULL, PRIMARY KEY (id), KEY mom2object_member_FK (projectid), KEY indexid_IND (indexid) ) ENGINE=InnoDB AUTO_INCREMENT=1010 DEFAULT CHARSET=latin1; +CREATE TABLE registeredmember ( id int(11) NOT NULL AUTO_INCREMENT, memberid int(11) DEFAULT NULL, userid int(11) DEFAULT NULL, PRIMARY KEY (id), KEY member_registeredmember_FK (memberid), KEY userid_IND (userid) ) ENGINE=InnoDB AUTO_INCREMENT=768 DEFAULT CHARSET=latin1; +CREATE TABLE memberprojectrole ( id int(11) NOT NULL AUTO_INCREMENT, memberid int(11) DEFAULT NULL, indexid int(11) DEFAULT NULL, projectroleid int(11) DEFAULT NULL, PRIMARY KEY (id), KEY member_memberprojectrole_FK (memberid), KEY projectrole_memberprojectrole_FK (projectroleid), KEY indexid_IND (indexid) ) ENGINE=InnoDB AUTO_INCREMENT=1167 DEFAULT CHARSET=latin1; +CREATE TABLE projectrole ( id int(11) NOT NULL AUTO_INCREMENT, name char(15) NOT NULL DEFAULT '', description varchar(100) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY projectrole_UNIQ (name) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; +CREATE TABLE project ( id int(11) NOT NULL AUTO_INCREMENT, mom2objectid int(11) DEFAULT NULL, releasedate date DEFAULT NULL, PRIMARY KEY (id), KEY mom2object_IND (mom2objectid) ) ENGINE=InnoDB AUTO_INCREMENT=149 DEFAULT CHARSET=latin1; +ALTER TABLE project ADD allowtriggers BOOLEAN NOT NULL DEFAULT FALSE AFTER releasedate, ADD priority int(11) NOT NULL DEFAULT 1000 AFTER allowtriggers; +CREATE TABLE lofar_trigger ( id int(11) NOT NULL AUTO_INCREMENT, username varchar(120) NOT NULL DEFAULT '', hostname varchar(128) NOT NULL DEFAULT '', arrivaltime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, projectname varchar(100) NOT NULL DEFAULT '', metadata TEXT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (username) REFERENCES useradministration.useraccount(username)) ; +CREATE TABLE lofar_observation ( id int(11) NOT NULL AUTO_INCREMENT, mom2objectid int(11) DEFAULT NULL, observation_id int(11) DEFAULT NULL, instrument char(32) DEFAULT NULL, user_specification_id int(11) DEFAULT NULL, system_specification_id int(11) DEFAULT NULL,default_template varchar(50) DEFAULT NULL,tbb_template varchar(50) DEFAULT NULL,tbb_piggyback_allowed tinyint(1) DEFAULT '0',parset mediumtext,nr_output_correlated int(11) DEFAULT NULL,nr_output_beamformed int(11) DEFAULT NULL,nr_output_coherent_stokes int(11) DEFAULT NULL,nr_output_incoherent_stokes int(11) DEFAULT NULL,nr_output_flyseye int(11) DEFAULT NULL,nr_output_correlated_valid int(11) DEFAULT NULL,nr_output_beamformed_valid int(11) DEFAULT NULL,nr_output_coherent_stokes_valid int(11) DEFAULT NULL,nr_output_incoherent_stokes_valid int(11) DEFAULT NULL,nr_output_flyseye_valid int(11) DEFAULT NULL,feedback text,aartfaac_piggyback_allowed bit(1) DEFAULT b'1',storage_cluster_id int(11) DEFAULT NULL,processing_cluster_id int(11) DEFAULT NULL,nico_testing int(11) DEFAULT NULL,PRIMARY KEY (id),KEY lofar_observation_observation_id_IND (observation_id),KEY mom2object_lofar_observation_FK (mom2objectid),KEY user_specification_lofar_observation_FK (user_specification_id),KEY system_specification_lofar_observation_FK (system_specification_id)) ENGINE=InnoDB AUTO_INCREMENT=52874 DEFAULT CHARSET=latin1; +CREATE TABLE lofar_observation_specification (id int(11) NOT NULL AUTO_INCREMENT,type char(8) DEFAULT NULL,correlated_data tinyint(1) DEFAULT '1',filtered_data tinyint(1) DEFAULT '0',beamformed_data tinyint(1) DEFAULT '0',coherent_stokes_data tinyint(1) DEFAULT '0',incoherent_stokes_data tinyint(1) DEFAULT '0',antenna char(20) DEFAULT NULL,clock_mode char(10) DEFAULT NULL,instrument_filter char(15) DEFAULT NULL,integration_interval double DEFAULT NULL,channels_per_subband int(11) DEFAULT NULL,cn_integration_steps int(11) DEFAULT NULL,pencilbeams_flyseye tinyint(1) DEFAULT '0',pencilbeams_nr_pencil_rings int(11) DEFAULT NULL,pencilbeams_ring_size double DEFAULT NULL,stokes_selection char(4) DEFAULT NULL,stokes_integrate_channels tinyint(1) DEFAULT NULL,stokes_integration_steps int(11) unsigned DEFAULT NULL,station_set char(15) DEFAULT NULL,timeframe char(4) DEFAULT NULL,starttime datetime DEFAULT NULL,endtime datetime DEFAULT NULL,spec_duration double DEFAULT NULL,coherent_dedisperse_channels tinyint(1) DEFAULT '0',dispersion_measure float DEFAULT NULL,subbands_per_file_cs int(11) DEFAULT NULL,subbands_per_file_bf int(11) DEFAULT NULL,collapsed_channels_cs int(11) DEFAULT NULL,collapsed_channels_is int(11) DEFAULT NULL,downsampling_steps_cs int(11) DEFAULT NULL,downsampling_steps_is int(11) DEFAULT NULL,which_cs char(4) DEFAULT NULL,which_is char(4) DEFAULT NULL,bypass_pff tinyint(1) DEFAULT '0',enable_superterp tinyint(1) DEFAULT '0',flyseye tinyint(1) DEFAULT '0',tab_nr_rings int(11) DEFAULT NULL,tab_ring_size float DEFAULT NULL,bits_per_sample int(11) DEFAULT NULL,misc text,PRIMARY KEY (id),KEY lofar_observation_specification_type_IND (type)) ENGINE=InnoDB AUTO_INCREMENT=105645 DEFAULT CHARSET=latin1; +CREATE TABLE lofar_pipeline (id int(11) NOT NULL AUTO_INCREMENT,mom2objectid int(11) DEFAULT NULL,starttime datetime DEFAULT NULL,endtime datetime DEFAULT NULL,pipeline_id int(11) DEFAULT NULL,pending tinyint(1) DEFAULT '0',template varchar(100) DEFAULT NULL,runtimeDirectory varchar(255) DEFAULT NULL,resultDirectory varchar(255) DEFAULT NULL,workingDirectory varchar(255) DEFAULT NULL,parset longtext,nr_output_correlated int(11) DEFAULT NULL,nr_output_beamformed int(11) DEFAULT NULL,nr_output_instrument_model int(11) DEFAULT NULL,nr_output_skyimage int(11) DEFAULT NULL,nr_output_correlated_valid int(11) DEFAULT NULL,nr_output_beamformed_valid int(11) DEFAULT NULL,nr_output_instrument_model_valid int(11) DEFAULT NULL,nr_output_skyimage_valid int(11) DEFAULT NULL,feedback text,demixing_parameters_id int(11) DEFAULT NULL,bbs_parameters_id int(11) DEFAULT NULL,duration double DEFAULT NULL,storage_cluster_id int(11) DEFAULT NULL,processing_cluster_id int(11) DEFAULT NULL,misc text,PRIMARY KEY (id),KEY lofar_pipeline_pipeline_id_IND (pipeline_id),KEY mom2object_lofar_pipeline_FK (mom2objectid),KEY demixing_parameters_FK (demixing_parameters_id),KEY bbs_parameters_FK (bbs_parameters_id)) ENGINE=InnoDB AUTO_INCREMENT=75471 DEFAULT CHARSET=latin1; +# mom privilege +CREATE DATABASE momprivilege; +CREATE TABLE momprivilege.statustransitionrole ( id int(11) NOT NULL AUTO_INCREMENT, statustransitionid int(11) DEFAULT NULL, roleid int(11) NOT NULL, roletype char(100) NOT NULL, PRIMARY KEY (id), KEY roletype_IND (roleid,roletype), KEY statustransition_statustransitionrole_FK (statustransitionid) ) ENGINE=InnoDB AUTO_INCREMENT=8572 DEFAULT CHARSET=latin1; +CREATE TABLE momprivilege.statustransition (id int(11) NOT NULL AUTO_INCREMENT, oldstatusid int(11) NOT NULL, newstatusid int(11) NOT NULL, PRIMARY KEY (id), KEY oldstatus_IND (oldstatusid), KEY newstatus_IND (oldstatusid) ) ENGINE=InnoDB AUTO_INCREMENT=1272 DEFAULT CHARSET=latin1; + diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/.travis.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..36bbf6208cfd42ac91bfbe7f9126bc9044e186c6 --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/.travis.yml @@ -0,0 +1,29 @@ +--- +language: python +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install ansible +addons: + apt: + packages: + - python-pip + +install: + # Install ansible + - pip install ansible + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=../' >ansible.cfg + +script: + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/README.md b/Docker/lofar-triggerservices/roles/buildhostcentos7/README.md new file mode 100644 index 0000000000000000000000000000000000000000..225dd44b9fc5b3abff7e9c68ff9e91d505cdd5f0 --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/defaults/main.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e717aa8758a8659aec4781755fa7380061aae18d --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for buildhostcentos7 diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/files/nsswitch.conf b/Docker/lofar-triggerservices/roles/buildhostcentos7/files/nsswitch.conf new file mode 100644 index 0000000000000000000000000000000000000000..d6e065d2d1f90c35267d099ca9da2c4f81665753 --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/files/nsswitch.conf @@ -0,0 +1,13 @@ +passwd: compat +group: compat +shadow: compat + +hosts: files dns +networks: files + +protocols: db files +services: db files +ethers: db files +rpc: db files + +netgroup: nis diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/files/ssh-rsa b/Docker/lofar-triggerservices/roles/buildhostcentos7/files/ssh-rsa new file mode 100644 index 0000000000000000000000000000000000000000..4605b2ec6fbccb436bcabb2b9a58ba6585404afb --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/files/ssh-rsa @@ -0,0 +1,28 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEoQIBAAKCAQEAvjh5nLoHimZ8ZZIWEdFLaS6sfA5ZjTy+7WY+qNCFPhWxThDr +bCAuNRD4tkQoUGwZzlJrLVkF0ITq5rLz0NNRCqVBOt9NJfhVkybjnNxyvkMaIUUF +AnXGJ1+izRwB/PIC8yRS9qYu+in+Y/TymvjxtV56sLgvkw2O+5mX6juc5x0y+2qU +fRLCaSHfd3k7cGyBvcpNoHTiRMPdrXhkuMsANLoMvbu6VSaXwOw4nI8NeiURuhGL +Thq27lDJk9MgjqYu3aNGGIwC2Pr9y/iE2S80VTwNZi1Mc8uc8nHH4bFuEECMayFt +Qc2Yx9CTIOhmLrRZN8IfIbLpTHUGtx7NxE0D4QIBIwKCAQBBN+8ua6rQXab+QLcc +DT5tNJLotHZ5kSuEmBV7tTT/V+UE0pnb7cazG8L8qadsB85VXhYeLSaQopmuLrn+ +dFZMyvHLCrtdebbwn55+7H8cqUrJlAG3s1nhnSHf7Fhz+zQ2GxUhXYxzBxVkGXfA +GtaHU5fHj5tIXGuJdn06XZThhcLBiXIUfaIN97bCoAZ481TafxwXNZi+d037JP/t +7tzP6OGJbdqypVEcxP1IbWjDvb8rDHDZcBEexWoy6JB1ru8m52lucYau2sVYadt/ +WMVJpH1vJZJjbgGWn0XXlZrgjWQZV1tPA1qdD9sg6k0RuzGjiNZ01VsN1fx83ib9 +edxLAoGBAPBEwraju/A0xJ4g3If1chmplX9CRDeL2WzzQIH1Kp+e99xs+uweDNb6 +oOuolrqQ1pqG7fSRqrgvTo+4zWZGDEd2skvWpruaRgcIrt27wZ1vePS5HQcVFdy+ +0slVZRStYKkNAZgjiQVCz5TFMgr3b3O0l9OIs2Ceobpzr5kjpke1AoGBAMqs1vvI +PbmLoBb0SfXvigXsQhHFKa04DnfzC/hNp7HiBZ5/6xBYt5QyYhTguTauZQmgP02X +k8zP7RlxNL+cBliKzga/xNPAtuHWv5GUqqzO+KrTjVpnX5Dm+R2CLVWpQ39pi7V3 +0CCQPWnmYE/DjZS7hdoZkT8azdaB50LoA079AoGAdLOvCEDmQXi3RX2s8ZR5P6ok +CpyHiLGkHvnO4Ald2IBpwtXY9le9F/YTpamoS/01CTo5EGQCdrfkVG+0OP1zra6u +X1mhcRBrJ/znOH/EcQpCEHcrWzYgj8pmYcpkS98u8wZRO0R1wLoNDb7dys/0TiSE +Qix0YiEp+3oE1Vp1VgcCgYEAivotBGwNEYRQhMTFAGm9uusl/Y6C+m+U5IlnSy3v +VWfJVr4dh41KrsN2dLdabqN4e6EVdwjaYI6T9DBer0ZqwF8uMIN/pyUPsM3FMKB1 +CMhwABwJKAxeycLz9vottxT7FYoz6iZFkqwM2ucdeIYX8PWdnN5U+BJhQqI4LeDs +U2sCgYA94BGiA+Smqp2QZ7o2c5X7QZ+rd3iPs2Wn5owoZJJCISSzSV3tQ+YakZC6 +oi4IXq5XpAqni4gHADqpZUDSGxoEnaznKFJnrxwLsCwhBaVEfR3aLEOK3ojg48sr +laFEjoXmsJEepp5cOkQOtXrKIhVu5e4O3VW1/60+80OGd8aAAg== +-----END RSA PRIVATE KEY----- + diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/files/zabbix_agentd.conf b/Docker/lofar-triggerservices/roles/buildhostcentos7/files/zabbix_agentd.conf new file mode 100644 index 0000000000000000000000000000000000000000..9f17a7b2696cf18602a7918aea689af8a2cdd8ae --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/files/zabbix_agentd.conf @@ -0,0 +1,287 @@ +# This is a config file for the Zabbix agent daemon (Unix) +# To get more information about Zabbix, visit http://www.zabbix.com + +############ GENERAL PARAMETERS ################# + +### Option: PidFile +# Name of PID file. +# +# Mandatory: no +# Default: +PidFile=/run/zabbix/zabbix_agentd.pid + +### Option: LogFile +# Name of log file. +# If not set, syslog is used. +# +# Mandatory: no +# Default: +# LogFile= + +LogFile=/var/log/zabbix/zabbix_agentd.log + +### Option: LogFileSize +# Maximum size of log file in MB. +# 0 - disable automatic log rotation. +# +# Mandatory: no +# Range: 0-1024 +# Default: +LogFileSize=0 + +### Option: DebugLevel +# Specifies debug level +# 0 - no debug +# 1 - critical information +# 2 - error information +# 3 - warnings +# 4 - for debugging (produces lots of information) +# +# Mandatory: no +# Range: 0-4 +# Default: +# DebugLevel=3 + +### Option: SourceIP +# Source IP address for outgoing connections. +# +# Mandatory: no +# Default: +# SourceIP= + +### Option: EnableRemoteCommands +# Whether remote commands from Zabbix server are allowed. +# 0 - not allowed +# 1 - allowed +# +# Mandatory: no +# Default: +# EnableRemoteCommands=0 + +### Option: LogRemoteCommands +# Enable logging of executed shell commands as warnings. +# 0 - disabled +# 1 - enabled +# +# Mandatory: no +# Default: +# LogRemoteCommands=0 + +##### Passive checks related + +### Option: Server +# List of comma delimited IP addresses (or hostnames) of Zabbix servers. +# Incoming connections will be accepted only from the hosts listed here. +# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally. +# +# Mandatory: no +# Default: +# Server= + +Server=10.149.64.103 + +### Option: ListenPort +# Agent will listen on this port for connections from the server. +# +# Mandatory: no +# Range: 1024-32767 +# Default: +# ListenPort=10050 + +### Option: ListenIP +# List of comma delimited IP addresses that the agent should listen on. +# First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks. +# +# Mandatory: no +# Default: +# ListenIP=0.0.0.0 + +### Option: StartAgents +# Number of pre-forked instances of zabbix_agentd that process passive checks. +# If set to 0, disables passive checks and the agent will not listen on any TCP port. +# +# Mandatory: no +# Range: 0-100 +# Default: +# StartAgents=3 + +##### Active checks related + +### Option: ServerActive +# List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks. +# If port is not specified, default port is used. +# IPv6 addresses must be enclosed in square brackets if port for that host is specified. +# If port is not specified, square brackets for IPv6 addresses are optional. +# If this parameter is not specified, active checks are disabled. +# Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1] +# +# Mandatory: no +# Default: +# ServerActive= + +ServerActive=10.149.64.103 + +### Option: Hostname +# Unique, case sensitive hostname. +# Required for active checks and must match hostname as configured on the server. +# Value is acquired from HostnameItem if undefined. +# +# Mandatory: no +# Default: +# Hostname= + +Hostname=Zabbix server + +### Option: HostnameItem +# Item used for generating Hostname if it is undefined. Ignored if Hostname is defined. +# Does not support UserParameters or aliases. +# +# Mandatory: no +# Default: +# HostnameItem=system.hostname + +### Option: HostMetadata +# Optional parameter that defines host metadata. +# Host metadata is used at host auto-registration process. +# An agent will issue an error and not start if the value is over limit of 255 characters. +# If not defined, value will be acquired from HostMetadataItem. +# +# Mandatory: no +# Range: 0-255 characters +# Default: +# HostMetadata= + +### Option: HostMetadataItem +# Optional parameter that defines an item used for getting host metadata. +# Host metadata is used at host auto-registration process. +# During an auto-registration request an agent will log a warning message if +# the value returned by specified item is over limit of 255 characters. +# This option is only used when HostMetadata is not defined. +# +# Mandatory: no +# Default: +# HostMetadataItem= + +### Option: RefreshActiveChecks +# How often list of active checks is refreshed, in seconds. +# +# Mandatory: no +# Range: 60-3600 +# Default: +# RefreshActiveChecks=120 + +### Option: BufferSend +# Do not keep data longer than N seconds in buffer. +# +# Mandatory: no +# Range: 1-3600 +# Default: +# BufferSend=5 + +### Option: BufferSize +# Maximum number of values in a memory buffer. The agent will send +# all collected data to Zabbix Server or Proxy if the buffer is full. +# +# Mandatory: no +# Range: 2-65535 +# Default: +# BufferSize=100 + +### Option: MaxLinesPerSecond +# Maximum number of new lines the agent will send per second to Zabbix Server +# or Proxy processing 'log' and 'logrt' active checks. +# The provided value will be overridden by the parameter 'maxlines', +# provided in 'log' or 'logrt' item keys. +# +# Mandatory: no +# Range: 1-1000 +# Default: +# MaxLinesPerSecond=100 + +############ ADVANCED PARAMETERS ################# + +### Option: Alias +# Sets an alias for an item key. It can be used to substitute long and complex item key with a smaller and simpler one. +# Multiple Alias parameters may be present. Multiple parameters with the same Alias key are not allowed. +# Different Alias keys may reference the same item key. +# For example, to retrieve the ID of user 'zabbix': +# Alias=zabbix.userid:vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,,,\1] +# Now shorthand key zabbix.userid may be used to retrieve data. +# Aliases can be used in HostMetadataItem but not in HostnameItem parameters. +# +# Mandatory: no +# Range: +# Default: + +### Option: Timeout +# Spend no more than Timeout seconds on processing +# +# Mandatory: no +# Range: 1-30 +# Default: +# Timeout=3 +Timeout=5 + +### Option: AllowRoot +# Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent +# will try to switch to user 'zabbix' instead. Has no effect if started under a regular user. +# 0 - do not allow +# 1 - allow +# +# Mandatory: no +# Default: +# AllowRoot=0 + +### Option: Include +# You may include individual files or all files in a directory in the configuration file. +# Installing Zabbix will create include directory in /etc, unless modified during the compile time. +# +# Mandatory: no +# Default: +# Include= + +# Include=/etc/zabbix_agentd.userparams.conf +# Include=/etc/zabbix_agentd.conf.d/ + +####### USER-DEFINED MONITORED PARAMETERS ####### + +### Option: UnsafeUserParameters +# Allow all characters to be passed in arguments to user-defined parameters. +# 0 - do not allow +# 1 - allow +# +# Mandatory: no +# Range: 0-1 +# Default: +# UnsafeUserParameters=0 + +### Option: UserParameter +# User-defined parameter to monitor. There can be several user-defined parameters. +# Format: UserParameter=<key>,<shell command> +# See 'zabbix_agentd' directory for examples. +# +# Mandatory: no +# Default: +# UserParameter= + +####### LOADABLE MODULES ####### + +### Option: LoadModulePath +# Full path to location of agent modules. +# Default depends on compilation options. +# +# Mandatory: no +# Default: +# LoadModulePath=${libdir}/modules + +### Option: LoadModule +# Module to load at agent startup. Modules are used to extend functionality of the agent. +# Format: LoadModule=<module.so> +# The modules must be located in directory specified by LoadModulePath. +# It is allowed to include multiple LoadModule parameters. +# +# Mandatory: no +# Default: +# LoadModule= +# +UserParameter=ntp.offset,/usr/sbin/ntpdate -d -p3 -t2 cn001 2> /dev/null | grep ^offs |cut -d" " -f2 diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/handlers/main.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..6492aaaac82afb90f6fe5c1084b7e3198cad40fb --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/handlers/main.yml @@ -0,0 +1,26 @@ +--- +# handlers file for buildhostcentos7 + +- name: restart ntpd + service: name=ntpd state=restarted + +- name: restart ypbind + service: name=ypbind state=restarted + +- name: restart zabbix + service: name=zabbix-agent state=restarted + +- name: restart sshd + service: name=sshd state=restarted + +- name: restart rsyslog + service: name=rsyslog state=restarted + +- name: restart autofs + service: name=autofs state=restarted + +- name: restart postfix + service: name=postfix state=restarted + + + diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/meta/main.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/meta/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..c764a1304b72f8a51d8876f22fe728788e5c6ea4 --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/meta/main.yml @@ -0,0 +1,173 @@ +galaxy_info: + author: your name + description: + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Some suggested licenses: + # - BSD (default) + # - MIT + # - GPLv2 + # - GPLv3 + # - Apache + # - CC-BY + license: license (GPLv2, CC-BY, etc) + + min_ansible_version: 1.2 + + # Optionally specify the branch Galaxy will use when accessing the GitHub + # repo for this role. During role install, if no tags are available, + # Galaxy will use this branch. During import Galaxy will access files on + # this branch. If travis integration is cofigured, only notification for this + # branch will be accepted. Otherwise, in all cases, the repo's default branch + # (usually master) will be used. + #github_branch: + + # + # Below are all platforms currently available. Just uncomment + # the ones that apply to your role. If you don't see your + # platform on this list, let us know and we'll get it added! + # + #platforms: + #- name: EL + # versions: + # - all + # - 5 + # - 6 + # - 7 + #- name: GenericUNIX + # versions: + # - all + # - any + #- name: Solaris + # versions: + # - all + # - 10 + # - 11.0 + # - 11.1 + # - 11.2 + # - 11.3 + #- name: Fedora + # versions: + # - all + # - 16 + # - 17 + # - 18 + # - 19 + # - 20 + # - 21 + # - 22 + # - 23 + #- name: opensuse + # versions: + # - all + # - 12.1 + # - 12.2 + # - 12.3 + # - 13.1 + # - 13.2 + #- name: IOS + # versions: + # - all + # - any + #- name: SmartOS + # versions: + # - all + # - any + #- name: eos + # versions: + # - all + # - Any + #- name: Windows + # versions: + # - all + # - 2012R2 + #- name: Amazon + # versions: + # - all + # - 2013.03 + # - 2013.09 + #- name: GenericBSD + # versions: + # - all + # - any + #- name: Junos + # versions: + # - all + # - any + #- name: FreeBSD + # versions: + # - all + # - 10.0 + # - 10.1 + # - 10.2 + # - 8.0 + # - 8.1 + # - 8.2 + # - 8.3 + # - 8.4 + # - 9.0 + # - 9.1 + # - 9.1 + # - 9.2 + # - 9.3 + #- name: Ubuntu + # versions: + # - all + # - lucid + # - maverick + # - natty + # - oneiric + # - precise + # - quantal + # - raring + # - saucy + # - trusty + # - utopic + # - vivid + # - wily + # - xenial + #- name: SLES + # versions: + # - all + # - 10SP3 + # - 10SP4 + # - 11 + # - 11SP1 + # - 11SP2 + # - 11SP3 + #- name: GenericLinux + # versions: + # - all + # - any + #- name: NXOS + # versions: + # - all + # - any + #- name: Debian + # versions: + # - all + # - etch + # - jessie + # - lenny + # - sid + # - squeeze + # - stretch + # - wheezy + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is + # a keyword that describes and categorizes the role. + # Users find roles by searching for tags. Be sure to + # remove the '[]' above if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of + # alphanumeric characters. Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. + # Be sure to remove the '[]' above if you add dependencies + # to this list. \ No newline at end of file diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/tasks/main.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..fc31122f63f680adeff29f4a2955559a29d05ec0 --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/tasks/main.yml @@ -0,0 +1,303 @@ +--- +# tasks file for buildhostcentos7 +# 2017-05-23 Ruud Beukema +# 2017-06-22 Joern Kuensemoeller + + + - name: Install group lofarbuild + group: name=lofarbuild + + - name: Install user lofarbuild + user: name=lofarbuild shell=/bin/bash group="lofarbuild" generate_ssh_key=yes + + - name: Install EPEL repo. + yum: + name: http://mirror.nl.leaseweb.net/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm + state: present + + - name: Import EPEL GPG key. + rpm_key: + key: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }} + state: present + + - name: Install packages + yum: pkg={{item}} state=installed + with_items: + - atop + - autoconf + - autogen + - bison + - bison + - blas + - blas-devel + - boost + - boost-devel + - boost-python + - cfitsio + - cfitsio-devel + - cmake + - cmake-gui + - docker + - fabric + - fftw + - fftw-devel + - flex + - gcc-c++ + - gcc-gfortran + - gettext + - git + - hdf5 + - hdf5-devel + - hdparm + - lapack + - lapack-devel + - libpqxx-devel + - libxml++-devel + - log4cplus-devel + - make + - mariadb + - mariadb-server + - nano + - ncurses + - ncurses-devel + - ntp + - numpy + - boost-python + - openblas-devel + - postfix + - python2-mock + - python-devel + - python-ldap + - python-lxml + - python-pip + - python-qpid + - python-psycopg2 + - qpid-cpp-server + - qpid-cpp-server-linearstore + - qpid-cpp-client + - qpid-tools + - qpid-cpp-client-devel + - readline + - readline-devel + - supervisor + - wcslib + - wcslib-devel + - wget + - xterm + - ypbind + - yp-tools + - zabbix22-agent + tags: packages + + - name: Stop SELINUX + selinux: state=disabled + + - name: Install PyPi packages + pip: name={{item}} + with_items: + - django + - djangorestframework + - djangorestframework-xml + - testing.mysqld + - xmljson + - mysql-connector==2.1.4 + - django-auth-ldap + tags: packages + + - name: get UnitTest++ + get_url: url=https://github.com/unittest-cpp/unittest-cpp/archive/v1.6.1.tar.gz dest=/opt + tags: + - unittest++ + + # Install Postgres + + - name: Create /opt/Postgresl + file: path=/opt/Postgresql owner=lofarbuild group=lofarbuild state=directory mode=0775 + + - name: download Postgres 9.6 repository rpm + get_url: url=https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm dest=/opt/Postgresql/pgdg-centos96-9.6-3.noarch.rpm mode=644 + + - name: add Postgres repository + yum: name=/opt/Postgresql/pgdg-centos96-9.6-3.noarch.rpm state=present + + - name: install Postgres 9.6 + yum: name='@postgresqldbserver96' state=present + + - name: Postgres initdb + shell: /usr/pgsql-9.6/bin/initdb -D /var/lib/pgsql/9.6/data/ + become: yes + become_user: postgres + become_method: su + + - name: Changing config for OTDB + shell: echo {{item}} >> /var/lib/pgsql/9.6/data/postgresql.conf + with_items: + - "backslash_quote = on" + - "standard_conforming_strings = off" + + + - name: Starting postgres + shell: "(/usr/pgsql-9.6/bin/Postgres >/dev/null 2>&1 &)" + async: 300 + poll: 0 + become: yes + become_user: postgres + become_method: su + + # todo: times out, need to listen on the dockeri, not the host + - wait_for: + port: 5432 + delay: 5 + timeout: 10 + ignore_errors: yes + + # RA + + - name: add Postgres user for RA + shell: /usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/9.6/data/ start + become: yes + become_user: postgres + become_method: su + + - name: create Postgres role for RA + shell: /usr/pgsql-9.6/bin/psql -c "CREATE USER resourceassignment WITH SUPERUSER" + become: yes + become_user: postgres + become_method: su + + - name: populate Postgres DB for RA + shell: | + cd /opt/LOFAR/SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/; + /usr/pgsql-9.6/bin/psql -f create_and_populate_database.sql + become: yes + become_user: postgres + become_method: su + + # OTDB + + - name: populate otdb db + shell: | + cd /opt/LOFAR/SAS/OTDB/sql; + psql -U postgres -f create_OTDB.sql -v ON_ERROR_STOP=1 + become: yes + become_user: postgres + become_method: su + #ignore_errors: yes + + + # Setup Mysql + + - name: Change shell for user mysql + shell: chsh -s /bin/bash mysql + + - name: init Mysql db + shell: | + mysql_install_db + become: yes + become_user: mysql + become_method: su + + - name: Starting Mysql + shell: /usr/bin/mysqld_safe --datadir='/var/lib/mysql' & + async: 300 + poll: 0 + become: yes + become_user: mysql + become_method: su + + # todo: times out, need to listen on the docker, not the host + - wait_for: + port: 3306 + delay: 5 + timeout: 10 + ignore_errors: yes + + # MoM + + - name: populate mom db + shell: | + mysql -u root < /momdb_init.sql + become: yes + become_user: mysql + become_method: su + + + # MoM - OTDB adapter (why is that supposed to run as tomcat ???) + + - name: create user tomcat + shell: adduser tomcat && chsh -s /bin/bash tomcat + + - name: create /opt/tomcat + file: path=/opt/tomcat/ owner=tomcat group=tomcat state=directory mode=0775 + + - name: get mom otdb adapter + get_url: url=https://support.astron.nl/nexus/content/groups/public/nl/astron/mom3/MoM-OTDB-adapter/2.7.0/MoM-OTDB-adapter-2.7.0.tar.gz dest=/opt/tomcat/MoM-OTDB-adapter-2.7.0.tar.gz mode=644 + + - name: deploy mom otdb adapter + shell: | + cd /opt/tomcat/; + tar -xzvf MoM-OTDB-adapter-2.7.0.tar.gz; + chown -R tomcat /opt/tomcat + +# Postfix + + - name: fix postfix config + shell: sed -i -e 's/inet_protocols = all/inet_protocols = ipv4/g' /etc/postfix/main.cf + +# Build relevant LOFAR packages: + - name: /opt/LOFAR should exist + shell: ls -lta /opt/LOFAR + + - name: create /opt/LOFAR/build + file: path=/opt/LOFAR/build/ owner=lofarbuild group=lofarbuild state=directory mode=0775 + + - name: create /opt/LOFAR/build/gnucxx11_opt + file: path=/opt/LOFAR/build/gnucxx11_opt owner=lofarbuild group=lofarbuild state=directory mode=0775 + + + - name: Build trigger-related LOFAR packages + shell: cd /opt/LOFAR/build/gnucxx11_opt; + cmake + -DBUILD_PACKAGES={{item}} + ../..; + make; + make install; + with_items: + - MoMQueryService + - OTDBtoRATaskStatusPropagator + - RATaskSpecifiedService + - RAtoOTDBTaskSpecificationPropagator + - ResourceAssigner + - ResourceAssignmentDatabase + - ResourceAssignmentEditor + - ResourceAssignmentEstimator + - ResourceAssignmentService + - SpecificationServices + - SystemStatusDatabase + - SystemStatusService + - TriggerServices + - TriggerEmailService + - TaskPrescheduler + - DataManagement + - RAScripts + - StaticMetaData + - OTDB_Services + - SAS_OTDB + + +# rest interface + + - name: configure ldap in restinterface + shell: | + sed -i -e 's/AUTH_LDAP_USER_DN_TEMPLATE="uid=%(user)s,ou=Users,o=lofar,c=eu?cn"/AUTH_LDAP_USER_DN_TEMPLATE="cn=%(user)s,ou=Users,o=lofar,c=eu"/g' /opt/LOFAR/build/gnucxx11_opt/installed/lib64/python2.7/site-packages/lofar/triggerservices/restinterface/credentials.py + sed -i -e 's/#AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NEVER }/AUTH_LDAP_GLOBAL_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER } \nAUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NEVER }/g' /opt/LOFAR/build/gnucxx11_opt/installed/lib64/python2.7/site-packages/lofar/triggerservices/restinterface/settings.py + sed -i -e 's/'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.AllowAny',),/'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),/g' /opt/LOFAR/build/gnucxx11_opt/installed/lib64/python2.7/site-packages/lofar/triggerservices/restinterface/settings.py + + - name: configure secret key in rest interface + shell: | + sed -i -e 's/SECRET_KEY = .*/SECRET_KEY = "{{ lookup('ini', 'secret_key section=restinterface file=/build.ini') }}"/g' /opt/LOFAR/build/gnucxx11_opt/installed/lib64/python2.7/site-packages/lofar/triggerservices/restinterface/credentials.py + + - name: migrate django database + shell: | + . /opt/LOFAR/build/gnucxx11_opt/lofarinit.sh + python /opt/LOFAR/build/gnucxx11_opt/installed/lib64/python2.7/site-packages/lofar/triggerservices/manage.py migrate diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/templates/ntp.conf.j2 b/Docker/lofar-triggerservices/roles/buildhostcentos7/templates/ntp.conf.j2 new file mode 100644 index 0000000000000000000000000000000000000000..005a1a4d1947947c8ffaf8f02da7df647af8c2eb --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/templates/ntp.conf.j2 @@ -0,0 +1,90 @@ +# For more information about this file, see the man pages +# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5). +{{ ansible_managed | comment }} + +#logconfig =syncevents +peerevents +sysevents +allclock +logconfig =all + +driftfile /var/lib/ntp/drift +logfile /var/log/ntpstats/ntpd +statsdir /var/log/ntpstats/ + +# +# Statistics logging +# +statistics loopstats peerstats clockstats +filegen loopstats file loopstats type day enable +filegen peerstats file peerstats type day enable +filegen clockstats file clockstats type day enable + +# Permit time synchronization with our time source, but do not +# permit the source to query or modify the service on this system. +restrict default nomodify notrap nopeer noquery + +# Permit all access over the loopback interface. This could +# be tightened as well, but to do so would effect some of +# the administrative functions. +restrict 127.0.0.1 +restrict ::1 + +# Hosts on local network are less restricted. +#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap + +# Use public servers from the pool.ntp.org project. +# Please consider joining the pool (http://www.pool.ntp.org/join.html). +#server ntp1.control.lofar iburst +#server ntp2.control.lofar iburst +server 127.127.1.0 # local clock +fudge 127.127.1.0 stratum 10 + +# +# ONCORE GPS on /dev/oncore.serial.0 and /dev/oncore.pss.0 +# +# Make sure /dev/oncore.serial.0 points to the port on which the GPS +# is connected, e.g. "ln -s /dev/ttyS4 /dev/oncore.serial.0" +# +# The device /dev/oncore.pps.0 should point to the serial device where +# the PPS signal is received on the DCD pin, +# e.g. "ln -s /dev/ttyS0 /dev/oncore.pps.0" +# +enable pps +server 127.127.30.0 prefer # minpoll 4 maxpoll 4 # ONCORE GPS +#fudge 127.127.30.0 stratum 1 + +# prevent NTP from bailing out on a large offsets +tinker panic 0 stepout 0 + +#broadcast 192.168.1.255 autokey # broadcast server +#broadcastclient # broadcast client +#broadcast 224.0.1.1 autokey # multicast server +#multicastclient 224.0.1.1 # multicast client +#manycastserver 239.255.254.254 # manycast server +#manycastclient 239.255.254.254 autokey # manycast client + +# Enable public key cryptography. +#crypto + +includefile /etc/ntp/crypto/pw + +# Key file containing the keys and key identifiers used when operating +# with symmetric key cryptography. +keys /etc/ntp/keys + +# Specify the key identifiers which are trusted. +#trustedkey 4 8 42 + +# Specify the key identifier to use with the ntpdc utility. +#requestkey 8 + +# Specify the key identifier to use with the ntpq utility. +#controlkey 8 + +# Enable writing of statistics records. +#statistics clockstats cryptostats loopstats peerstats + +# Disable the monitoring facility to prevent amplification attacks using ntpdc +# monlist command when default restrict does not include the noquery flag. See +# CVE-2013-5211 for more details. +# Note: Monitoring will not be disabled with the limited restriction flag. +disable monitor + diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/tests/inventory b/Docker/lofar-triggerservices/roles/buildhostcentos7/tests/inventory new file mode 100644 index 0000000000000000000000000000000000000000..d18580b3c364645735235c667c2a546e28c273bb --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/tests/inventory @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/tests/test.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/tests/test.yml new file mode 100644 index 0000000000000000000000000000000000000000..b143b2d694d4edec5ff7bccd49b6ac93cd606e1d --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - buildhostcentos7 \ No newline at end of file diff --git a/Docker/lofar-triggerservices/roles/buildhostcentos7/vars/main.yml b/Docker/lofar-triggerservices/roles/buildhostcentos7/vars/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..637ceea440e7ec9027d46a9175730371759add43 --- /dev/null +++ b/Docker/lofar-triggerservices/roles/buildhostcentos7/vars/main.yml @@ -0,0 +1,54 @@ +--- +# vars file for software support +# +sws: + - { name: beukema, + uid: 7821, + passwd: "TGnjx8jnImTho", + key: "" +} + - { name: klazema, + uid: 7824, + passwd: "bwmUHRi3n3oKk", + key: "" +} + - { name: jkuensem, + uid: 7699, + passwd: "MvTC31g.ZAPJI", + key: "" +} + - { name: mol, + uid: 7261, + passwd: "5xRrVn3oVDiuM", + key: "" +} + - { name: rbokhorst, + uid: 7808, + passwd: "$1$2HlbS0g1$k1FRcwuCWDuMWKcTq2o9I/", + key: "" +} + - { name: holties, + uid: 7038, + passwd: "nCtSnnNrI2uLo", + key: "" +} + - { name: renting, + uid: 7420, + passwd: "FjAow7BLuwAf", + key: "" +} + - { name: schaap, + uid: 7769, + passwd: "V1g5P3EBQW4Sc", + key: "" +} + - { name: schoenma, + uid: 7418, + passwd: "j92DvKseopOk6", + key: "" +} + - { name: vermaas, + uid: 7076, + passwd: "M619Idwr5cC1E", + key: "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAxjy91r2IeWt7gE7nurhNx5SQKPuwOtkIf9z6Dd8Crsaq3zfuCNcC24YYmMTVBomD5s4PqPGAe+j89AuCLxQcNqvvncuLhy0rGhpgipds7kRHJvYB7DBmr/H2KNdiAfZJPmGKsJsoisrryEZ7eGQZhR/o143mYzosv0Qq+YMAHL2V6GllgsuOjmnFvmdb2Or/pz3PHkglxXdTgl6KFSM8wsJ8uriAPq3VhUEVx62Y7GAqxWhJYnI7EkzUx5m3cspMmJQnZ06q+rxgnS2+KiMp+6gg8EE4JkVeVxrQB+mV4QppbnLIzyOp4osiB02zevOzIBJ0++fawlu5dON1Pp+vYw== rsa-key-20161215" +} diff --git a/Docker/lofar-triggerservices/startup.sh b/Docker/lofar-triggerservices/startup.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e33e659aa5562e166d341badd22e23297c94fb6 --- /dev/null +++ b/Docker/lofar-triggerservices/startup.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +echo 'Starting Qpid...' && +qpidd & +sleep 2; + +echo 'Setting up queues...' && +qpid-config add exchange topic devel.lofar.trigger.command && +qpid-config add exchange topic devel.lofar.trigger.notification && +qpid-config add exchange topic devel.lofar.ra.command && +qpid-config add exchange topic devel.lofar.spec.command && +qpid-config add queue mom.importxml && +sleep 2; + +echo 'Init LOFAR env...'; +. /opt/LOFAR/build/gnucxx11_opt/lofarinit.sh && +sleep 2; + +echo 'Starting LOFAR services...' && +specificationservice & +specificationvalidationservice & +specificationtranslationservice & +triggerservice & +triggerrestinterface & + +echo 'Starting Postgres...' && +runuser -l postgres -c '/usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/9.6/data/ start' && + +echo 'Starting Mysql...' && +runuser -l mysql -c 'mysqld_safe' & +sleep 5; + +cd; momqueryservice -C MoM & + + +postfix start; + +echo 'Have fun!' && +/bin/bash diff --git a/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py b/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py index 98ba9594d53337acd4f4e99913c57ab632b3efe0..01a59bcb525a19bbf07202092e6f7d5a8ac74356 100644 --- a/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py +++ b/SAS/MoM/MoMQueryService/MoMQueryServiceClient/momqueryrpc.py @@ -242,6 +242,27 @@ class MoMQueryRPC(RPCWrapper): result = convertStringDigitKeysToInt(result) return result + def get_station_selection(self, mom_id): + """ + Get the station selection represented as resource groups with min/max values for given mom id. + :param mom_id: int + :return: list of dict + """ + logger.info("Calling GetStationSelection for mom id "+str(mom_id)) + station_selection = self.rpc('GetStationSelection', mom_id=mom_id) + return station_selection + + def get_time_restrictions(self, mom_id): + """ + Returns min start and max end times and duration for given mom id. + :param mom_id: int + :return: dict + """ + logger.info("Calling GetTimeRestrictions for mom id "+str(mom_id)) + time_restrictions = self.rpc('GetTimeRestrictions', mom_id=mom_id) + return time_restrictions + + def main(): # Check the invocation arguments parser = OptionParser('%prog [options]', diff --git a/SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice.py b/SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice.py index 7ad39883217ee93524971a3ca97cb40b89650889..329530cf56c2562f1bcd4293137b13ae43bc23d2 100755 --- a/SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice.py +++ b/SAS/MoM/MoMQueryService/MoMQueryServiceServer/momqueryservice.py @@ -92,7 +92,7 @@ def _toIdsString(ids): if not ids_list: raise ValueError("Could not find proper ids in: " + ids) - ids_str = ','.join([str(id) for id in ids_list]) + ids_str = ','.join([str(ident) for ident in ids_list]) return ids_str @@ -121,12 +121,12 @@ class MoMDatabaseWrapper: # max of 3 tries, on success return result # use new connection for every query, # because on the flaky lofar network a connection may appear functional but returns improper results. - MAXTRIES=3 + maxtries = 3 if data is not None and type(data) not in (tuple, dict): raise ValueError('Need data as tuple or dict, got ' + str(type(data))) - for i in range(MAXTRIES): + for i in range(maxtries): try: self._connect() cursor = self.conn.cursor(dictionary=True) @@ -135,16 +135,16 @@ class MoMDatabaseWrapper: except (OperationalError, AttributeError) as e: logger.error(str(e)) - if i+1 == MAXTRIES: raise e + if i+1 == maxtries: raise e def _executeInsertQuery(self, query, data=None): # try to execute query on flaky lofar mysql connection # max of 3 tries, on success return result # use new connection for every query, # because on the flaky lofar network a connection may appear functional but returns improper results. - MAXTRIES=3 + maxtries = 3 - for i in range(MAXTRIES): + for i in range(maxtries): try: self._connect() cursor = self.conn.cursor(dictionary=True) @@ -154,7 +154,7 @@ class MoMDatabaseWrapper: except (OperationalError, AttributeError) as e: logger.error(str(e)) - if i+1 == MAXTRIES: raise e + if i+1 == maxtries: raise e def add_trigger(self, user_name, host_name, project_name, meta_data): logger.info("add_trigger for user_name: %s, host_name: %s, project_name: %s, meta_data: %s", @@ -244,7 +244,8 @@ where mom2object.name = %s""" join """ + self.momprivilege_db + """.statustransitionrole as transition_role on system_role.systemroleid=transition_role.roleid join """ + self.momprivilege_db + """.statustransition as transition on transition_role.statustransitionid=transition.id join status as open_status on open_status.code='opened' - join status as status on status.id=transition.newstatusid and (transition.oldstatusid=0 or transition.oldstatusid=open_status.id) + join status as status on status.id=transition.newstatusid + and (transition.oldstatusid=0 or transition.oldstatusid=open_status.id) where status.code=%s and status.type='""" + status_type[job_type] + """' and open_status.type='""" + status_type[job_type] + """' and @@ -266,7 +267,8 @@ where mom2object.name = %s""" join """ + self.momprivilege_db + """.statustransitionrole as transition_role on project_role.id=transition_role.roleid join """ + self.momprivilege_db + """.statustransition as transition on transition_role.statustransitionid=transition.id join status as open_status on open_status.code='opened' - join status as status on status.id=transition.newstatusid and (transition.oldstatusid=0 or transition.oldstatusid=open_status.id) + join status as status on status.id=transition.newstatusid + and (transition.oldstatusid=0 or transition.oldstatusid=open_status.id) where status.code=%s and status.type='""" + status_type[job_type] + """' and open_status.type='""" + status_type[job_type] + """' and @@ -369,32 +371,12 @@ where mom2object.name = %s""" """ logger.info("get_trigger_id for mom_id: %s", mom_id) - query = """SELECT mom.mom2id, mom.mom2objecttype, obs_spec.misc -FROM mom2object as mom -join lofar_observation as obs on mom.mom2objecttype = "LOFAR_OBSERVATION" and mom.id = obs.mom2objectid -join lofar_observation_specification as obs_spec on - mom.mom2objecttype = "LOFAR_OBSERVATION" and obs.user_specification_id = obs_spec.id -where mom.mom2id=%s -union -SELECT mom.mom2id, mom.mom2objecttype, pipeline.misc -FROM mom2object as mom -join lofar_pipeline as pipeline on mom.mom2objecttype like "%PIPELINE%" and mom.id = pipeline.mom2objectid -where mom.mom2id=%s;""" - parameters = (mom_id, mom_id) - - rows_trigger_ids = self._executeSelectQuery(query, parameters) - trigger_id = None - - if rows_trigger_ids: - misc_json = rows_trigger_ids[0]['misc'] - if misc_json: - misc = json.loads(misc_json) - if 'trigger_id' in misc: - trigger_id = misc['trigger_id'] + misc = self._get_misc_contents(mom_id) + if misc and 'trigger_id' in misc: + trigger_id = misc['trigger_id'] logger.info("get_trigger_id for mom_id (%s): %s", mom_id, trigger_id) - return trigger_id def get_project_details(self, mom_id): @@ -428,12 +410,11 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " return result - def get_project_priorities_for_objects(self, mom_ids): - ''' get the project priorities for given mom object mom_ids (observations/pipelines/reservations) - :param mixed mom_ids comma seperated string of mom2object id's, or list of ints + """ get the project priorities for given mom object mom_ids (observations/pipelines/reservations) + :param mom_ids: mixed mom_ids comma seperated string of mom2object id's, or list of ints :rtype list of dict's key value pairs with the project priorities - ''' + """ if not mom_ids: return {} @@ -467,12 +448,13 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " return result def getObjectDetails(self, mom_ids): - ''' get the object details (project_mom2id, project_name, + """ + get the object details (project_mom2id, project_name, project_description, object_mom2id, object_name, object_description, object_type, object_group_id, object_group_name, object_status) for given mom object mom_ids - :param mixed mom_ids comma seperated string of mom2object id's, or list of ints + :param mom_ids: mixed mom_ids comma seperated string of mom2object id's, or list of ints :rtype list of dict's key value pairs with the project details - ''' + """ if not mom_ids: return {} @@ -484,10 +466,13 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " placeholder = (len(parameters)*'%s,')[:-1] # TODO: make a view for this query in momdb! - query = '''SELECT project.mom2id as project_mom2id, project.id as project_mom2objectid, project.name as project_name, project.description as project_description, - object.mom2id as object_mom2id, object.id as object_mom2objectid, object.name as object_name, object.description as object_description, object.mom2objecttype as object_type, status.code as object_status, - object.group_id as object_group_id, grp.id as object_group_mom2objectid, grp.name as object_group_name, grp.description as object_group_description, - parent_grp.id as parent_group_mom2objectid, parent_grp.mom2id as parent_group_mom2id, parent_grp.name as parent_group_name, parent_grp.description as parent_group_description + query = '''SELECT project.mom2id as project_mom2id, project.id as project_mom2objectid, project.name as + project_name, project.description as project_description, object.mom2id as object_mom2id, + object.id as object_mom2objectid, object.name as object_name, object.description as object_description, + object.mom2objecttype as object_type, status.code as object_status, object.group_id as object_group_id, + grp.id as object_group_mom2objectid, grp.name as object_group_name, grp.description as object_group_description, + parent_grp.id as parent_group_mom2objectid, parent_grp.mom2id as parent_group_mom2id, + parent_grp.name as parent_group_name, parent_grp.description as parent_group_description FROM mom2object as object left join mom2object as project on project.id = object.ownerprojectid left join mom2object as grp on grp.mom2id = object.group_id @@ -513,11 +498,12 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " return result def getProjects(self): - ''' get the list of all projects with columns (project_mom2id, project_name, + """ + get the list of all projects with columns (project_mom2id, project_name, project_description, status_name, status_id, last_user_id, last_user_name, statustime) :rtype list of dict's key value pairs with all projects - ''' + """ # TODO: make a view for this query in momdb! query = '''SELECT project.mom2id as mom2id, project.name as name, project.description as description, statustype.code as status_name, statustype.id as status_id, @@ -535,10 +521,11 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " return result def getProject(self, project_mom2id): - ''' get project for the given project_mom2id with columns (project_mom2id, project_name, + """ + get project for the given project_mom2id with columns (project_mom2id, project_name, project_description, status_name, status_id, last_user_id, last_user_name, statustime) - ''' + """ ids_str = _toIdsString(project_mom2id) # TODO: make a view for this query in momdb! @@ -573,7 +560,7 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " rows = self._executeSelectQuery(query, parameters) - result = { 'project_mom2id': project_mom2id, 'task_mom2ids': [r['mom2id'] for r in rows]} + result = {'project_mom2id': project_mom2id, 'task_mom2ids': [r['mom2id'] for r in rows]} logger.info('task ids for project: %s', result) @@ -605,7 +592,7 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " result[str(mom2id)] = pred_id_list for mom2id in ids_str.split(','): - if not mom2id in result: + if mom2id not in result: result[mom2id] = [] logger.info('predecessors: %s', result) @@ -648,8 +635,11 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " return result def getTaskIdsGraph(self, mom2id): - '''Get the fully connected graph of interconnected tasks given any mom2id in that graph - returns: dict with mom2id:node as key value pairs, where each node is a dict with items node_mom2id, predecessor_ids, successor_ids''' + """ + Get the fully connected graph of interconnected tasks given any mom2id in that graph + returns: dict with mom2id:node as key value pairs, where each node is a dict with items + node_mom2id, predecessor_ids, successor_ids + """ def extendGraphWithPredecessorsAndSuccessors(graph, current_node_id): node = graph[current_node_id] @@ -657,7 +647,7 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " new_node_ids = set() - node_pred_ids = self.getPredecessorIds(node_mom2id).get(str(node_mom2id),[]) + node_pred_ids = self.getPredecessorIds(node_mom2id).get(str(node_mom2id), []) for pred_id in node_pred_ids: if pred_id not in node['predecessor_ids']: node['predecessor_ids'].append(pred_id) @@ -665,13 +655,13 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " pred_node = graph.get(pred_id) if not pred_node: - graph[pred_id] = { 'node_mom2id': pred_id, - 'predecessor_ids': [], - 'successor_ids': [node_mom2id] } + graph[pred_id] = {'node_mom2id': pred_id, + 'predecessor_ids': [], + 'successor_ids': [node_mom2id]} new_node_ids.add(pred_id) - node_succ_ids = self.getSuccessorIds(node_mom2id).get(str(node_mom2id),[]) + node_succ_ids = self.getSuccessorIds(node_mom2id).get(str(node_mom2id), []) for succ_id in node_succ_ids: if succ_id not in node['successor_ids']: node['successor_ids'].append(succ_id) @@ -679,26 +669,24 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " succ_node = graph.get(succ_id) if not succ_node: - graph[succ_id] = { 'node_mom2id': succ_id, - 'predecessor_ids': [node_mom2id], - 'successor_ids': [] } + graph[succ_id] = {'node_mom2id': succ_id, + 'predecessor_ids': [node_mom2id], + 'successor_ids': []} new_node_ids.add(succ_id) - #recurse + # recurse for new_node_id in new_node_ids: extendGraphWithPredecessorsAndSuccessors(graph, new_node_id) # start with simple graph with the given node_mom2id - the_graph = { mom2id: { 'node_mom2id': mom2id, - 'predecessor_ids': [], - 'successor_ids': [] } } + the_graph = {mom2id: {'node_mom2id': mom2id, + 'predecessor_ids': [], + 'successor_ids': []}} # recursively append next layers until done. extendGraphWithPredecessorsAndSuccessors(the_graph, mom2id) - - # the_graph is now complete, return it return the_graph @@ -739,12 +727,13 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " logger.debug("getGroupsInParentGroup for mom parent group ids: %s", ids_str) query = '''SELECT parent.id as parent_mom2object_id, parent.mom2id as parent_mom2id, - grp.mom2id as group_mom2id, grp.id as group_mom2object_id, grp.name as group_name, grp.description as group_description + grp.mom2id as group_mom2id, grp.id as group_mom2object_id, grp.name as group_name, + grp.description as group_description from mom2object parent inner join mom2object grp on parent.id = grp.parentid where parent.mom2id in (%s) and grp.group_id = grp.mom2id''' - parameters = (ids_str, ) + parameters = (ids_str, ) rows = self._executeSelectQuery(query, parameters) @@ -785,8 +774,11 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " return result def getMoMIdsForOTDBIds(self, otdb_ids): - '''reverse lookup from otdb_id(s) to mom2id(s) - returns: dict with otdb_id(s) in keys, mom2id(s) as values''' + """ + reverse lookup from otdb_id(s) to mom2id(s) + returns: dict with otdb_id(s) in keys, mom2id(s) as values + """ + if not otdb_ids: return {} @@ -794,9 +786,9 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " logger.debug("getMoMIdsForOTDBIds for otdb ids: %s" % ids_str) - result = {int(otdb_id):None for otdb_id in ids_str.split(',')} + result = {int(otdb_id): None for otdb_id in ids_str.split(',')} - #first query all observations + # first query all observations query = '''SELECT obs.observation_id as otdb_id, mo.mom2id as mom2id FROM lofar_observation obs INNER JOIN mom2object mo on mo.id = obs.mom2objectid @@ -806,10 +798,10 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " rows = self._executeSelectQuery(query) for row in rows: - if row['mom2id'] != None: + if row['mom2id'] is not None: result[row['otdb_id']] = row['mom2id'] - #then query all pipelines and combine the results + # then query all pipelines and combine the results query = '''SELECT pl.pipeline_id as otdb_id, mo.mom2id as mom2id FROM lofar_pipeline pl INNER JOIN mom2object mo on mo.id = pl.mom2objectid @@ -819,16 +811,18 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " rows = self._executeSelectQuery(query) for row in rows: - if row['mom2id'] != None: + if row['mom2id'] is not None: result[row['otdb_id']] = row['mom2id'] logger.info("getMoMIdsForOTDBIds: %s" % result) return result - def getOTDBIdsForMoMIds(self, mom_ids): - '''lookup from mom2id(s) to otdb_id(s) - returns: dict with mom2id(s) in keys, otdb_id(s) as values''' + """ + lookup from mom2id(s) to otdb_id(s) + returns: dict with mom2id(s) in keys, otdb_id(s) as values + """ + if not mom_ids: return {} @@ -836,9 +830,9 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " logger.debug("getOTDBIdsForMoMIds for otdb ids: %s" % ids_str) - result = {int(mom_id):None for mom_id in ids_str.split(',')} + result = {int(mom_id): None for mom_id in ids_str.split(',')} - #first query all observations + # first query all observations query = '''SELECT obs.observation_id as otdb_id, mo.mom2id as mom2id FROM lofar_observation obs INNER JOIN mom2object mo on mo.id = obs.mom2objectid @@ -848,10 +842,10 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " rows = self._executeSelectQuery(query) for row in rows: - if row['mom2id'] != None: + if row['mom2id'] is not None: result[row['mom2id']] = row['otdb_id'] - #then query all pipelines and combine the results + # then query all pipelines and combine the results query = '''SELECT pl.pipeline_id as otdb_id, mo.mom2id as mom2id FROM lofar_pipeline pl INNER JOIN mom2object mo on mo.id = pl.mom2objectid @@ -861,7 +855,7 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " rows = self._executeSelectQuery(query) for row in rows: - if row['mom2id'] != None: + if row['mom2id'] is not None: result[row['mom2id']] = row['otdb_id'] logger.info("getOTDBIdsForMoMIds: %s" % result) @@ -908,11 +902,129 @@ where project.mom2id = %s and (project_role.name = "Pi" or project_role.name = " pass + def _get_misc_contents(self, mom_id): + """ + Get deserialized contents of misc field for given obs id. May be empty if mom_id exists but misc is empty. + Returns None if no entry found for mom id + :param mom_id: int + :return: dict or None + """ + logger.info("getting misc for mom_id: %s", mom_id) + + misc = None + + query = """SELECT mom.mom2id, mom.mom2objecttype, obs_spec.misc + FROM mom2object as mom + join lofar_observation as obs on mom.mom2objecttype = "LOFAR_OBSERVATION" and mom.id = obs.mom2objectid + join lofar_observation_specification as obs_spec on + mom.mom2objecttype = "LOFAR_OBSERVATION" and obs.user_specification_id = obs_spec.id + where mom.mom2id=%s + union + SELECT mom.mom2id, mom.mom2objecttype, pipeline.misc + FROM mom2object as mom + join lofar_pipeline as pipeline on mom.mom2objecttype like "%PIPELINE%" + and mom.id = pipeline.mom2objectid + where mom.mom2id=%s;""" + parameters = (mom_id, mom_id) + rows_misc = self._executeSelectQuery(query, parameters) + + if rows_misc: + misc = {} + misc_json = rows_misc[0]['misc'] + if misc_json: + misc = json.loads(misc_json) + + return misc + + def get_time_restrictions(self, mom_id): + """ + Returns min start and max end times and min/max duration for given mom id. + :param mom_id: int + :return: dict + """ + logger.info("get_time_restrictions for mom_id: %s", mom_id) + + time_restrictions = {} + + # Note: this duplicates the _get_misc_contents(), but we save a (quite expensive?) additional query if we + # handle this together with duration: + query = """SELECT mom.mom2id, mom.mom2objecttype, obs_spec.misc, obs_spec.spec_duration AS duration, + obs_spec.starttime, obs_spec.endtime + FROM mom2object as mom + join lofar_observation as obs on mom.mom2objecttype = "LOFAR_OBSERVATION" and mom.id = obs.mom2objectid + join lofar_observation_specification as obs_spec on + mom.mom2objecttype = "LOFAR_OBSERVATION" and obs.user_specification_id = obs_spec.id + where mom.mom2id=%s + union + SELECT mom.mom2id, mom.mom2objecttype, pipeline.misc, pipeline.duration AS duration, + pipeline.starttime, pipeline.endtime + FROM mom2object as mom + join lofar_pipeline as pipeline on mom.mom2objecttype like "%PIPELINE%" + and mom.id = pipeline.mom2objectid + where mom.mom2id=%s;""" + parameters = (mom_id, mom_id) + rows = self._executeSelectQuery(query, parameters) + + if rows is None or len(rows) == 0: + raise ValueError("mom_id (%s) not found in MoM database" % mom_id) + + # add timewindow to response, if present + misc_json = rows[0]['misc'] + if misc_json is not None: + misc = json.loads(misc_json) + if 'timeWindow' in misc: + time_restrictions.update(misc['timeWindow']) + + # use mom db duration and startime to fill missing info + if 'minDuration' not in time_restrictions: + duration = rows[0]['duration'] + if duration: + time_restrictions['minDuration'] = duration + if 'maxDuration' not in time_restrictions: + if 'minDuration' in time_restrictions: # might not be if duration entry was NULL + time_restrictions['maxDuration'] = time_restrictions['minDuration'] + if 'minStartTime' not in time_restrictions: + starttime = rows[0]['starttime'] + if starttime: + time_restrictions['minStartTime'] = starttime + if 'maxEndTime' not in time_restrictions: + endtime = rows[0]['endtime'] + if endtime: + time_restrictions['maxEndTime'] = endtime + + if len(time_restrictions) == 0: + raise ValueError("No time restrictions for mom_id (%s) in database" % mom_id) + + logger.info("get_time_restrictions for mom_id (%s): %s", mom_id, time_restrictions) + + return time_restrictions + + def get_station_selection(self, mom_id): + """ + Get the station selection represented as resource groups with min/max values for given mom id. + :param mom_id: int + :return: list of dict + + """ + logger.info("get_station_selection for mom_id: %s", mom_id) + + misc = self._get_misc_contents(mom_id) + if misc is None: + raise ValueError("mom_id (%s) not found in MoM database" % mom_id) + if 'stationSelection' not in misc: + raise ValueError("misc field for mom_id (%s) does not contain stationSelection" % mom_id) + station_selection = misc['stationSelection'] + + logger.info("get_station_selection for mom_id (%s): %s", mom_id, station_selection) + + return station_selection + class ProjectDetailsQueryHandler(MessageHandlerInterface): - '''handler class for details query in mom db + """ + handler class for details query in mom db :param MoMDatabaseWrapper momdb inject database access via wrapper - ''' + """ def __init__(self, **kwargs): super(ProjectDetailsQueryHandler, self).__init__(**kwargs) self.dbcreds = kwargs.pop("dbcreds", None) @@ -938,7 +1050,9 @@ class ProjectDetailsQueryHandler(MessageHandlerInterface): 'GetMoMIdsForOTDBIds': self.getMoMIdsForOTDBIds, 'GetOTDBIdsForMoMIds': self.getOTDBIdsForMoMIds, 'GetTaskIdsGraph': self.getTaskIdsGraph, - 'GetProjectPrioritiesForObjects': self.get_project_priorities_for_objects + 'GetProjectPrioritiesForObjects': self.get_project_priorities_for_objects, + 'GetStationSelection': self.get_station_selection, + 'GetTimeRestrictions': self.get_time_restrictions } def prepare_loop(self): @@ -1018,17 +1132,27 @@ class ProjectDetailsQueryHandler(MessageHandlerInterface): def getTaskIdsGraph(self, mom2id): return convertIntKeysToString(self.momdb.getTaskIdsGraph(mom2id)) + def get_time_restrictions(self, mom_id): + return self.momdb.get_time_restrictions(mom_id) + + def get_station_selection(self, mom_id): + return self.momdb.get_station_selection(mom_id) + + def createService(busname=DEFAULT_MOMQUERY_BUSNAME, servicename=DEFAULT_MOMQUERY_SERVICENAME, dbcreds=None, handler=None, broker=None): - '''create the GetObjectDetails on given busname + """ + create the GetObjectDetails on given busname :param string busname: name of the bus on which this service listens :param string servicename: name of the service :param Credentials dbcreds: Credentials for the MoM database. :param ProjectDetailsQueryHandler handler: ProjectDetailsQueryHandler class Type, or mock like type - :rtype: lofar.messaging.Service''' + :param broker: + :rtype: lofar.messaging.Service + """ if not handler: handler = ProjectDetailsQueryHandler @@ -1040,18 +1164,23 @@ def createService(busname=DEFAULT_MOMQUERY_BUSNAME, use_service_methods=True, verbose=False, broker=broker, - handler_args={'dbcreds' : dbcreds}) + handler_args={'dbcreds': dbcreds}) def main(): - '''Starts the momqueryservice.GetObjectDetails service''' + """ + Starts the momqueryservice.GetObjectDetails service + """ # Check the invocation arguments parser = OptionParser("%prog [options]", description='runs the momqueryservice') - parser.add_option('-q', '--broker', dest='broker', type='string', default=None, help='Address of the qpid broker, default: localhost') - parser.add_option("-b", "--busname", dest="busname", type="string", default=DEFAULT_MOMQUERY_BUSNAME, help="Name of the bus exchange on the qpid broker, [default: %default]") - parser.add_option("-s", "--servicename", dest="servicename", type="string", default=DEFAULT_MOMQUERY_SERVICENAME, help="Name for this service, [default: %default]") + parser.add_option('-q', '--broker', dest='broker', type='string', default=None, + help='Address of the qpid broker, default: localhost') + parser.add_option("-b", "--busname", dest="busname", type="string", default=DEFAULT_MOMQUERY_BUSNAME, + help="Name of the bus exchange on the qpid broker, [default: %default]") + parser.add_option("-s", "--servicename", dest="servicename", type="string", default=DEFAULT_MOMQUERY_SERVICENAME, + help="Name for this service, [default: %default]") parser.add_option_group(dbcredentials.options_group(parser)) parser.set_defaults(dbcredentials="MoM") (options, args) = parser.parse_args() diff --git a/SAS/MoM/MoMQueryService/test/CMakeLists.txt b/SAS/MoM/MoMQueryService/test/CMakeLists.txt index ef7eebef1f6a3add44022865bb631f366a84634f..8840218b722fbb67e8fd3e20f0baf604aabcf739 100644 --- a/SAS/MoM/MoMQueryService/test/CMakeLists.txt +++ b/SAS/MoM/MoMQueryService/test/CMakeLists.txt @@ -6,5 +6,5 @@ find_python_module(mysql) find_python_module(testing.mysqld) find_python_module(mock) -lofar_add_test(test_momqueryservice) +lofar_add_test(t_momqueryservice) diff --git a/SAS/MoM/MoMQueryService/test/test_momqueryservice.py b/SAS/MoM/MoMQueryService/test/t_momqueryservice.py similarity index 77% rename from SAS/MoM/MoMQueryService/test/test_momqueryservice.py rename to SAS/MoM/MoMQueryService/test/t_momqueryservice.py index 8c7e57d3e5cfb3e1b432e8faaf50460e163f1579..452e017618fe3203e46280f5a28cb4dd5f11a88a 100755 --- a/SAS/MoM/MoMQueryService/test/test_momqueryservice.py +++ b/SAS/MoM/MoMQueryService/test/t_momqueryservice.py @@ -22,6 +22,7 @@ import unittest import uuid from mysql import connector import logging +import json logger = logging.getLogger(__name__) @@ -313,6 +314,7 @@ def populate_db(mysqld): Mysqld = testing.mysqld.MysqldFactory(cache_initialized_db=True, on_initialized=populate_db) + def tearDownModule(): # clear cached database at end of tests Mysqld.clear_cache() @@ -335,7 +337,6 @@ class TestProjectDetailsQueryHandler(unittest.TestCase): self.addCleanup(mom_database_wrapper_patcher.stop) self.mom_database_wrapper_mock = mom_database_wrapper_patcher.start() - self.project_details_query_handler = ProjectDetailsQueryHandler(dbcreds=self.database_credentials) self.project_details_query_handler.prepare_loop() @@ -346,7 +347,7 @@ class TestProjectDetailsQueryHandler(unittest.TestCase): self.assertTrue(return_value['active']) - def test_IsProjectActive_returns_active_flase_when_mom_wrapper_returns_false(self): + def test_IsProjectActive_returns_active_false_when_mom_wrapper_returns_false(self): self.mom_database_wrapper_mock().is_project_active.return_value = False return_value = self.project_details_query_handler.is_project_active(self.project_name) @@ -473,6 +474,37 @@ class TestProjectDetailsQueryHandler(unittest.TestCase): self.assertEqual(return_value["pi_email"], pi_email) + def test_get_time_restrictions_returns_what_the_mom_wrapper_returns(self): + min_start_time = "2017-01-01" + max_end_time = "2017-01-02" + min_duration = 300 + max_duration = 600 + + self.mom_database_wrapper_mock().get_time_restrictions.return_value = \ + {"minStartTime": min_start_time, "maxEndTime": max_end_time, + "minDuration": min_duration, "maxDuration": max_duration} + + result = self.project_details_query_handler.get_time_restrictions(1234) + + self.assertEqual(result["minStartTime"], min_start_time) + self.assertEqual(result["maxEndTime"], max_end_time) + self.assertEqual(result["minDuration"], min_duration) + self.assertEqual(result["maxDuration"], max_duration) + + def test_get_station_selection_returns_what_the_mom_wrapper_returns(self): + resource_group = "SuperTerp" + rg_min = 1 + rg_max = 3 + + self.mom_database_wrapper_mock().get_station_selection.return_value = \ + [{"resourceGroup": resource_group, "min": rg_min, "max": rg_max}] + + result = self.project_details_query_handler.get_station_selection(1234) + + self.assertEqual(result[0]["resourceGroup"], resource_group) + self.assertEqual(result[0]["min"], rg_min) + self.assertEqual(result[0]["max"], rg_max) + class TestMomQueryRPC(unittest.TestCase): test_id = 1234 @@ -549,32 +581,58 @@ class TestMomQueryRPC(unittest.TestCase): }) qpid_message_add_trigger_row_id = 33 - qpid_message_add_trigger = QpidMessage({"row_id": qpid_message_add_trigger_row_id}, - properties={ - "SystemName": "LOFAR", - "MessageType": "ReplyMessage", - "MessageId": message_id, - "status": "OK" - }) + qpid_message_add_trigger = QpidMessage({"row_id": qpid_message_add_trigger_row_id}, + properties={ + "SystemName": "LOFAR", + "MessageType": "ReplyMessage", + "MessageId": message_id, + "status": "OK" + }) author_email = "author@example.com" pi_email = "pi@example.com" qpid_message_get_project_details = QpidMessage({"author_email": author_email, "pi_email": pi_email}, - properties={ - "SystemName": "LOFAR", - "MessageType": "ReplyMessage", - "MessageId": message_id, - "status": "OK" - }) + properties={ + "SystemName": "LOFAR", + "MessageType": "ReplyMessage", + "MessageId": message_id, + "status": "OK" + }) test_priority = 42 qpid_message_get_project_priorities_for_objects = QpidMessage({str(test_id): test_priority}, - properties={ - "SystemName": "LOFAR", - "MessageType": "ReplyMessage", - "MessageId": message_id, - "status": "OK" - }) + properties={ + "SystemName": "LOFAR", + "MessageType": "ReplyMessage", + "MessageId": message_id, + "status": "OK" + }) + + min_start_time = "2017-01-01" + max_end_time = "2017-01-02" + min_duration = 300 + max_duration = 600 + qpid_message_get_time_restrictions = QpidMessage({"minStartTime": min_start_time, + "maxEndTime": max_end_time, + "minDuration": min_duration, + "maxDuration": max_duration}, + properties={ + "SystemName": "LOFAR", + "MessageType": "ReplyMessage", + "MessageId": message_id, + "status": "OK" + }) + + resourceGroup = "SuperTerp" + rg_min = 1 + rg_max = 3 + qpid_message_get_station_selection = QpidMessage([{"resourceGroup": resourceGroup, "min": rg_min, "max": rg_max}], + properties={ + "SystemName": "LOFAR", + "MessageType": "ReplyMessage", + "MessageId": message_id, + "status": "OK" + }) def setUp(self): # the mock library had difficulty to mock ToBus and FromBus probably to some weir naming issue. @@ -917,7 +975,6 @@ class TestMomQueryRPC(unittest.TestCase): self.assertEqual(result["author_email"], self.author_email) self.assertEqual(result["pi_email"], self.pi_email) - @mock.patch('lofar.messaging.messagebus.qpid.messaging') def test_get_project_priorities_for_objects_query(self, qpid_mock): self.receiver_mock.fetch.return_value = self.qpid_message_get_project_priorities_for_objects @@ -932,6 +989,35 @@ class TestMomQueryRPC(unittest.TestCase): self.assertEquals(self.test_id, result.keys()[0]) self.assertEqual(self.test_priority, result[self.test_id]) + @mock.patch('lofar.messaging.messagebus.qpid.messaging') + def test_get_time_restrictions_query(self, qpid_mock): + self.receiver_mock.fetch.return_value = self.qpid_message_get_time_restrictions + + qpid_mock.Message = QpidMessage + qpid_mock.Connection().session().senders = [self.sender_mock] + qpid_mock.Connection().session().next_receiver.return_value = self.receiver_mock + + result = self.momrpc.get_time_restrictions(self.test_id) + + self.assertEqual(result["minStartTime"], self.min_start_time) + self.assertEqual(result["maxEndTime"], self.max_end_time) + self.assertEqual(result["minDuration"], self.min_duration) + self.assertEqual(result["maxDuration"], self.max_duration) + + @mock.patch('lofar.messaging.messagebus.qpid.messaging') + def test_get_station_selection_query(self, qpid_mock): + self.receiver_mock.fetch.return_value = self.qpid_message_get_station_selection + + qpid_mock.Message = QpidMessage + qpid_mock.Connection().session().senders = [self.sender_mock] + qpid_mock.Connection().session().next_receiver.return_value = self.receiver_mock + + result = self.momrpc.get_station_selection(self.test_id) + + self.assertEqual(result[0]["resourceGroup"], self.resourceGroup) + self.assertEqual(result[0]["min"], self.rg_min) + self.assertEqual(result[0]["max"], self.rg_max) + class TestMoMDatabaseWrapper(unittest.TestCase): database_credentials = Credentials() @@ -1152,7 +1238,7 @@ class TestMoMDatabaseWrapper(unittest.TestCase): self.user_name, self.host_name, self.project_name, self.meta_data) def test_add_trigger_logs_end_of_query(self): - self.mysql_mock.connect().cursor().lastrowid = 34 + self.mysql_mock.connect().cursor().lastrowid = 34 result = self.mom_database_wrapper.add_trigger( self.user_name, self.host_name, self.project_name, self.meta_data) @@ -1181,7 +1267,7 @@ class TestMoMDatabaseWrapper(unittest.TestCase): self.mysql_mock.connect().cursor().fetchall.return_value = \ [{u'misc': '{"trigger_id": ' + str(self.trigger_id) + '}'}] - result = self.mom_database_wrapper.get_trigger_id(self.mom_id) + self.mom_database_wrapper.get_trigger_id(self.mom_id) self.logger_mock.info.assert_any_call("get_trigger_id for mom_id (%s): %s", self.mom_id, self.trigger_id) @@ -1223,7 +1309,7 @@ class TestMoMDatabaseWrapper(unittest.TestCase): self.assertEqual(result, expected_result) def test_get_project_priorities_for_objects_returns_priorities(self): - expected_result = {self.mom_id:self.project_priority} + expected_result = {self.mom_id: self.project_priority} details_result = [{"project_priority": self.project_priority, "object_mom2id": self.mom_id}] self.mysql_mock.connect().cursor().fetchall.return_value = details_result @@ -1231,6 +1317,91 @@ class TestMoMDatabaseWrapper(unittest.TestCase): self.assertEqual(result, expected_result) + def test_get_station_selection_returns_info_from_misc_field(self): + resource_group = "SuperTerp" + rg_min = 1 + rg_max = 3 + station_selection = [{"resourceGroup": resource_group, "min": rg_min, "max": rg_max}] + + expected_result = station_selection + details_result = [{u"mom2id": self.mom_id, u"mom2objecttype": self.job_type, + u"misc": json.dumps({u"stationSelection": station_selection})}] + self.mysql_mock.connect().cursor().fetchall.return_value = details_result + + result = self.mom_database_wrapper.get_station_selection(self.mom_id) + self.assertEqual(result, expected_result) + + def test_get_station_selection_throws_ValueError_on_empty_query_result(self): + self.mysql_mock.connect().cursor().fetchall.return_value = [] + + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_station_selection(1234) + + def test_get_station_selection_throws_ValueError_if_station_selection_not_present_in_misc(self): + details_result = [{u"mom2id": self.mom_id, u"mom2objecttype": self.job_type, + u"misc": json.dumps({u"timeWindow": {u'minDuration': 300, u'maxDuration': 300}})}] + self.mysql_mock.connect().cursor().fetchall.return_value = details_result + + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_station_selection(1234) + + def test_get_time_restrictions_returns_misc_field_info_from_query_result(self): + min_start_time = u"2017-01-01" + max_end_time = u"2017-01-04" + mom_starttime = u"2017-01-02" + mom_endtime = u"2017-01-03" + min_duration = 300 + max_duration = 600 + mom_duration = 400 + + timewindow = {u"minStartTime": min_start_time, + u"maxEndTime": max_end_time, + u"minDuration": min_duration, + u"maxDuration": max_duration} + expected_result = timewindow + + details_result = [{u"mom2id": self.mom_id, u"mom2objecttype": self.job_type, + u"misc": json.dumps({u"timeWindow": timewindow}), u"duration": mom_duration, + u"starttime": mom_starttime, u"endtime": mom_endtime}] + self.mysql_mock.connect().cursor().fetchall.return_value = details_result + + result = self.mom_database_wrapper.get_time_restrictions(self.mom_id) + self.assertEqual(result, expected_result) + + def test_get_time_restrictions_returns_mom_info_if_misc_empty_in_query_result(self): + mom_starttime = u"2017-01-02" + mom_endtime = u"2017-01-03" + mom_duration = 400 + + expected_result = {u"minStartTime": mom_starttime, + u"maxEndTime": mom_endtime, + u"minDuration": mom_duration, + u"maxDuration": mom_duration} + + details_result = [{u"mom2id": self.mom_id, u"mom2objecttype": self.job_type, + u"misc": None, u"duration": mom_duration, + u"starttime": mom_starttime, u"endtime": mom_endtime}] + self.mysql_mock.connect().cursor().fetchall.return_value = details_result + + result = self.mom_database_wrapper.get_time_restrictions(self.mom_id) + self.assertEqual(result, expected_result) + + def test_get_time_restrictions_throws_ValueError_on_empty_query_result(self): + + self.mysql_mock.connect().cursor().fetchall.return_value = [] + + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_time_restrictions(1234) + + def test_get_time_restrictions_throws_ValueError_if_no_time_restrictions_in_query_result(self): + details_result = [{u"mom2id": self.mom_id, u"mom2objecttype": self.job_type, + u"misc": None, u"duration": None, + u"starttime": None, u"endtime": None}] + self.mysql_mock.connect().cursor().fetchall.return_value = details_result + + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_time_restrictions(1234) + @unittest.skip("Skipping integration test") class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): @@ -1254,7 +1425,7 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): def setUp(self): logger.info('setting up test MoM database...') - self.mysqld = Mysqld() # for a fresh one, use: self.mysqld = testing.mysqld.Mysqld() + self.mysqld = Mysqld() # for a fresh one, use: self.mysqld = testing.mysqld.Mysqld() # set up fresh connection to the mom (!) database. self.connection = connector.connect(**self.mysqld.dsn()) @@ -1441,8 +1612,8 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): self.assertEqual(result, None) def test_get_trigger_id_returns_id_for_lofar_observation(self): - self.execute("insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " - "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + self.execute("insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', " + "'test-lofar', NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing self.execute("insert into lofar_observation values(83, 1, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") @@ -1457,8 +1628,8 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): self.assertEqual(result, self.trigger_id) def test_get_trigger_id_returns_none_for_lofar_observation_with_empty_misc(self): - self.execute("insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " - "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + self.execute("insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', " + "'test-lofar', NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing self.execute("insert into lofar_observation values(83, 2, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") @@ -1473,8 +1644,8 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): self.assertEqual(result, None) def test_get_trigger_id_returns_none_for_lofar_observation_with_empty_json(self): - self.execute("insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " - "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + self.execute("insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', " + "'test-lofar', NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing self.execute("insert into lofar_observation values(83, 2, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") @@ -1495,7 +1666,8 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): # id, mom2objectid, starttime, endtime, pipeline_id, pending, template, runtimeDirectory, resultDirectory, workingDirectory, parset, nr_output_correlated, nr_output_beamformed, nr_output_instrument_model, nr_output_skyimage, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_instrument_model_valid, nr_output_skyimage_valid, feedback, demixing_parameters_id, bbs_parameters_id, duration, storage_cluster_id, processing_cluster_id, misc self.execute("insert into lofar_pipeline values(1761, 1, NULL, NULL, 63722, 0, " "'Calibration Pipeline Calibrator', NULL, NULL, NULL, 'parset', 0, NULL, 244, NULL, 0, 0, NULL, 0," - " NULL, 3071, 3071, NULL, NULL, NULL, '{\"trigger_id\": %(trigger_id)s}')" % {"trigger_id": self.trigger_id}) + " NULL, 3071, 3071, NULL, NULL, NULL, '{\"trigger_id\": %(trigger_id)s}')" + % {"trigger_id": self.trigger_id}) result = self.mom_database_wrapper.get_trigger_id("2") @@ -1508,12 +1680,13 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): def test_get_project_details_returns_correct_emails_with_filled_database(self): self.execute("insert into mom2object " - "values(111, NULL, NULL, 2334, 'PROJECT', 'CEP4tests', 'Project for CEP4 tests', NULL, 1725713, NULL, NULL, 0, NULL, NULL);") + "values(111, NULL, NULL, 2334, 'PROJECT', 'CEP4tests', 'Project for CEP4 tests', " + "NULL, 1725713, NULL, NULL, 0, NULL, NULL);") self.execute("insert into member " - "values(1, 111, 0);") + "values(1, 111, 0);") self.execute("insert into member " - "values(2, 111, 0);") + "values(2, 111, 0);") self.execute("insert into registeredmember " "values(1, 1, 1);") @@ -1553,16 +1726,16 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): pname = 'myproject_'+str(1) self.execute("insert into mom2object values(%s, NULL, NULL, %s, 'PROJECT', '%s', 'x', " - "NULL, %s, NULL, NULL, 0, 0, 0)" - % (1, 1, pname, statusid)) + "NULL, %s, NULL, NULL, 0, 0, 0)" + % (1, 1, pname, statusid)) self.execute("insert into project values(%s, %s, '2012-09-14', FALSE, 0)" - % (1, 1)) + % (1, 1)) self.execute("insert into mom2object values(%s, NULL, NULL, %s , 'OBSERVATION', 'x', " - "'x', %s, %s, 'x', 'x', 0, NULL," - " 0)" - % (2, oid, 1, statusid)) + "'x', %s, %s, 'x', 'x', 0, NULL," + " 0)" + % (2, oid, 1, statusid)) self.execute("insert into status values(%s, '%s', 'OBSERVATION', %s)" % (statusid, status, statusid)) @@ -1576,8 +1749,6 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): self.assertEqual(result[str(oid)]['object_status'], status) self.assertEqual(result[str(oid)]['project_name'], pname) - - def test_get_project_priorities_for_objects_returns_correct_priorities(self): object_ids = [3344, 1234, 7654] project_prios = [42, 24, 12] @@ -1608,13 +1779,11 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): prio = return_value[oid] self.assertEqual(prio, expected_prio) - def test_get_project_priorities_for_objects_returns_empty_dict_on_empty_database(self): return_value = self.mom_database_wrapper.get_project_priorities_for_objects("1234") self.assertEqual(return_value, {}) - def test_get_project_priorities_for_objects_returns_only_priorities_of_existing_objects(self): object_ids = [380, 747] @@ -1633,12 +1802,12 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): % (eid, eid, 'myproject_'+str(i))) self.execute("insert into project values(%s, %s, '2012-09-14', FALSE, %s)" - % (eid, eid, prio)) # unique id in project table, refer to mom2object of our project + % (eid, eid, prio)) # unique id in project table, refer to mom2object of our project self.execute("insert into mom2object values(%s, NULL, NULL, %s , 'PIPELINE', 'x', " "'x', %s, NULL, 'x', 'x', 0, NULL," " 0)" - % (eid+100, oid, eid)) # unique id for the pipeline, refer to project id + % (eid+100, oid, eid)) # unique id for the pipeline, refer to project id return_value = self.mom_database_wrapper.get_project_priorities_for_objects(object_ids + [extra_id]) @@ -1646,6 +1815,124 @@ class IntegrationTestMoMDatabaseWrapper(unittest.TestCase): self.assertTrue(oid in return_value.keys()) self.assertFalse(extra_id in return_value.keys()) + def test_get_time_restrictions_throws_ValueError_on_empty_database(self): + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_time_restrictions(1234) + + def test_get_time_restrictions_throws_ValueError_if_no_time_restrictions_in_database(self): + + self.execute( + "insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " + "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing + self.execute("insert into lofar_observation values(83, 1, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," + " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") + # id, type, correlated_data, filtered_data, beamformed_data, coherent_stokes_data, incoherent_stokes_data, antenna, clock_mode, instrument_filter, integration_interval, channels_per_subband, cn_integration_steps, pencilbeams_flyseye, pencilbeams_nr_pencil_rings, pencilbeams_ring_size, stokes_selection, stokes_integrate_channels, stokes_integration_steps, station_set, timeframe, starttime, endtime, spec_duration, coherent_dedisperse_channels, dispersion_measure, subbands_per_file_cs, subbands_per_file_bf, collapsed_channels_cs, collapsed_channels_is, downsampling_steps_cs, downsampling_steps_is, which_cs, which_is, bypass_pff, enable_superterp, flyseye, tab_nr_rings, tab_ring_size, bits_per_sample, misc + self.execute("insert into lofar_observation_specification values(47, 'USER', 1, 0, 0, 0, 0, 'HBA Dual', " + "'160 MHz', '170-230 MHz', 1, NULL, NULL, 0, NULL, NULL, NULL, 0, NULL, 'Custom', NULL, NULL, " + "NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, " + "16, NULL)") + + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_time_restrictions(2) + + def test_get_time_restrictions_returns_correct_time_restrictions(self): + min_start_time = "2017-01-01" + max_end_time = "2017-01-02" + min_duration = 300 + max_duration = 600 + + self.execute( + "insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " + "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing + self.execute("insert into lofar_observation values(83, 1, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," + " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") + # id, type, correlated_data, filtered_data, beamformed_data, coherent_stokes_data, incoherent_stokes_data, antenna, clock_mode, instrument_filter, integration_interval, channels_per_subband, cn_integration_steps, pencilbeams_flyseye, pencilbeams_nr_pencil_rings, pencilbeams_ring_size, stokes_selection, stokes_integrate_channels, stokes_integration_steps, station_set, timeframe, starttime, endtime, spec_duration, coherent_dedisperse_channels, dispersion_measure, subbands_per_file_cs, subbands_per_file_bf, collapsed_channels_cs, collapsed_channels_is, downsampling_steps_cs, downsampling_steps_is, which_cs, which_is, bypass_pff, enable_superterp, flyseye, tab_nr_rings, tab_ring_size, bits_per_sample, misc + self.execute("insert into lofar_observation_specification values(47, 'USER', 1, 0, 0, 0, 0, 'HBA Dual', " + "'160 MHz', '170-230 MHz', 1, NULL, NULL, 0, NULL, NULL, NULL, 0, NULL, 'Custom', NULL, NULL, " + "NULL, %s, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, " + "16, '{\"timeWindow\":{\"minStartTime\": \"%s\", \"maxEndTime\": \"%s\", \"minDuration\": %s, " + "\"maxDuration\": %s}}')" + % (min_duration, min_start_time, max_end_time, min_duration, max_duration)) + + result = self.mom_database_wrapper.get_time_restrictions(2) + + self.assertEqual(result["minStartTime"], min_start_time) + self.assertEqual(result["maxEndTime"], max_end_time) + self.assertEqual(result["minDuration"], min_duration) + self.assertEqual(result["maxDuration"], max_duration) + + def test_get_time_restrictions_returns_mom_duration_if_misc_empty(self): + duration = 300 + + self.execute( + "insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " + "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing + self.execute("insert into lofar_observation values(83, 1, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," + " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") + # id, type, correlated_data, filtered_data, beamformed_data, coherent_stokes_data, incoherent_stokes_data, antenna, clock_mode, instrument_filter, integration_interval, channels_per_subband, cn_integration_steps, pencilbeams_flyseye, pencilbeams_nr_pencil_rings, pencilbeams_ring_size, stokes_selection, stokes_integrate_channels, stokes_integration_steps, station_set, timeframe, starttime, endtime, spec_duration, coherent_dedisperse_channels, dispersion_measure, subbands_per_file_cs, subbands_per_file_bf, collapsed_channels_cs, collapsed_channels_is, downsampling_steps_cs, downsampling_steps_is, which_cs, which_is, bypass_pff, enable_superterp, flyseye, tab_nr_rings, tab_ring_size, bits_per_sample, misc + self.execute("insert into lofar_observation_specification values(47, 'USER', 1, 0, 0, 0, 0, 'HBA Dual', " + "'160 MHz', '170-230 MHz', 1, NULL, NULL, 0, NULL, NULL, NULL, 0, NULL, 'Custom', NULL, NULL, " + "NULL, %s, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, " + "16, NULL)" % duration) + + result = self.mom_database_wrapper.get_time_restrictions(2) + + self.assertEqual(result["minDuration"], duration) + self.assertEqual(result["maxDuration"], duration) + + def test_get_station_selection_throws_ValueError_on_empty_database(self): + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_station_selection(1234) + + def test_get_station_selection_throws_ValueError_if_not_present_in_misc(self): + + self.execute( + "insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " + "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing + self.execute("insert into lofar_observation values(83, 1, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," + " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") + # id, type, correlated_data, filtered_data, beamformed_data, coherent_stokes_data, incoherent_stokes_data, antenna, clock_mode, instrument_filter, integration_interval, channels_per_subband, cn_integration_steps, pencilbeams_flyseye, pencilbeams_nr_pencil_rings, pencilbeams_ring_size, stokes_selection, stokes_integrate_channels, stokes_integration_steps, station_set, timeframe, starttime, endtime, spec_duration, coherent_dedisperse_channels, dispersion_measure, subbands_per_file_cs, subbands_per_file_bf, collapsed_channels_cs, collapsed_channels_is, downsampling_steps_cs, downsampling_steps_is, which_cs, which_is, bypass_pff, enable_superterp, flyseye, tab_nr_rings, tab_ring_size, bits_per_sample, misc + self.execute("insert into lofar_observation_specification values(47, 'USER', 1, 0, 0, 0, 0, 'HBA Dual', " + "'160 MHz', '170-230 MHz', 1, NULL, NULL, 0, NULL, NULL, NULL, 0, NULL, 'Custom', NULL, NULL, " + "NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, " + "16, '{\"timeWindow\":{\"minDuration\": 300, \"maxDuration\": 600}}')") + + with self.assertRaises(ValueError): + self.mom_database_wrapper.get_station_selection(1234) + + def test_get_station_selection_returns_correct_station_selection(self): + resource_group = "SuperTerp" + rg_min = 4 + rg_max = 9 + resource_group2 = "CS001" + rg_min2 = 1 + + self.execute( + "insert into mom2object values(1, NULL, NULL, 2, 'LOFAR_OBSERVATION', '%(project_name)s', 'test-lofar', " + "NULL, 1704653, NULL, NULL, 0, 0, 0)" % {"project_name": self.project_name}) + # id, mom2objectid, observation_id, instrument, user_specification_id, system_specification_id, default_template, tbb_template, tbb_piggyback_allowed, parset, nr_output_correlated, nr_output_beamformed, nr_output_coherent_stokes, nr_output_incoherent_stokes, nr_output_flyseye, nr_output_correlated_valid, nr_output_beamformed_valid, nr_output_coherent_stokes_valid, nr_output_incoherent_stokes_valid, nr_output_flyseye_valid, feedback, aartfaac_piggyback_allowed, storage_cluster_id, processing_cluster_id, nico_testing + self.execute("insert into lofar_observation values(83, 1, NULL, 'Interferometer', 47, 48, NULL, NULL, 0," + " NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL)") + # id, type, correlated_data, filtered_data, beamformed_data, coherent_stokes_data, incoherent_stokes_data, antenna, clock_mode, instrument_filter, integration_interval, channels_per_subband, cn_integration_steps, pencilbeams_flyseye, pencilbeams_nr_pencil_rings, pencilbeams_ring_size, stokes_selection, stokes_integrate_channels, stokes_integration_steps, station_set, timeframe, starttime, endtime, spec_duration, coherent_dedisperse_channels, dispersion_measure, subbands_per_file_cs, subbands_per_file_bf, collapsed_channels_cs, collapsed_channels_is, downsampling_steps_cs, downsampling_steps_is, which_cs, which_is, bypass_pff, enable_superterp, flyseye, tab_nr_rings, tab_ring_size, bits_per_sample, misc + self.execute("insert into lofar_observation_specification values(47, 'USER', 1, 0, 0, 0, 0, 'HBA Dual', " + "'160 MHz', '170-230 MHz', 1, NULL, NULL, 0, NULL, NULL, NULL, 0, NULL, 'Custom', NULL, NULL, " + "NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, " + "16, '{\"stationSelection\": [{\"resourceGroup\": \"%s\", \"min\": %s, \"max\": %s}, " + "{\"resourceGroup\": \"%s\", \"min\": %s}]}')" % (resource_group, rg_min, rg_max, + resource_group2, rg_min2)) + + result = self.mom_database_wrapper.get_station_selection(2) + + self.assertEqual(result[0]["resourceGroup"], resource_group) + self.assertEqual(result[0]["min"], rg_min) + self.assertEqual(result[0]["max"], rg_max) + self.assertEqual(result[1]["resourceGroup"], resource_group2) + self.assertEqual(result[1]["min"], rg_min2) + if __name__ == "__main__": logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO) diff --git a/SAS/MoM/MoMQueryService/test/t_momqueryservice.run b/SAS/MoM/MoMQueryService/test/t_momqueryservice.run new file mode 100755 index 0000000000000000000000000000000000000000..0e4120028ae4d3a46a2d22d07884ccfbaa911a4c --- /dev/null +++ b/SAS/MoM/MoMQueryService/test/t_momqueryservice.run @@ -0,0 +1,5 @@ +#!/bin/bash + +# Run the unit test +source python-coverage.sh +python_coverage_test "MoMQueryService/*" t_momqueryservice.py diff --git a/SAS/MoM/MoMQueryService/test/t_momqueryservice.sh b/SAS/MoM/MoMQueryService/test/t_momqueryservice.sh new file mode 100755 index 0000000000000000000000000000000000000000..cd4cc2f294db2ecdd82faa9d95966e5f313c65ec --- /dev/null +++ b/SAS/MoM/MoMQueryService/test/t_momqueryservice.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./runctest.sh t_momqueryservice diff --git a/SAS/MoM/MoMQueryService/test/test_momqueryservice.run b/SAS/MoM/MoMQueryService/test/test_momqueryservice.run deleted file mode 100755 index 9553d2fdcfe704c6655b35b6b10d60229ca084d8..0000000000000000000000000000000000000000 --- a/SAS/MoM/MoMQueryService/test/test_momqueryservice.run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Run the unit test -source python-coverage.sh -python_coverage_test "MoMQueryService/*" test_momqueryservice.py diff --git a/SAS/MoM/MoMQueryService/test/test_momqueryservice.sh b/SAS/MoM/MoMQueryService/test/test_momqueryservice.sh deleted file mode 100755 index 488e7f88ef29f3efbda2cda3da7aa43560f23374..0000000000000000000000000000000000000000 --- a/SAS/MoM/MoMQueryService/test/test_momqueryservice.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./runctest.sh test_momqueryservice diff --git a/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py b/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py index 5552c7aec14a93c03ccd3e343ab9976453e689c5..21e23eb40ae6d57654f0fa6df2b7f424994dc154 100644 --- a/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py +++ b/SAS/SpecificationServices/lib/lofarxml_to_momxmlmodel_translator.py @@ -24,14 +24,15 @@ from lxml import etree from StringIO import StringIO from lofar.specificationservices.telescope_model import TelescopeModel +from lofar.specificationservices.specification_service import _parse_relation_tree class LofarXMLToMomXMLModelTranslator(object): - def generate_model(self, lofar_spec): doc = etree.parse(StringIO(lofar_spec.encode('UTF-8'))) - project_codes = doc.xpath('/spec:specification/projectReference/ProjectCode', namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + project_codes = doc.xpath('/spec:specification/projectReference/ProjectCode', + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) project_name = project_codes[0].text @@ -39,12 +40,20 @@ class LofarXMLToMomXMLModelTranslator(object): model = TelescopeModel() model.start_time = self._get_start_time(doc) + model.end_time = self._get_start_time(doc) + model.min_start_time = self._get_min_start_time(doc) + model.max_end_time = self._get_max_end_time(doc) model.duration = self._get_duration(doc) + model.min_duration = self._get_min_duration(doc) + model.max_duration = self._get_max_duration(doc) model.target_ra = self._get_target_ra(doc) model.target_dec = self._get_target_dec(doc) model.calibrator_ra = self._get_calibrator_ra(doc) model.calibrator_dec = self._get_calibrator_dec(doc) model.trigger_id = self._get_trigger_id(doc) + model.station_selection, model.custom_station_list = self._get_station_selection_and_list(doc) + model.outer_foldername = self._get_outer_foldername(doc) + model.inner_foldername = self._get_inner_foldername(doc) return model else: @@ -54,13 +63,81 @@ class LofarXMLToMomXMLModelTranslator(object): start_times = doc.xpath('/spec:specification/activity/observation/timeWindowSpecification/startTime', namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) - return start_times[0].text + if start_times: + return start_times[0].text + else: + return None + + def _get_min_start_time(self, doc): + min_start_times = doc.xpath('/spec:specification/activity/observation/timeWindowSpecification/minStartTime', + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + + if min_start_times: + return min_start_times[0].text + else: + return None + + def _get_max_end_time(self, doc): + max_end_times = doc.xpath('/spec:specification/activity/observation/timeWindowSpecification/maxEndTime', + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + + if max_end_times: + return max_end_times[0].text + else: + return None + + def _get_min_duration(self, doc): + min_duration = doc.xpath('/spec:specification/activity/observation/timeWindowSpecification/duration/minimumDuration', + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + + if min_duration: + return min_duration[0].text + else: + return None + + def _get_max_duration(self, doc): + max_duration = doc.xpath('/spec:specification/activity/observation/timeWindowSpecification/duration/maximumDuration', + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + + if max_duration: + return max_duration[0].text + else: + return None def _get_duration(self, doc): durations = doc.xpath('/spec:specification/activity/observation/timeWindowSpecification/duration/duration', - namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) - return durations[0].text + if durations: + return durations[0].text + else: + return None + + def _get_station_selection_and_list(self, doc): + """ + Parses the station selection specificatoon and returns a dict with resource groups and min values as well as + a list of station names parsed from the custom station set. These custom stations are also already included + in the resourcegroup dictionary with minimum value 1. + """ + selections = doc.xpath('/spec:specification/activity/observation/stationSelectionSpecification/stationSelection', + namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) + + station_selection = {} + station_list = [] + for selection in selections: + station_set = selection.xpath("stationSet")[0].text + if station_set == "Custom": + stations = selection.xpath("stations/station") + for station in stations: + stationname = station.xpath("name")[0].text + station_selection.update({stationname: 1}) + station_list.append(stationname) + + else: + min_constraint = selection.xpath("minimumConstraint")[0].text + station_selection.update({station_set: min_constraint}) + + return station_selection, station_list def _get_target_ra(self, doc): target_beam = self._get_target_beam(doc) @@ -86,7 +163,8 @@ class LofarXMLToMomXMLModelTranslator(object): def _get_beam(self, doc, beam_name): beam_measurements = doc.xpath('/spec:specification/activity/measurement[@xsi:type="base:BeamMeasurement"]', - namespaces={"spec": "http://www.astron.nl/LofarSpecification", "xsi": "http://www.w3.org/2001/XMLSchema-instance"}) + namespaces={"spec": "http://www.astron.nl/LofarSpecification", + "xsi": "http://www.w3.org/2001/XMLSchema-instance"}) for beam_measurement in beam_measurements: name = beam_measurement.xpath("name") @@ -97,4 +175,49 @@ class LofarXMLToMomXMLModelTranslator(object): identifier = doc.xpath('/spec:specification/activity/triggerId/identifier', namespaces={"spec": "http://www.astron.nl/LofarSpecification"}) - return identifier[0].text \ No newline at end of file + return int(identifier[0].text) + + def _get_folder_relations_and_names(self, doc): + """ + parses folder relations and returns two dicts to look up parent folder and folder name for a given folder id + :param doc: ElementTree + :return: (dict, dict) + """ + spec = doc.getroot() + _, parentfolders, foldernames = _parse_relation_tree(spec) + return parentfolders, foldernames + + def _get_inner_foldername(self, doc): + """ + determine inner folder name for type 1 lofar specs + :param doc: ElementTree + :return: string + """ + parentfolders, foldernames = self._get_folder_relations_and_names(doc) + # parentfolders contains key-value pairs of folder-folder relations + # type 1 triggers only have one inner folder (so the following does not work for type 2) + if len(parentfolders) == 0: + raise Exception('There seems to be no inner folder!') + if len(parentfolders) > 1: + raise Exception('There seems to be more than one inner folder: ' + str(parentfolders.keys())) + inner_folder_key = parentfolders.keys()[0] + name = foldernames[inner_folder_key] + return name + + def _get_outer_foldername(self, doc): + """ + determine outermost folder name in lofar specs + :param doc: ElementTree + :return: string + """ + parentfolders, foldernames = self._get_folder_relations_and_names(doc) + # parentfolders contains key-value pairs of folder-folder relations + # trigger templates only allow for one outer folder (this should work for types 1 and 2) + if len(parentfolders) == 0: + raise Exception('There seems to be no outer folder!') + if not all(value == parentfolders.values()[0] for value in parentfolders.values()): + # there are folders with different parents, i.e. there is a deeper hierarchy or several parent folders. + raise Exception('There seems to be more then one outer folder: ' + str(parentfolders.values())) + outer_folder_key = parentfolders.values()[0] + name = foldernames[outer_folder_key] + return name diff --git a/SAS/SpecificationServices/lib/specification_service.py b/SAS/SpecificationServices/lib/specification_service.py index edec3489e7cef545682d17b996669f045d9d6a73..3d264545aa15183ed6e8ba7ea9e4178e0b07704c 100644 --- a/SAS/SpecificationServices/lib/specification_service.py +++ b/SAS/SpecificationServices/lib/specification_service.py @@ -143,9 +143,9 @@ def _check_specification(user, lofar_xml): raise Exception("Unexpected root element: ", spec.tag) activity_paths = _parse_activity_paths(spec) - # for path in activity_paths.values(): - # if _folderExists(path): - # raise Exception("Innermost folder already exists: "+path) + for path in activity_paths.values(): + if _folderExists(path): + raise Exception("Innermost folder already exists: "+path) project = _parse_project_code(spec) if not _isActive(project): @@ -153,10 +153,12 @@ def _check_specification(user, lofar_xml): activities = spec.findall('activity') for activity in activities: - key = (activity.find("temporaryIdentifier").find("source").text , activity.find("temporaryIdentifier").find("identifier").text) + key = (activity.find("temporaryIdentifier").find("source").text , + activity.find("temporaryIdentifier").find("identifier").text) if not key in activity_paths.keys(): # allow measurements, which are activities, but not contained in folders by definition! - # todo: check, is this what we want? Or do we have to do attional checks, e.g. that the obs-measurement relation and the parent obs exists? + # todo: check, is this what we want? Or do we have to do attional checks, + # todo: e.g. that the obs-measurement relation and the parent obs exists? if not activity.find("measurement") is not None: raise Exception("Specified action has to be in folder: "+str(key)) jobtype = None @@ -166,12 +168,14 @@ def _check_specification(user, lofar_xml): break logger.warning("!!! %s not found..." % (action,)) if jobtype is None: - raise Exception("Specified activity is not permitted: " + str(key) + " -> "+ str(permitted_activities)+" not found in "+ str(activity.getchildren())) + raise Exception("Specified activity is not permitted: " + str(key) + " -> "+ str(permitted_activities) + + " not found in "+ str(activity.getchildren())) status = activity.find("status") if status is None: raise Exception("Activity has no status: "+str(key) ) if status.text not in permitted_statuses: - raise Exception("Specified activity is not going to permitted status: " + str(key) + " -> '"+str(status.text) + "' not in "+str(permitted_statuses)) + raise Exception("Specified activity is not going to permitted status: " + str(key) + " -> '" + + str(status.text) + "' not in "+str(permitted_statuses)) # measurements require observation permissions if jobtype == "measurement": diff --git a/SAS/SpecificationServices/lib/telescope_model.py b/SAS/SpecificationServices/lib/telescope_model.py index 6646b288367b5dcc77bc6112674d0ef921410e20..bcef48350ba665b123b981ca2235286bc04d5892 100644 --- a/SAS/SpecificationServices/lib/telescope_model.py +++ b/SAS/SpecificationServices/lib/telescope_model.py @@ -29,5 +29,14 @@ class TelescopeModel: self.calibrator_ra = None self.calibrator_dec = None self.start_time = None + self.min_start_time = None + self.max_end_time = None self.duration = None + self.min_duration = None + self.max_duration = None self.trigger_id = None + self.station_selection = None # for misc field + self.custom_station_list = None # custom stationset for mom + self.outer_foldername = None + self.inner_foldername = None + diff --git a/SAS/SpecificationServices/lib/telescope_model_xml_generator_type1.py b/SAS/SpecificationServices/lib/telescope_model_xml_generator_type1.py index ad0a8756f0b4262910d12c3815f3369e78ee63a5..3306ebb865441dbb32b9626bede5f07c3e2bc14b 100644 --- a/SAS/SpecificationServices/lib/telescope_model_xml_generator_type1.py +++ b/SAS/SpecificationServices/lib/telescope_model_xml_generator_type1.py @@ -24,6 +24,7 @@ import os from lxml import etree from StringIO import StringIO from config import TELESCOPE_MODEL_TYPE1_XML +import json from lofar.specificationservices.telescope_model import TelescopeModel @@ -48,7 +49,16 @@ class TelescopeModelXMLGeneratorType1(object): self._set_target_dec(root_element, telescope_model.target_dec) self._set_calibrator_ra(root_element, telescope_model.calibrator_ra) self._set_calibrator_dec(root_element, telescope_model.calibrator_dec) - self._set_trigger_id(root_element, telescope_model.trigger_id) + self._add_trigger_id_to_misc(root_element, telescope_model.trigger_id) + self._add_time_window_to_misc(root_element, + telescope_model.min_start_time, + telescope_model.max_end_time, + telescope_model.min_duration, + telescope_model.max_duration) + self._add_station_selection_to_misc(root_element, telescope_model.station_selection) + self._set_stations(root_element, telescope_model.custom_station_list) + self._set_inner_foldername(root_element, telescope_model.inner_foldername ) + self._set_outer_foldername(root_element, telescope_model.outer_foldername) return xmldoc @@ -63,14 +73,20 @@ class TelescopeModelXMLGeneratorType1(object): user_spec = element.find(".//userSpecification") _start_time = user_spec.find("startTime") - _start_time.text = start_time + if start_time: + _start_time.text = start_time + else: + user_spec.remove(_start_time) @staticmethod def _set_duration(element, duration): _user_spec = element.find(".//userSpecification") _duration = _user_spec.find("duration") - _duration.text = duration + if duration: + _duration.text = duration + else: + _user_spec.remove(_duration) def _set_target_ra(self, element, ra): measurement = self._get_specification_by_name(element, "Target") @@ -92,13 +108,78 @@ class TelescopeModelXMLGeneratorType1(object): _dec = measurement.find("dec") _dec.text = dec - def _set_trigger_id(self, element, trigger_id): - misc_json = '{"trigger_id": %s}' % trigger_id - + def _add_to_misc(self, element, to_add): + """ + adds dict to_add to all misc fields + Note: will not traverse, so dict keys should not be present already! + """ miscs = element.findall(".//misc") - for misc in miscs: - misc.text = misc_json + if misc.text: + m = json.loads(misc.text) + else: + m = {} + m.update(to_add) + misc.text = json.dumps(m) + + def _add_trigger_id_to_misc(self, element, trigger_id): + t = {"trigger_id": trigger_id} + self._add_to_misc(element, t) + + def _add_station_selection_to_misc(self, element, station_selection): + if station_selection: + groups = [] + for resource_group, minimum in station_selection.iteritems(): + groups.append({"resourceGroup": resource_group, "min": minimum}) + s = {"stationSelection": groups} + self._add_to_misc(element, s) + + def _add_time_window_to_misc(self, element, min_start_time, max_end_time, min_duration, max_duration): + items = {} + if min_start_time: + items.update({'minStartTime': min_start_time}) + if max_end_time: + items.update({'maxEndTime': max_end_time}) + if min_duration: + items.update({'minDuration': min_duration}) + if max_duration: + items.update({'maxDuration': max_duration}) + if len(items) > 0: + tw = {'timeWindow': items} + self._add_to_misc(element, tw) + + @staticmethod + def _set_stations(element, station_list): + """ + This takes a list of station names and replaces the current set under .//userSpecification.stations. + """ + user_spec = element.find(".//userSpecification") + stations = user_spec.find("stations") + + # remove all existing station elements + for station in stations.xpath('station'): + stations.remove(station) + + # add new ones + if station_list: + for stationname in station_list: + station = etree.Element('station', name=stationname) + stations.append(station) + + def _set_inner_foldername(self, element, foldername): + """ + set name on first sub-folder in first folder on element (inner folder on type 1 template) + """ + folder = element.find('.//lofar:folder', namespaces=element.nsmap) + innerfolder = folder.find('.//lofar:folder', namespaces=element.nsmap) + innerfolder.find('name').text = foldername + + def _set_outer_foldername(self, element, foldername): + """ + set name on first folder on element + """ + folder = element.find('.//lofar:folder', namespaces=element.nsmap) + folder.find('name').text = foldername @staticmethod def _get_specification_by_name(element, name): @@ -108,3 +189,4 @@ class TelescopeModelXMLGeneratorType1(object): for e in s.iter(): if e.tag == "targetName" and e.text == name: return s + diff --git a/SAS/SpecificationServices/lib/translation_service.py b/SAS/SpecificationServices/lib/translation_service.py index 8304aa1a675a37b0a401763267ebac111e5fd5c0..196f8bf02b3ae59d11fa16051699296abebe3d0b 100644 --- a/SAS/SpecificationServices/lib/translation_service.py +++ b/SAS/SpecificationServices/lib/translation_service.py @@ -153,7 +153,8 @@ MOM_ACTIVITY_ATTRIBUTE_MAPPING = OrderedDict([ ("measurement::dec","measurement::measurementAttributes"), ("measurement::equinox","measurement::measurementAttributes"), ("measurement::subbandsSpecification","measurement::measurementAttributes"), - ("measurement::tiedArrayBeams","measurement::measurementAttributes::specification"), # todo: If used, LofarBeamMeasurementSpecificationAttributesType requires more items! + ("measurement::tiedArrayBeams","measurement::measurementAttributes::specification"), + # todo: If used, LofarBeamMeasurementSpecificationAttributesType requires more items! ("measurement::measurementType","measurement::measurementAttributes"), # todo: add other measurements? Currently not defined on LofarBase.xsd, so these cannot occur... ]) @@ -287,7 +288,8 @@ def _create_foldertree_in_momproject(spec, mom_project): # Not only containers can contain children, but also activities. # Determine measurement -> parent observation mapping. - observation_measurement = [(x.find("parent"), x.find("child")) for x in spec.findall("relation") if x.find("type").text == "observation-measurement"] + observation_measurement = [(x.find("parent"), x.find("child")) for x in spec.findall("relation") + if x.find("type").text == "observation-measurement"] observation_acts = [x for x in spec.findall('activity') if x.find('observation') is not None] observations = {} @@ -362,7 +364,8 @@ def _mommify(activity): momtype = t.split(':')[1] momtype_cc = momtype[:1].lower() + momtype[1:] except ValueError as err: - logger.error("Could not determine a more specific MoM type from type attribute for the activity -> "+str(activitytype)+" "+str(err)) + logger.error("Could not determine a more specific MoM type from type attribute for the activity -> " + +str(activitytype)+" "+str(err)) # momtype/_cc should now be present for pipelines/measurements but not observations # restructure elements according to mapping.: @@ -390,10 +393,12 @@ def _mommify(activity): # jsonify new specs that MoM does not know about and put them as json in misc element: if momtype_cc is not None: # use the specific type if present (pipelines/measurements) - atts = _find_or_create_subelement(act, "{http://www.astron.nl/MoM2-Lofar}"+str(momtype_cc)+"Attributes") + atts = _find_or_create_subelement(act, "{http://www.astron.nl/MoM2-Lofar}" + +str(momtype_cc)+"Attributes") userspec = _find_or_create_subelement(atts,'userSpecification', 0) # goes first here else: - atts = _find_or_create_subelement(act, "{http://www.astron.nl/MoM2-Lofar}"+str(activitytype)+"Attributes") + atts = _find_or_create_subelement(act, "{http://www.astron.nl/MoM2-Lofar}" + +str(activitytype)+"Attributes") userspec = _find_or_create_subelement(atts,'userSpecification') json = _encode_mom_extraspecs(activity) misc = _find_or_create_subelement(userspec, "misc") @@ -406,14 +411,16 @@ def _mommify(activity): momact = etree.SubElement(item, "{http://www.astron.nl/MoM2-Lofar}"+str(activitytype)) if momtype: # set an xsi:type according to the one on the lofar spec actvity - momact.attrib["{http://www.w3.org/2001/XMLSchema-instance}type"] = "lofar:"+str(momtype)+"Type" # todo: better look up namespace identifier from nsmap. + momact.attrib["{http://www.w3.org/2001/XMLSchema-instance}type"] = "lofar:"+str(momtype)+"Type" + # todo: better look up namespace identifier from nsmap. for child in act.getchildren(): # move stuff to new mom element momact.append(child) return item - raise Exception("Cannot translate activity for MoM! -> "+ str(ACTIVITY_TYPES) + " not found in "+str(activity.getchildren())) + raise Exception("Cannot translate activity for MoM! -> "+ str(ACTIVITY_TYPES) + + " not found in "+str(activity.getchildren())) class SpecificationTranslationHandler(MessageHandlerInterface): diff --git a/SAS/SpecificationServices/lib/translation_service_rpc.py b/SAS/SpecificationServices/lib/translation_service_rpc.py index d17865d22d99a4ca9433a7456018ca7ab1339441..ec1ef52f83b02612e45fa32d96c11aa4cc4f2de5 100644 --- a/SAS/SpecificationServices/lib/translation_service_rpc.py +++ b/SAS/SpecificationServices/lib/translation_service_rpc.py @@ -16,7 +16,10 @@ class TranslationRPC(RPCWrapper): def trigger_to_specification(self, trigger_spec, trigger_id, job_priority): logger.info("Requesting validation of trigger XML") - result = self.rpc('trigger_to_specification', trigger_spec=trigger_spec, trigger_id=trigger_id, job_priority=job_priority) + result = self.rpc('trigger_to_specification', + trigger_spec=trigger_spec, + trigger_id=trigger_id, + job_priority=job_priority) logger.info("Received validation result -> " +str(result)) return result diff --git a/SAS/SpecificationServices/test/CMakeLists.txt b/SAS/SpecificationServices/test/CMakeLists.txt index 2fca57b951ba4bedeca0816f9a9d28d9b64b308f..c732ab6e5c9d459a5eee0b5ae82ad547e890bcec 100644 --- a/SAS/SpecificationServices/test/CMakeLists.txt +++ b/SAS/SpecificationServices/test/CMakeLists.txt @@ -3,8 +3,8 @@ include(FindPythonModule) find_python_module(mock REQUIRED) -lofar_add_test(test_lofarxml_to_momxmlmodel_translator) +lofar_add_test(t_lofarxml_to_momxmlmodel_translator) lofar_add_test(t_telescope_model_xml_generator_type1) -lofar_add_test(test_translation_service) -lofar_add_test(test_specification_service) +lofar_add_test(t_translation_service) +lofar_add_test(t_specification_service) lofar_add_test(t_validation_service) diff --git a/SAS/SpecificationServices/test/test_translation_service.in_xml/type-1-lofar.xml b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml similarity index 98% rename from SAS/SpecificationServices/test/test_translation_service.in_xml/type-1-lofar.xml rename to SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml index 2eb0bdff74c9ae25a987ec5562e82bd2d0438a76..944e36138a3f21bbd87f8032c06a0877406799b3 100644 --- a/SAS/SpecificationServices/test/test_translation_service.in_xml/type-1-lofar.xml +++ b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml @@ -59,6 +59,10 @@ <enableSuperterp>false</enableSuperterp> <numberOfBitsPerSample>8</numberOfBitsPerSample> <stationSelectionSpecification> + <stationSelection> + <stationSet>INTERNATIONAL</stationSet> + <minimumConstraint>3</minimumConstraint> + </stationSelection> <stationSelection> <stationSet>Custom</stationSet> <stations> diff --git a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml similarity index 95% rename from SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml rename to SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml index ab74b99ac9f93d340eb02901d3e70f6f45a72559..2a476dbf09b9386c3864c905397b60a47a305de4 100644 --- a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml +++ b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-trigger.xml @@ -83,6 +83,10 @@ <enableSuperterp>false</enableSuperterp> <numberOfBitsPerSample>8</numberOfBitsPerSample> <stationSelectionSpecification> + <stationSelection> + <stationSet>INTERNATIONAL</stationSet> + <minimumConstraint>3</minimumConstraint> + </stationSelection> <stationSelection> <stationSet>Custom</stationSet> <stations> @@ -130,8 +134,16 @@ <timeWindowSpecification> <timeFrame>UT</timeFrame> <startTime>2016-11-23T15:21:44</startTime> + <!-- + <minStartTime>2017-05-23T15:21:44</minStartTime> + <maxEndTime>2017-11-23T15:21:44</maxEndTime> + --> <duration> <duration>PT3600S</duration> + <!-- + <minimumDuration>PT100S</minimumDuration> + <maximumDuration>PT2000S</maximumDuration> + --> </duration> </timeWindowSpecification> </observation> diff --git a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.py b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.py similarity index 74% rename from SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.py rename to SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.py index c1105d610177d76c09e0e07f9dea955bf3637c07..d0c447a43cd6533cec86b5434adc1a7c86dce92b 100644 --- a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.py +++ b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# test_lofarxml_to_momxmlmodel_translator.py +# t_lofarxml_to_momxmlmodel_translator.py # # Copyright (C) 2017 # ASTRON (Netherlands Institute for Radio Astronomy) @@ -103,16 +103,33 @@ class TestLofarXMLToMomXMLModelTranslator(unittest.TestCase): self.assertEquals(model.calibrator_dec, "48.2173833333") - def test_generateMode_should_return_modele_filled_with_trigger_id(self): + def test_generateModel_should_return_modele_filled_with_trigger_id(self): translator = LofarXMLToMomXMLModelTranslator() model = translator.generate_model(self.lofar_spec) - self.assertEqual(model.trigger_id, "1") + self.assertEqual(model.trigger_id, 1) + def test_generateModel_should_return_model_filled_with_station_selection(self): + translator = LofarXMLToMomXMLModelTranslator() + model = translator.generate_model(self.lofar_spec) + expected = {"CS001": 1, "CS002": 1, "CS003": 1, "CS004": 1, "CS005": 1, "CS006": 1, "CS007": 1, "CS011": 1, + "CS013": 1, "CS017": 1, "CS021": 1, "CS024": 1, "CS026": 1, "CS028": 1, "CS030": 1, "CS031": 1, + "CS032": 1, "CS101": 1, "CS103": 1, "CS201": 1, "CS301": 1, "CS302": 1, "CS401": 1, "CS501": 1, + "RS106": 1, "RS205": 1, "RS208": 1, "RS210": 1, "RS305": 1, "RS306": 1, "RS307": 1, "RS310": 1, + "RS406": 1, "RS407": 1, "RS409": 1, "RS503": 1, "RS508": 1, "RS509": 1, 'INTERNATIONAL': '3'} + self.assertEqual(model.station_selection, expected) + + def test_generate_model_should_return_model_filled_with_correct_foldernames(self): + translator = LofarXMLToMomXMLModelTranslator() + + model = translator.generate_model(self.lofar_spec) + + self.assertEqual(model.inner_foldername, "AARTFAAC-TRIGGERED") + self.assertEqual(model.outer_foldername, "TARGET_A") def _read_lofar_spec(): - f = open("test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml", "r") + f = open("t_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml", "r") lofar_xml = f.read() diff --git a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.run b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.run similarity index 73% rename from SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.run rename to SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.run index 22ad1adb95fc284cc572aee272fe717cb677e1c6..f20794c8895147f39ebbae076edbfa3ca4c9e051 100755 --- a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.run +++ b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.run @@ -2,4 +2,4 @@ # Run the unit test source python-coverage.sh -python_coverage_test "lib/lofarxml_to_momxmlmodel_translator.py" test_lofarxml_to_momxmlmodel_translator.py +python_coverage_test "lib/lofarxml_to_momxmlmodel_translator.py" t_lofarxml_to_momxmlmodel_translator.py diff --git a/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.sh b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.sh new file mode 100755 index 0000000000000000000000000000000000000000..96756245bc9a7a13f0fda9d852267bfaf02a012e --- /dev/null +++ b/SAS/SpecificationServices/test/t_lofarxml_to_momxmlmodel_translator.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./runctest.sh t_lofarxml_to_momxmlmodel_translator diff --git a/SAS/SpecificationServices/test/test_specification_service.py b/SAS/SpecificationServices/test/t_specification_service.py similarity index 100% rename from SAS/SpecificationServices/test/test_specification_service.py rename to SAS/SpecificationServices/test/t_specification_service.py diff --git a/SAS/SpecificationServices/test/t_specification_service.run b/SAS/SpecificationServices/test/t_specification_service.run new file mode 100755 index 0000000000000000000000000000000000000000..331a1f50a3b77baaf84390775cec36e40a84cff7 --- /dev/null +++ b/SAS/SpecificationServices/test/t_specification_service.run @@ -0,0 +1,5 @@ +#!/bin/bash + +# Run the unit test +source python-coverage.sh +python_coverage_test "specification_service.py" t_specification_service.py \ No newline at end of file diff --git a/SAS/SpecificationServices/test/t_specification_service.sh b/SAS/SpecificationServices/test/t_specification_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..162d5884b3771e97513f7c21d1f97bf46f3ddb74 --- /dev/null +++ b/SAS/SpecificationServices/test/t_specification_service.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./runctest.sh t_specification_service diff --git a/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.in_xml/telescope_model_xml_generator_type1.xml b/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.in_xml/telescope_model_xml_generator_type1.xml index 696e7ba788fb589b798640a8e574c48817e1cbf9..4195f8ecd7fcc417f3b966aacda830e9ac6bf78f 100644 --- a/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.in_xml/telescope_model_xml_generator_type1.xml +++ b/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.in_xml/telescope_model_xml_generator_type1.xml @@ -6,14 +6,14 @@ <name>test-lofar</name> <children> <item index="0"> - <lofar:folder topology_parent="false"> - <name>TARGET_A</name> + <lofar:folder topology_parent="false" update_folder="true"> + <name>myouterfolder</name> <description>First target</description> <children> <item index="0"> - <lofar:folder topology_parent="true"> + <lofar:folder topology_parent="true" update_folder="false"> <topology>0</topology> - <name>AARTFAAC-TRIGGERED</name> + <name>myinnerfolder</name> <description>Triggered observation by AARTFAAC (Preprocessing)</description> <children> <item index="0"> @@ -48,45 +48,7 @@ <stokes/> <stationSet>Custom</stationSet> <stations> - <station name="CS001"/> - <station name="CS002"/> - <station name="CS003"/> - <station name="CS004"/> - <station name="CS005"/> - <station name="CS006"/> - <station name="CS007"/> - <station name="CS011"/> - <station name="CS013"/> - <station name="CS017"/> - <station name="CS021"/> - <station name="CS024"/> - <station name="CS026"/> - <station name="CS028"/> - <station name="CS030"/> - <station name="CS031"/> - <station name="CS032"/> - <station name="CS101"/> - <station name="CS103"/> - <station name="CS201"/> - <station name="CS301"/> - <station name="CS302"/> - <station name="CS401"/> - <station name="CS501"/> - <station name="RS106"/> - <station name="RS205"/> - <station name="RS208"/> - <station name="RS210"/> - <station name="RS305"/> - <station name="RS306"/> - <station name="RS307"/> - <station name="RS310"/> - <station name="RS406"/> - <station name="RS407"/> - <station name="RS409"/> - <station name="RS503"/> - <station name="RS508"/> - <station name="RS509"/> - </stations> + <station name="CS001"/><station name="CS002"/><station name="RS210"/></stations> <timeFrame>UT</timeFrame> <startTime>2016-11-23T15:21:44</startTime> <endTime>2016-11-23T16:21:44</endTime> @@ -94,7 +56,7 @@ <bypassPff>false</bypassPff> <enableSuperterp>false</enableSuperterp> <numberOfBitsPerSample>8</numberOfBitsPerSample> - <misc>{"trigger_id": 333}</misc> + <misc>{"timeWindow": {"minStartTime": "2016-10-23T15:21:44", "maxEndTime": "2017-11-23T15:21:44", "maxDuration": "PT7200S", "minDuration": "PT3600S"}, "stationSelection": [{"resourceGroup": "INTERNATIONAL", "min": 4}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "CS002", "min": 1}], "trigger_id": 333}</misc> </userSpecification> </lofar:observationAttributes> <children> @@ -205,7 +167,7 @@ <mom2:approvedStatus/> </currentStatus> <lofar:averagingPipelineAttributes> - <misc>{"trigger_id": 333}</misc> + <misc>{"timeWindow": {"minStartTime": "2016-10-23T15:21:44", "maxEndTime": "2017-11-23T15:21:44", "maxDuration": "PT7200S", "minDuration": "PT3600S"}, "stationSelection": [{"resourceGroup": "INTERNATIONAL", "min": 4}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "CS002", "min": 1}], "trigger_id": 333}</misc> <defaultTemplate>Preprocessing Pipeline</defaultTemplate> <duration>PT7200S</duration> <demixingParameters> @@ -256,7 +218,7 @@ <mom2:approvedStatus/> </currentStatus> <lofar:averagingPipelineAttributes> - <misc>{"trigger_id": 333}</misc> + <misc>{"timeWindow": {"minStartTime": "2016-10-23T15:21:44", "maxEndTime": "2017-11-23T15:21:44", "maxDuration": "PT7200S", "minDuration": "PT3600S"}, "stationSelection": [{"resourceGroup": "INTERNATIONAL", "min": 4}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "CS002", "min": 1}], "trigger_id": 333}</misc> <defaultTemplate>Preprocessing Pipeline</defaultTemplate> <duration>PT7200S</duration> <demixingParameters> diff --git a/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py b/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py index 31a90d79d92acc823a86589a1a2960269c2ea504..9f5bcb8c81790ec3e326393476f97ef41554eb62 100755 --- a/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py +++ b/SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py @@ -46,7 +46,15 @@ class TestTelescopeModelXMLGeneratorType1(unittest.TestCase): self.model.calibrator_dec = "48.2173833333" self.model.start_time = "2016-11-23T15:21:44" self.model.duration = "PT3600S" - self.model.trigger_id = "333" + self.model.trigger_id = 333 + self.model.min_start_time = "2016-10-23T15:21:44" + self.model.max_end_time = "2017-11-23T15:21:44" + self.model.min_duration = "PT3600S" + self.model.max_duration = "PT7200S" + self.model.station_selection = {"INTERNATIONAL": 4, "CS001": 1, "CS002":1, "RS210": 1} + self.model.custom_station_list = ["CS001", "CS002", "RS210"] + self.model.inner_foldername = 'myinnerfolder' + self.model.outer_foldername = 'myouterfolder' def tearDown(self): if self.generate_golden_output and self.xmldoc is not None: diff --git a/SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1-minmax.xml b/SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1-minmax.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ad13bd4b1c6414089c5323cbc26b0b1a03994af --- /dev/null +++ b/SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1-minmax.xml @@ -0,0 +1,260 @@ +<lofar:project xmlns:mom2="http://www.astron.nl/MoM2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lofar="http://www.astron.nl/MoM2-Lofar" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar ../ResponsiveTelescope-9893/SAS/SpecificationServices/xsd/LofarMoM2.xsd"> + <version>2.17.0</version> + <template version="2.17.0" author="Alwin de Jong,Adriaan Renting" changedBy="Adriaan Renting"> + <description>XML Template generator version 2.17.0</description> + </template> + <name>test-lofar</name> + <children> + <item index="0"> + <lofar:folder topology_parent="false" update_folder="true"> + <name>TARGET_A</name> + <description>First target</description> + <children> + <item index="0"> + <lofar:folder topology_parent="true" update_folder="false"> + <topology>0</topology> + <name>AARTFAAC-TRIGGERED</name> + <description>Triggered observation by AARTFAAC (Preprocessing)</description> + <children> + <item index="0"> + <lofar:observation> + <name>Target/1/TO</name> + <description>Target/1/TO (Target Observation)</description> + <topology>B0.1.T</topology> + <predecessor_topology/> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:observationAttributes> + <name>Target/1/TO</name> + <projectName>test-lofar</projectName> + <instrument>Beam Observation</instrument> + <defaultTemplate>BeamObservation</defaultTemplate> + <tbbPiggybackAllowed>true</tbbPiggybackAllowed> + <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed> + <userSpecification> + <correlatedData>true</correlatedData> + <coherentStokesData>false</coherentStokesData> + <incoherentStokesData>false</incoherentStokesData> + <antenna>LBA Outer</antenna> + <clock mode="200 MHz"/> + <instrumentFilter>30-90 MHz</instrumentFilter> + <integrationInterval>2.0</integrationInterval> + <channelsPerSubband>64</channelsPerSubband> + <coherentDedisperseChannels>false</coherentDedisperseChannels> + <tiedArrayBeams> + <flyseye>false</flyseye> + </tiedArrayBeams> + <stokes/> + <stationSet>Custom</stationSet> + <stations> + <station name="CS001"/><station name="CS002"/><station name="CS003"/><station name="CS004"/><station name="CS005"/><station name="CS006"/><station name="CS007"/><station name="CS011"/><station name="CS013"/><station name="CS017"/><station name="CS021"/><station name="CS024"/><station name="CS026"/><station name="CS028"/><station name="CS030"/><station name="CS031"/><station name="CS032"/><station name="CS101"/><station name="CS103"/><station name="CS201"/><station name="CS301"/><station name="CS302"/><station name="CS401"/><station name="CS501"/><station name="RS106"/><station name="RS205"/><station name="RS208"/><station name="RS210"/><station name="RS305"/><station name="RS306"/><station name="RS307"/><station name="RS310"/><station name="RS406"/><station name="RS407"/><station name="RS409"/><station name="RS503"/><station name="RS508"/><station name="RS509"/></stations> + <timeFrame>UT</timeFrame> + <endTime>2016-11-23T16:21:44</endTime> + <bypassPff>false</bypassPff> + <enableSuperterp>false</enableSuperterp> + <numberOfBitsPerSample>8</numberOfBitsPerSample> + <misc>{"timeWindow": {"minStartTime": "2017-05-23T15:21:44", "maxEndTime": "2017-11-23T15:21:44", "maxDuration": "PT7200S", "minDuration": "PT1600S"}, "stationSelection": [{"resourceGroup": "CS401", "min": 1}, {"resourceGroup": "RS509", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "RS208", "min": 1}, {"resourceGroup": "CS007", "min": 1}, {"resourceGroup": "CS501", "min": 1}, {"resourceGroup": "RS503", "min": 1}, {"resourceGroup": "RS106", "min": 1}, {"resourceGroup": "RS406", "min": 1}, {"resourceGroup": "CS103", "min": 1}, {"resourceGroup": "CS017", "min": 1}, {"resourceGroup": "CS005", "min": 1}, {"resourceGroup": "CS013", "min": 1}, {"resourceGroup": "INTERNATIONAL", "min": "3"}, {"resourceGroup": "RS310", "min": 1}, {"resourceGroup": "CS031", "min": 1}, {"resourceGroup": "RS305", "min": 1}, {"resourceGroup": "RS307", "min": 1}, {"resourceGroup": "RS205", "min": 1}, {"resourceGroup": "RS409", "min": 1}, {"resourceGroup": "CS301", "min": 1}, {"resourceGroup": "CS302", "min": 1}, {"resourceGroup": "CS028", "min": 1}, {"resourceGroup": "RS508", "min": 1}, {"resourceGroup": "RS407", "min": 1}, {"resourceGroup": "CS003", "min": 1}, {"resourceGroup": "CS024", "min": 1}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "CS026", "min": 1}, {"resourceGroup": "CS021", "min": 1}, {"resourceGroup": "CS006", "min": 1}, {"resourceGroup": "CS030", "min": 1}, {"resourceGroup": "CS004", "min": 1}, {"resourceGroup": "CS032", "min": 1}, {"resourceGroup": "CS101", "min": 1}, {"resourceGroup": "CS002", "min": 1}, {"resourceGroup": "CS201", "min": 1}, {"resourceGroup": "RS306", "min": 1}, {"resourceGroup": "CS011", "min": 1}], "trigger_id": 1}</misc> + </userSpecification> + </lofar:observationAttributes> + <children> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>Target</name> + <description>Target</description> + <topology>B0.1.T.SAP000</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>Target</targetName> + <ra>204.648425</ra> + <dec>-0.172222222222</dec> + <equinox>J2000</equinox> + <duration>PT0S</duration> + <subbandsSpecification> + <subbands>160..399</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize>0</tabRingSize> + <tiedArrayBeamList/> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP000.uv.dps</name> + <topology>B0.1.T.SAP000.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>Calibrator</name> + <description>Calibrator</description> + <topology>B0.1.T.SAP001</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Calibration</measurementType> + <specification> + <targetName>Calibrator</targetName> + <ra>123.400291667</ra> + <dec>48.2173833333</dec> + <equinox>J2000</equinox> + <duration>PT0S</duration> + <subbandsSpecification> + <subbands>160..399</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize>0</tabRingSize> + <tiedArrayBeamList/> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP001.uv.dps</name> + <topology>B0.1.T.SAP001.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + </children> + </lofar:observation> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:AveragingPipelineType"> + <topology>B0.1.CPT</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>Calibrator/1/CPT</name> + <description>Calibrator/1/CPT (Preprocessing)</description> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>24</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:averagingPipelineAttributes> + <misc>{"timeWindow": {"minStartTime": "2017-05-23T15:21:44", "maxEndTime": "2017-11-23T15:21:44", "maxDuration": "PT7200S", "minDuration": "PT1600S"}, "stationSelection": [{"resourceGroup": "CS401", "min": 1}, {"resourceGroup": "RS509", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "RS208", "min": 1}, {"resourceGroup": "CS007", "min": 1}, {"resourceGroup": "CS501", "min": 1}, {"resourceGroup": "RS503", "min": 1}, {"resourceGroup": "RS106", "min": 1}, {"resourceGroup": "RS406", "min": 1}, {"resourceGroup": "CS103", "min": 1}, {"resourceGroup": "CS017", "min": 1}, {"resourceGroup": "CS005", "min": 1}, {"resourceGroup": "CS013", "min": 1}, {"resourceGroup": "INTERNATIONAL", "min": "3"}, {"resourceGroup": "RS310", "min": 1}, {"resourceGroup": "CS031", "min": 1}, {"resourceGroup": "RS305", "min": 1}, {"resourceGroup": "RS307", "min": 1}, {"resourceGroup": "RS205", "min": 1}, {"resourceGroup": "RS409", "min": 1}, {"resourceGroup": "CS301", "min": 1}, {"resourceGroup": "CS302", "min": 1}, {"resourceGroup": "CS028", "min": 1}, {"resourceGroup": "RS508", "min": 1}, {"resourceGroup": "RS407", "min": 1}, {"resourceGroup": "CS003", "min": 1}, {"resourceGroup": "CS024", "min": 1}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "CS026", "min": 1}, {"resourceGroup": "CS021", "min": 1}, {"resourceGroup": "CS006", "min": 1}, {"resourceGroup": "CS030", "min": 1}, {"resourceGroup": "CS004", "min": 1}, {"resourceGroup": "CS032", "min": 1}, {"resourceGroup": "CS101", "min": 1}, {"resourceGroup": "CS002", "min": 1}, {"resourceGroup": "CS201", "min": 1}, {"resourceGroup": "RS306", "min": 1}, {"resourceGroup": "CS011", "min": 1}], "trigger_id": 1}</misc> + <defaultTemplate>Preprocessing Pipeline</defaultTemplate> + <duration>PT7200S</duration> + <demixingParameters> + <averagingFreqStep>16</averagingFreqStep> + <averagingTimeStep>1</averagingTimeStep> + <demixFreqStep>16</demixFreqStep> + <demixTimeStep>5</demixTimeStep> + </demixingParameters> + <flaggingStrategy>LBAdefault</flaggingStrategy> + </lofar:averagingPipelineAttributes> + <usedDataProducts> + <item> + <lofar:uvDataProduct topology="B0.1.T.SAP001.uv.dps"/> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.CPT.uv.dps</name> + <topology>B0.1.CPT.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:AveragingPipelineType"> + <topology>B0.1.PT0</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>Target/1.0/TP</name> + <description>Target/1.0/TP (Preprocessing)</description> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>24</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:averagingPipelineAttributes> + <misc>{"timeWindow": {"minStartTime": "2017-05-23T15:21:44", "maxEndTime": "2017-11-23T15:21:44", "maxDuration": "PT7200S", "minDuration": "PT1600S"}, "stationSelection": [{"resourceGroup": "CS401", "min": 1}, {"resourceGroup": "RS509", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "RS208", "min": 1}, {"resourceGroup": "CS007", "min": 1}, {"resourceGroup": "CS501", "min": 1}, {"resourceGroup": "RS503", "min": 1}, {"resourceGroup": "RS106", "min": 1}, {"resourceGroup": "RS406", "min": 1}, {"resourceGroup": "CS103", "min": 1}, {"resourceGroup": "CS017", "min": 1}, {"resourceGroup": "CS005", "min": 1}, {"resourceGroup": "CS013", "min": 1}, {"resourceGroup": "INTERNATIONAL", "min": "3"}, {"resourceGroup": "RS310", "min": 1}, {"resourceGroup": "CS031", "min": 1}, {"resourceGroup": "RS305", "min": 1}, {"resourceGroup": "RS307", "min": 1}, {"resourceGroup": "RS205", "min": 1}, {"resourceGroup": "RS409", "min": 1}, {"resourceGroup": "CS301", "min": 1}, {"resourceGroup": "CS302", "min": 1}, {"resourceGroup": "CS028", "min": 1}, {"resourceGroup": "RS508", "min": 1}, {"resourceGroup": "RS407", "min": 1}, {"resourceGroup": "CS003", "min": 1}, {"resourceGroup": "CS024", "min": 1}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "CS026", "min": 1}, {"resourceGroup": "CS021", "min": 1}, {"resourceGroup": "CS006", "min": 1}, {"resourceGroup": "CS030", "min": 1}, {"resourceGroup": "CS004", "min": 1}, {"resourceGroup": "CS032", "min": 1}, {"resourceGroup": "CS101", "min": 1}, {"resourceGroup": "CS002", "min": 1}, {"resourceGroup": "CS201", "min": 1}, {"resourceGroup": "RS306", "min": 1}, {"resourceGroup": "CS011", "min": 1}], "trigger_id": 1}</misc> + <defaultTemplate>Preprocessing Pipeline</defaultTemplate> + <duration>PT7200S</duration> + <demixingParameters> + <averagingFreqStep>16</averagingFreqStep> + <averagingTimeStep>1</averagingTimeStep> + <demixFreqStep>16</demixFreqStep> + <demixTimeStep>5</demixTimeStep> + + <demixIfNeeded>CygA</demixIfNeeded> + + </demixingParameters> + <flaggingStrategy>LBAdefault</flaggingStrategy> + </lofar:averagingPipelineAttributes> + <usedDataProducts> + <item> + <lofar:uvDataProduct topology="B0.1.T.SAP000.uv.dps"/> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.PT0.uv.dps</name> + <topology>B0.1.PT0.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + </children> + </lofar:folder> + </item> + </children> + </lofar:folder> + </item> + </children> +</lofar:project> \ No newline at end of file diff --git a/SAS/SpecificationServices/test/test_translation_service.in_xml/telescope_model_xml_generator_type1.xml b/SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1.xml similarity index 64% rename from SAS/SpecificationServices/test/test_translation_service.in_xml/telescope_model_xml_generator_type1.xml rename to SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1.xml index 6d3d10defe0747a599f1f013257d3c2f56bc6ad7..4c1e88fee3d2d68203f4b5be2a65a008dbcec28e 100644 --- a/SAS/SpecificationServices/test/test_translation_service.in_xml/telescope_model_xml_generator_type1.xml +++ b/SAS/SpecificationServices/test/t_translation_service.in_xml/telescope_model_xml_generator_type1.xml @@ -6,12 +6,12 @@ <name>test-lofar</name> <children> <item index="0"> - <lofar:folder topology_parent="false"> + <lofar:folder topology_parent="false" update_folder="true"> <name>TARGET_A</name> <description>First target</description> <children> <item index="0"> - <lofar:folder topology_parent="true"> + <lofar:folder topology_parent="true" update_folder="false"> <topology>0</topology> <name>AARTFAAC-TRIGGERED</name> <description>Triggered observation by AARTFAAC (Preprocessing)</description> @@ -48,45 +48,7 @@ <stokes/> <stationSet>Custom</stationSet> <stations> - <station name="CS001"/> - <station name="CS002"/> - <station name="CS003"/> - <station name="CS004"/> - <station name="CS005"/> - <station name="CS006"/> - <station name="CS007"/> - <station name="CS011"/> - <station name="CS013"/> - <station name="CS017"/> - <station name="CS021"/> - <station name="CS024"/> - <station name="CS026"/> - <station name="CS028"/> - <station name="CS030"/> - <station name="CS031"/> - <station name="CS032"/> - <station name="CS101"/> - <station name="CS103"/> - <station name="CS201"/> - <station name="CS301"/> - <station name="CS302"/> - <station name="CS401"/> - <station name="CS501"/> - <station name="RS106"/> - <station name="RS205"/> - <station name="RS208"/> - <station name="RS210"/> - <station name="RS305"/> - <station name="RS306"/> - <station name="RS307"/> - <station name="RS310"/> - <station name="RS406"/> - <station name="RS407"/> - <station name="RS409"/> - <station name="RS503"/> - <station name="RS508"/> - <station name="RS509"/> - </stations> + <station name="CS001"/><station name="CS002"/><station name="CS003"/><station name="CS004"/><station name="CS005"/><station name="CS006"/><station name="CS007"/><station name="CS011"/><station name="CS013"/><station name="CS017"/><station name="CS021"/><station name="CS024"/><station name="CS026"/><station name="CS028"/><station name="CS030"/><station name="CS031"/><station name="CS032"/><station name="CS101"/><station name="CS103"/><station name="CS201"/><station name="CS301"/><station name="CS302"/><station name="CS401"/><station name="CS501"/><station name="RS106"/><station name="RS205"/><station name="RS208"/><station name="RS210"/><station name="RS305"/><station name="RS306"/><station name="RS307"/><station name="RS310"/><station name="RS406"/><station name="RS407"/><station name="RS409"/><station name="RS503"/><station name="RS508"/><station name="RS509"/></stations> <timeFrame>UT</timeFrame> <startTime>2016-11-23T15:21:44</startTime> <endTime>2016-11-23T16:21:44</endTime> @@ -94,7 +56,7 @@ <bypassPff>false</bypassPff> <enableSuperterp>false</enableSuperterp> <numberOfBitsPerSample>8</numberOfBitsPerSample> - <misc>{"trigger_id": 1}</misc> + <misc>{"stationSelection": [{"resourceGroup": "CS401", "min": 1}, {"resourceGroup": "RS509", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "RS208", "min": 1}, {"resourceGroup": "CS007", "min": 1}, {"resourceGroup": "CS501", "min": 1}, {"resourceGroup": "RS503", "min": 1}, {"resourceGroup": "RS106", "min": 1}, {"resourceGroup": "RS406", "min": 1}, {"resourceGroup": "CS103", "min": 1}, {"resourceGroup": "CS017", "min": 1}, {"resourceGroup": "CS005", "min": 1}, {"resourceGroup": "CS013", "min": 1}, {"resourceGroup": "RS310", "min": 1}, {"resourceGroup": "CS031", "min": 1}, {"resourceGroup": "RS305", "min": 1}, {"resourceGroup": "RS307", "min": 1}, {"resourceGroup": "RS205", "min": 1}, {"resourceGroup": "RS409", "min": 1}, {"resourceGroup": "CS301", "min": 1}, {"resourceGroup": "CS302", "min": 1}, {"resourceGroup": "CS028", "min": 1}, {"resourceGroup": "RS508", "min": 1}, {"resourceGroup": "RS407", "min": 1}, {"resourceGroup": "CS003", "min": 1}, {"resourceGroup": "CS002", "min": 1}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "CS026", "min": 1}, {"resourceGroup": "CS021", "min": 1}, {"resourceGroup": "CS006", "min": 1}, {"resourceGroup": "CS030", "min": 1}, {"resourceGroup": "CS004", "min": 1}, {"resourceGroup": "CS032", "min": 1}, {"resourceGroup": "CS101", "min": 1}, {"resourceGroup": "CS024", "min": 1}, {"resourceGroup": "CS201", "min": 1}, {"resourceGroup": "RS306", "min": 1}, {"resourceGroup": "CS011", "min": 1}], "trigger_id": 1}</misc> </userSpecification> </lofar:observationAttributes> <children> @@ -205,7 +167,7 @@ <mom2:approvedStatus/> </currentStatus> <lofar:averagingPipelineAttributes> - <misc>{"trigger_id": 1}</misc> + <misc>{"stationSelection": [{"resourceGroup": "CS401", "min": 1}, {"resourceGroup": "RS509", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "RS208", "min": 1}, {"resourceGroup": "CS007", "min": 1}, {"resourceGroup": "CS501", "min": 1}, {"resourceGroup": "RS503", "min": 1}, {"resourceGroup": "RS106", "min": 1}, {"resourceGroup": "RS406", "min": 1}, {"resourceGroup": "CS103", "min": 1}, {"resourceGroup": "CS017", "min": 1}, {"resourceGroup": "CS005", "min": 1}, {"resourceGroup": "CS013", "min": 1}, {"resourceGroup": "RS310", "min": 1}, {"resourceGroup": "CS031", "min": 1}, {"resourceGroup": "RS305", "min": 1}, {"resourceGroup": "RS307", "min": 1}, {"resourceGroup": "RS205", "min": 1}, {"resourceGroup": "RS409", "min": 1}, {"resourceGroup": "CS301", "min": 1}, {"resourceGroup": "CS302", "min": 1}, {"resourceGroup": "CS028", "min": 1}, {"resourceGroup": "RS508", "min": 1}, {"resourceGroup": "RS407", "min": 1}, {"resourceGroup": "CS003", "min": 1}, {"resourceGroup": "CS002", "min": 1}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "CS026", "min": 1}, {"resourceGroup": "CS021", "min": 1}, {"resourceGroup": "CS006", "min": 1}, {"resourceGroup": "CS030", "min": 1}, {"resourceGroup": "CS004", "min": 1}, {"resourceGroup": "CS032", "min": 1}, {"resourceGroup": "CS101", "min": 1}, {"resourceGroup": "CS024", "min": 1}, {"resourceGroup": "CS201", "min": 1}, {"resourceGroup": "RS306", "min": 1}, {"resourceGroup": "CS011", "min": 1}], "trigger_id": 1}</misc> <defaultTemplate>Preprocessing Pipeline</defaultTemplate> <duration>PT7200S</duration> <demixingParameters> @@ -256,7 +218,7 @@ <mom2:approvedStatus/> </currentStatus> <lofar:averagingPipelineAttributes> - <misc>{"trigger_id": 1}</misc> + <misc>{"stationSelection": [{"resourceGroup": "CS401", "min": 1}, {"resourceGroup": "RS509", "min": 1}, {"resourceGroup": "RS210", "min": 1}, {"resourceGroup": "RS208", "min": 1}, {"resourceGroup": "CS007", "min": 1}, {"resourceGroup": "CS501", "min": 1}, {"resourceGroup": "RS503", "min": 1}, {"resourceGroup": "RS106", "min": 1}, {"resourceGroup": "RS406", "min": 1}, {"resourceGroup": "CS103", "min": 1}, {"resourceGroup": "CS017", "min": 1}, {"resourceGroup": "CS005", "min": 1}, {"resourceGroup": "CS013", "min": 1}, {"resourceGroup": "RS310", "min": 1}, {"resourceGroup": "CS031", "min": 1}, {"resourceGroup": "RS305", "min": 1}, {"resourceGroup": "RS307", "min": 1}, {"resourceGroup": "RS205", "min": 1}, {"resourceGroup": "RS409", "min": 1}, {"resourceGroup": "CS301", "min": 1}, {"resourceGroup": "CS302", "min": 1}, {"resourceGroup": "CS028", "min": 1}, {"resourceGroup": "RS508", "min": 1}, {"resourceGroup": "RS407", "min": 1}, {"resourceGroup": "CS003", "min": 1}, {"resourceGroup": "CS002", "min": 1}, {"resourceGroup": "CS001", "min": 1}, {"resourceGroup": "CS026", "min": 1}, {"resourceGroup": "CS021", "min": 1}, {"resourceGroup": "CS006", "min": 1}, {"resourceGroup": "CS030", "min": 1}, {"resourceGroup": "CS004", "min": 1}, {"resourceGroup": "CS032", "min": 1}, {"resourceGroup": "CS101", "min": 1}, {"resourceGroup": "CS024", "min": 1}, {"resourceGroup": "CS201", "min": 1}, {"resourceGroup": "RS306", "min": 1}, {"resourceGroup": "CS011", "min": 1}], "trigger_id": 1}</misc> <defaultTemplate>Preprocessing Pipeline</defaultTemplate> <duration>PT7200S</duration> <demixingParameters> diff --git a/SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar-minmax.xml b/SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar-minmax.xml new file mode 100644 index 0000000000000000000000000000000000000000..f48f10de528316a88ee946235c8eafbcf80c158e --- /dev/null +++ b/SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar-minmax.xml @@ -0,0 +1,472 @@ +<spec:specification xmlns:base="http://www.astron.nl/LofarBase" xmlns:spec="http://www.astron.nl/LofarSpecification" xmlns:trigger="http://www.astron.nl/LofarTrigger" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><version>2.20</version> + <projectReference> + <ProjectCode>LC7_030</ProjectCode> + </projectReference> + <userName>veen</userName> + <comment>comment</comment> + <generatorName>Jan David Mol</generatorName> + <generatorVersion>0.0</generatorVersion> + + <!-- folders --> + <container> + <temporaryIdentifier> + <source>0</source> + <identifier>100</identifier> + </temporaryIdentifier> + <addToExistingContainer>false</addToExistingContainer> + <folder> + <name>TARGET_A</name> + <description>First target</description> + <topology>0</topology> + </folder> + </container> + <container> + <temporaryIdentifier> + <source>0</source> + <identifier>101</identifier> + </temporaryIdentifier> + <addToExistingContainer>false</addToExistingContainer> + <folder> + <name>AARTFAAC-TRIGGERED</name> + <description>Triggered observation by AARTFAAC (Preprocessing)</description> + <topology>0</topology> + </folder> + </container> + + <!-- observation --> + <activity> + <temporaryIdentifier> + <source>0</source> + <identifier>200</identifier> + <description>0</description> + </temporaryIdentifier> + <observation> + <name>Target/1/TO</name> + <description>Target/1/TO (Target Observation)</description> + <instrument>Beam Observation</instrument> + <defaultTemplate>BeamObservation</defaultTemplate> + <tbbPiggybackAllowed>true</tbbPiggybackAllowed> + <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed> + <correlatedData>true</correlatedData> + <coherentStokesData>false</coherentStokesData> + <incoherentStokesData>false</incoherentStokesData> + <antenna>LBA Outer</antenna> + <clock units="MHz">200</clock> + <instrumentFilter>30-90 MHz</instrumentFilter> + <integrationInterval>2.0</integrationInterval> + <channelsPerSubband>64</channelsPerSubband> + <bypassPff>false</bypassPff> + <enableSuperterp>false</enableSuperterp> + <numberOfBitsPerSample>8</numberOfBitsPerSample> + <stationSelectionSpecification> + <stationSelection> + <stationSet>INTERNATIONAL</stationSet> + <minimumConstraint>3</minimumConstraint> + </stationSelection> + <stationSelection> + <stationSet>Custom</stationSet> + <stations> + <station><name>CS001</name></station> + <station><name>CS002</name></station> + <station><name>CS003</name></station> + <station><name>CS004</name></station> + <station><name>CS005</name></station> + <station><name>CS006</name></station> + <station><name>CS007</name></station> + <station><name>CS011</name></station> + <station><name>CS013</name></station> + <station><name>CS017</name></station> + <station><name>CS021</name></station> + <station><name>CS024</name></station> + <station><name>CS026</name></station> + <station><name>CS028</name></station> + <station><name>CS030</name></station> + <station><name>CS031</name></station> + <station><name>CS032</name></station> + <station><name>CS101</name></station> + <station><name>CS103</name></station> + <station><name>CS201</name></station> + <station><name>CS301</name></station> + <station><name>CS302</name></station> + <station><name>CS401</name></station> + <station><name>CS501</name></station> + <station><name>RS106</name></station> + <station><name>RS205</name></station> + <station><name>RS208</name></station> + <station><name>RS210</name></station> + <station><name>RS305</name></station> + <station><name>RS306</name></station> + <station><name>RS307</name></station> + <station><name>RS310</name></station> + <station><name>RS406</name></station> + <station><name>RS407</name></station> + <station><name>RS409</name></station> + <station><name>RS503</name></station> + <station><name>RS508</name></station> + <station><name>RS509</name></station> + </stations> + </stationSelection> + </stationSelectionSpecification> + <timeWindowSpecification> + <timeFrame>UT</timeFrame> + <minStartTime>2017-05-23T15:21:44</minStartTime> + <maxEndTime>2017-11-23T15:21:44</maxEndTime> + <duration> + <minimumDuration>PT1600S</minimumDuration> + <maximumDuration>PT7200S</maximumDuration> + </duration> + </timeWindowSpecification> + </observation> + <status>approved</status> + <qualityOfService>LATENCY</qualityOfService> + <priority>1010</priority> + <triggerId><source>MoM</source><identifier>1</identifier></triggerId></activity> + + <!-- SAP 0 --> + <activity> + <temporaryIdentifier> + <source>0</source> + <identifier>300</identifier> + <description>0</description> + </temporaryIdentifier> + <measurement xsi:type="base:BeamMeasurement"> + <name>Target</name> + <description>Target</description> + <ra>204.648425</ra> + <dec>-0.172222222222</dec> + <equinox>J2000</equinox> + <subbandsSpecification> + <subbands>160..399</subbands> + </subbandsSpecification> + <measurementType>Target</measurementType> + </measurement> + + <status>approved</status> + <qualityOfService>LATENCY</qualityOfService> + <priority>1010</priority> + <triggerId><source>MoM</source><identifier>1</identifier></triggerId></activity> + + <!-- SAP 1 --> + <activity> + <temporaryIdentifier> + <source>0</source> + <identifier>301</identifier> + <description>0</description> + </temporaryIdentifier> + <measurement xsi:type="base:BeamMeasurement"> + <name>Calibrator</name> + <description>Calibrator</description> + <ra>123.400291667</ra> + <dec>48.2173833333</dec> + <equinox>J2000</equinox> + <subbandsSpecification> + <subbands>160..339</subbands> + </subbandsSpecification> + <measurementType>Calibration</measurementType> + </measurement> + + <status>approved</status> + <qualityOfService>LATENCY</qualityOfService> + <priority>1010</priority> + <triggerId><source>MoM</source><identifier>1</identifier></triggerId></activity> + + <!-- Calibrator Averaging Pipeline --> + <activity> + <temporaryIdentifier> + <source>0</source> + <identifier>201</identifier> + <description>0</description> + </temporaryIdentifier> + <pipeline xsi:type="base:AveragingPipeline"> + <name>Calibrator/1/CPT</name> + <description>Calibrator/1/CPT (Preprocessing)</description> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>24</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <defaultTemplate>Preprocessing Pipeline</defaultTemplate> + <demixingParameters> + <averagingFreqStep>16</averagingFreqStep> + <averagingTimeStep>1</averagingTimeStep> + <demixFreqStep>16</demixFreqStep> + <demixTimeStep>5</demixTimeStep> + <demixAlways/> + <demixIfNeeded/> + <ignoreTarget>false</ignoreTarget> + </demixingParameters> + <flaggingStrategy>LBAdefault</flaggingStrategy> + </pipeline> + <status>approved</status> + <qualityOfService>LATENCY</qualityOfService> + <priority>1010</priority> + <triggerId><source>MoM</source><identifier>1</identifier></triggerId></activity> + + <!-- Target Averaging Pipeline --> + <activity> + <temporaryIdentifier> + <source>0</source> + <identifier>202</identifier> + <description>0</description> + </temporaryIdentifier> + <pipeline xsi:type="base:AveragingPipeline"> + <name>Calibrator/1/CPT</name> + <description>Calibrator/1/CPT (Preprocessing)</description> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>24</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <defaultTemplate>Preprocessing Pipeline</defaultTemplate> + <demixingParameters> + <averagingFreqStep>16</averagingFreqStep> + <averagingTimeStep>1</averagingTimeStep> + <demixFreqStep>16</demixFreqStep> + <demixTimeStep>5</demixTimeStep> + <demixAlways/> + <demixIfNeeded/> + <ignoreTarget>false</ignoreTarget> + </demixingParameters> + <flaggingStrategy>LBAdefault</flaggingStrategy> + </pipeline> + <status>approved</status> + <qualityOfService>LATENCY</qualityOfService> + <priority>1010</priority> + <triggerId><source>MoM</source><identifier>1</identifier></triggerId></activity> + + <!-- SAP 0 data products --> + <entity> + <temporaryIdentifier> + <source>0</source> + <identifier>400</identifier> + </temporaryIdentifier> + <dataproductType>UVDataProduct</dataproductType> + <storageCluster> + + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </entity> + + <!-- SAP 1 data products --> + <entity> + <temporaryIdentifier> + <source>0</source> + <identifier>401</identifier> + </temporaryIdentifier> + <dataproductType>UVDataProduct</dataproductType> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </entity> + + <!-- Calibrator Pipeline dataproducts --> + <entity> + <temporaryIdentifier> + <source>0</source> + <identifier>402</identifier> + </temporaryIdentifier> + <dataproductType>UVDataProduct</dataproductType> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </entity> + + <!-- Target Pipeline dataproducts --> + <entity> + <temporaryIdentifier> + <source>0</source> + <identifier>403</identifier> + </temporaryIdentifier> + <dataproductType>UVDataProduct</dataproductType> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </entity> + + <!-- folder 101 is child of folder 100 --> + <relation xsi:type="spec:ChildRelation"> + <parent> + <source>0</source> + <identifier>100</identifier> + </parent> + <child> + <source>0</source> + <identifier>101</identifier> + </child> + <type>folder-folder</type> + </relation> + + <!-- observation 200 is child of folder 101 --> + <relation xsi:type="spec:ChildRelation"> + <parent> + <source>0</source> + <identifier>101</identifier> + </parent> + <child> + <source>0</source> + <identifier>200</identifier> + </child> + <type>folder-activity</type> + </relation> + + <!-- measurements 300 is a child of observation 200 --> + <relation xsi:type="spec:ChildRelation"> + <parent> + <source>0</source> + <identifier>200</identifier> + </parent> + <child> + <source>0</source> + <identifier>300</identifier> + </child> + <type>observation-measurement</type> + </relation> + + <!-- measurement 301 is a child of observation 200 --> + <relation xsi:type="spec:ChildRelation"> + <parent> + <source>0</source> + <identifier>200</identifier> + <description>0</description> + </parent> + <child> + <source>0</source> + <identifier>301</identifier> + <description>0</description> + </child> + <type>observation-measurement</type> + </relation> + + <!-- dataproducts 400 are output of measurement 300 --> + <relation xsi:type="spec:ActivityEntityRelation"> + <entity> + <source>0</source> + <identifier>400</identifier> + </entity> + <activity> + <source>0</source> + <identifier>300</identifier> + </activity> + <type>producer</type> + </relation> + + <!-- dataproducts 401 are output of measurement 301 --> + <relation xsi:type="spec:ActivityEntityRelation"> + <entity> + <source>0</source> + <identifier>401</identifier> + </entity> + <activity> + <source>0</source> + <identifier>301</identifier> + </activity> + <type>producer</type> + </relation> + + + <!-- SAP 1 is the calibrator for SAP 0 --> + <relation xsi:type="spec:TwinRelation"> + <first> + <source>0</source> + <identifier>301</identifier> + </first> + <second> + <source>0</source> + <identifier>300</identifier> + </second> + <type>calibrator-target</type> + </relation> + + + <!-- dataproducts 401 are input for pipeline 201 --> + <relation xsi:type="spec:ActivityEntityRelation"> + <entity> + <source>0</source> + <identifier>401</identifier> + </entity> + <activity> + <source>0</source> + <identifier>201</identifier> + </activity> + <type>user</type> + </relation> + + <!-- dataproducts 402 are output of pipeline 201 --> + <relation xsi:type="spec:ActivityEntityRelation"> + <entity> + <source>0</source> + <identifier>402</identifier> + </entity> + <activity> + <source>0</source> + <identifier>201</identifier> + </activity> + <type>producer</type> + </relation> + + <!-- pipeline 201 is child of folder 101 --> + <relation xsi:type="spec:ChildRelation"> + <parent> + <source>0</source> + <identifier>101</identifier> + </parent> + <child> + <source>0</source> + <identifier>201</identifier> + </child> + <type>folder-activity</type> + </relation> + + <!-- dataproducts 400 are input for pipeline 202 --> + <relation xsi:type="spec:ActivityEntityRelation"> + <entity> + <source>0</source> + <identifier>400</identifier> + </entity> + <activity> + <source>0</source> + <identifier>202</identifier> + </activity> + <type>user</type> + </relation> + + <!-- pipeline 202 is child of folder 101 --> + <relation xsi:type="spec:ChildRelation"> + <parent> + <source>0</source> + <identifier>101</identifier> + </parent> + <child> + <source>0</source> + <identifier>202</identifier> + </child> + <type>folder-activity</type> + </relation> + + <!-- dataproducts 403 are output of pipeline 202 --> + <relation xsi:type="spec:ActivityEntityRelation"> + <entity> + <source>0</source> + <identifier>403</identifier> + </entity> + <activity> + <source>0</source> + <identifier>202</identifier> + </activity> + <type>producer</type> + </relation> + </spec:specification> diff --git a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml b/SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar.xml similarity index 100% rename from SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.in_xml/type-1-lofar.xml rename to SAS/SpecificationServices/test/t_translation_service.in_xml/type-1-lofar.xml diff --git a/SAS/SpecificationServices/test/test_translation_service.py b/SAS/SpecificationServices/test/t_translation_service.py similarity index 72% rename from SAS/SpecificationServices/test/test_translation_service.py rename to SAS/SpecificationServices/test/t_translation_service.py index 00b0a29c17165264329f7fdab54b65b5f4db328a..936566950229c47a5cad2030173f6122d37cb4c2 100644 --- a/SAS/SpecificationServices/test/test_translation_service.py +++ b/SAS/SpecificationServices/test/t_translation_service.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# test_translation_service.py +# t_translation_service.py # # Copyright (C) 2017 # ASTRON (Netherlands Institute for Radio Astronomy) @@ -29,12 +29,18 @@ import mock class TestSpecificationTranslationHandler(unittest.TestCase): @classmethod def setUpClass(cls): - lofar_file_handler = open("test_translation_service.in_xml/type-1-lofar.xml", "r") + lofar_file_handler = open("t_translation_service.in_xml/type-1-lofar.xml", "r") cls.xml = lofar_file_handler.read() - mom_file_handler = open("test_translation_service.in_xml/telescope_model_xml_generator_type1.xml", "r") + lofar_file_handler_minmax = open("t_translation_service.in_xml/type-1-lofar-minmax.xml", "r") + cls.xml_minmax = lofar_file_handler_minmax.read() + + mom_file_handler = open("t_translation_service.in_xml/telescope_model_xml_generator_type1.xml", "r") cls.expected_momxml = mom_file_handler.read() + mom_file_handler_minmax = open("t_translation_service.in_xml/telescope_model_xml_generator_type1-minmax.xml", "r") + cls.expected_momxml_minmax = mom_file_handler_minmax.read() + def setUp(self): validationrpc_patcher = mock.patch('lofar.specificationservices.translation_service.validationrpc') self.addCleanup(validationrpc_patcher.stop) @@ -59,6 +65,13 @@ class TestSpecificationTranslationHandler(unittest.TestCase): self.assertEqual(momxml["mom-specification"], self.expected_momxml) + def test_specification_to_momspecification_should_return_expected_mom_xml_with_constraints(self): + handler = SpecificationTranslationHandler() + + momxml_minmax = handler.specification_to_momspecification(self.xml_minmax) + + self.assertEqual(momxml_minmax["mom-specification"], self.expected_momxml_minmax) + if __name__ == '__main__': unittest.main() diff --git a/SAS/SpecificationServices/test/t_translation_service.run b/SAS/SpecificationServices/test/t_translation_service.run new file mode 100755 index 0000000000000000000000000000000000000000..b8b5a921df717edffcf4910df2c11053463c1548 --- /dev/null +++ b/SAS/SpecificationServices/test/t_translation_service.run @@ -0,0 +1,5 @@ +#!/bin/bash + +# Run the unit test +source python-coverage.sh +python_coverage_test "lib/translation_service.py" t_translation_service.py \ No newline at end of file diff --git a/SAS/SpecificationServices/test/t_translation_service.sh b/SAS/SpecificationServices/test/t_translation_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..b8c158fa286a851680a080bdfc318438d2e3e1d8 --- /dev/null +++ b/SAS/SpecificationServices/test/t_translation_service.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./runctest.sh t_translation_service \ No newline at end of file diff --git a/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-lofar.xml b/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-lofar.xml index 2eb0bdff74c9ae25a987ec5562e82bd2d0438a76..944e36138a3f21bbd87f8032c06a0877406799b3 100644 --- a/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-lofar.xml +++ b/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-lofar.xml @@ -59,6 +59,10 @@ <enableSuperterp>false</enableSuperterp> <numberOfBitsPerSample>8</numberOfBitsPerSample> <stationSelectionSpecification> + <stationSelection> + <stationSet>INTERNATIONAL</stationSet> + <minimumConstraint>3</minimumConstraint> + </stationSelection> <stationSelection> <stationSet>Custom</stationSet> <stations> diff --git a/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-trigger.xml b/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-trigger.xml index ab74b99ac9f93d340eb02901d3e70f6f45a72559..00d9d19d9e55a3adae66f5eda4cd6b0ceaab8ddd 100644 --- a/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-trigger.xml +++ b/SAS/SpecificationServices/test/t_validation_service.in_xml/type-1-trigger.xml @@ -83,6 +83,10 @@ <enableSuperterp>false</enableSuperterp> <numberOfBitsPerSample>8</numberOfBitsPerSample> <stationSelectionSpecification> + <stationSelection> + <stationSet>INTERNATIONAL</stationSet> + <minimumConstraint>3</minimumConstraint> + </stationSelection> <stationSelection> <stationSet>Custom</stationSet> <stations> @@ -130,8 +134,16 @@ <timeWindowSpecification> <timeFrame>UT</timeFrame> <startTime>2016-11-23T15:21:44</startTime> + <!-- + <minStartTime>2017-05-23T15:21:44</minStartTime> + <maxEndTime>2017-11-23T15:21:44</maxEndTime> + --> <duration> <duration>PT3600S</duration> + <!-- + <minimumDuration>PT1600S</minimumDuration> + <maximumDuration>PT7200S</maximumDuration> + --> </duration> </timeWindowSpecification> </observation> diff --git a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.sh b/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.sh deleted file mode 100755 index f66950ab034a164f128778247ce6814114b9c84c..0000000000000000000000000000000000000000 --- a/SAS/SpecificationServices/test/test_lofarxml_to_momxmlmodel_translator.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./runctest.sh test_lofarxml_to_momxmlmodel_translator diff --git a/SAS/SpecificationServices/test/test_specification_service.run b/SAS/SpecificationServices/test/test_specification_service.run deleted file mode 100755 index 90e531df1087838a98d1bee3ff24ad1416154aa5..0000000000000000000000000000000000000000 --- a/SAS/SpecificationServices/test/test_specification_service.run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Run the unit test -source python-coverage.sh -python_coverage_test "specification_service.py" test_specification_service.py \ No newline at end of file diff --git a/SAS/SpecificationServices/test/test_specification_service.sh b/SAS/SpecificationServices/test/test_specification_service.sh deleted file mode 100755 index 0004bbd26235a9de2d9c4bf13f2ca3d3df2d04a1..0000000000000000000000000000000000000000 --- a/SAS/SpecificationServices/test/test_specification_service.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./runctest.sh test_specification_service diff --git a/SAS/SpecificationServices/test/test_translation_service.run b/SAS/SpecificationServices/test/test_translation_service.run deleted file mode 100755 index fdd730902e06d8125a515be452c8e817890af592..0000000000000000000000000000000000000000 --- a/SAS/SpecificationServices/test/test_translation_service.run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Run the unit test -source python-coverage.sh -python_coverage_test "lib/translation_service.py" test_translation_service.py \ No newline at end of file diff --git a/SAS/SpecificationServices/test/test_translation_service.sh b/SAS/SpecificationServices/test/test_translation_service.sh deleted file mode 100755 index 019813249c2ea9b36c3bd0d524ac676b28bb6f4c..0000000000000000000000000000000000000000 --- a/SAS/SpecificationServices/test/test_translation_service.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./runctest.sh test_translation_service \ No newline at end of file diff --git a/SAS/SpecificationServices/xml/telescope_model_type1_template.xml b/SAS/SpecificationServices/xml/telescope_model_type1_template.xml index 3d81161740e0a98e405815df5f984784528ae8a9..8165044f485d1879d97168765d357ee02ac30af6 100644 --- a/SAS/SpecificationServices/xml/telescope_model_type1_template.xml +++ b/SAS/SpecificationServices/xml/telescope_model_type1_template.xml @@ -8,12 +8,12 @@ <name>test-lofar</name> <children> <item index="0"> - <lofar:folder topology_parent="false"> + <lofar:folder topology_parent="false" update_folder="true"> <name>TARGET_A</name> <description>First target</description> <children> <item index="0"> - <lofar:folder topology_parent="true"> + <lofar:folder topology_parent="true" update_folder="false"> <topology>0</topology> <name>AARTFAAC-TRIGGERED</name> <description>Triggered observation by AARTFAAC (Preprocessing)</description> diff --git a/SAS/SpecificationServices/xml/telescope_model_type2_template.xml b/SAS/SpecificationServices/xml/telescope_model_type2_template.xml index bc7b03d0f5321332466ec9c5e73e67679ce7cc0d..9ad691912960edb3f8596fef2c03090bbad1e226 100644 --- a/SAS/SpecificationServices/xml/telescope_model_type2_template.xml +++ b/SAS/SpecificationServices/xml/telescope_model_type2_template.xml @@ -1,1216 +1,1216 @@ <?xml version="1.0" encoding="UTF-8"?> <lofar:project xmlns:lofar="http://www.astron.nl/MoM2-Lofar" xmlns:mom2="http://www.astron.nl/MoM2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar http://lofar.astron.nl:8080/mom3/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 http://lofar.astron.nl:8080/mom3/schemas/MoM2.xsd "> - <version>2.16.6</version> - <template version="2.16.6" author="Alwin de Jong,Adriaan Renting" changedBy="Adriaan Renting"> - <description>XML Template generator version 2.16.6</description> - </template> - <name>LC7_026</name> - <children> - <item index="0"> - <lofar:folder topology_parent="false"> - <name>Transient_2017-03-08</name> - <description>HBA Zero Inner, 110-190 MHz</description> + <version>2.16.6</version> + <template version="2.16.6" author="Alwin de Jong,Adriaan Renting" changedBy="Adriaan Renting"> + <description>XML Template generator version 2.16.6</description> + </template> + <name>LC7_026</name> <children> - <item index="0"> - <lofar:folder topology_parent="true"> - <topology>0</topology> - <name>Transient follow-up</name> - <description>Target Scan (Pulsar)</description> - <children> - <item index="0"> - <lofar:observation> - <name>P0/1/TO</name> - <description>P0/1/TO (Target Observation)</description> - <topology>B0.1.T</topology> - <predecessor_topology/> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:observationAttributes> - <observationId> - </observationId> - <name>P0/1/TO</name> - <projectName>LC7_026</projectName> - <instrument>Beam Observation</instrument> - <defaultTemplate>BeamObservation</defaultTemplate> - <tbbPiggybackAllowed>true</tbbPiggybackAllowed> - <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed> - <userSpecification> - <correlatedData>true</correlatedData> - <coherentStokesData>false</coherentStokesData> - <incoherentStokesData>true</incoherentStokesData> - <antenna>HBA Zero Inner</antenna> - <clock mode="200 MHz"/> - <instrumentFilter>110-190 MHz</instrumentFilter> - <integrationInterval>2.0</integrationInterval> - <channelsPerSubband>64</channelsPerSubband> - <coherentDedisperseChannels>false</coherentDedisperseChannels> - <tiedArrayBeams> - <flyseye>false</flyseye> - </tiedArrayBeams> - <stokes> - <integrateChannels>false</integrateChannels> - <subbandsPerFileCS/> - <numberCollapsedChannelsCS/> - <stokesDownsamplingStepsCS/> - <whichCS/> - <subbandsPerFileIS>512</subbandsPerFileIS> - <numberCollapsedChannelsIS>64</numberCollapsedChannelsIS> - <stokesDownsamplingStepsIS>1</stokesDownsamplingStepsIS> - <whichIS>I</whichIS> - </stokes> - <stationSet>Custom</stationSet> - <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509</stations> - <timeFrame>UT</timeFrame> - <startTime>2017-03-08T09:56:18</startTime> - <endTime>2017-03-08T11:56:18</endTime> - <duration>7200</duration> - <bypassPff>false</bypassPff> - <enableSuperterp>false</enableSuperterp> - <numberOfBitsPerSample>8</numberOfBitsPerSample> - </userSpecification> - </lofar:observationAttributes> - <children> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P0</name> - <description>P0</description> - <topology>B0.1.T.SAP000</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P0</targetName> - <ra>247.25</ra> - <dec>43.9833333333</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP000.uv.dps</name> - <topology>B0.1.T.SAP000.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP000.is</name> - <topology>B0.1.T.SAP000.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P1</name> - <description>P1</description> - <topology>B0.1.T.SAP001</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P1</targetName> - <ra>250.025941667</ra> - <dec>43.9833333333</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP001.uv.dps</name> - <topology>B0.1.T.SAP001.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP001.is</name> - <topology>B0.1.T.SAP001.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P2</name> - <description>P2</description> - <topology>B0.1.T.SAP002</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P2</targetName> - <ra>244.474058333</ra> - <dec>43.9833333333</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP002.uv.dps</name> - <topology>B0.1.T.SAP002.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP002.is</name> - <topology>B0.1.T.SAP002.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P3</name> - <description>P3</description> - <topology>B0.1.T.SAP003</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P3</targetName> - <ra>248.637970833</ra> - <dec>46.3873693611</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP003.uv.dps</name> - <topology>B0.1.T.SAP003.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP003.is</name> - <topology>B0.1.T.SAP003.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P4</name> - <description>P4</description> - <topology>B0.1.T.SAP004</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P4</targetName> - <ra>245.862029167</ra> - <dec>46.3873693611</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP004.uv.dps</name> - <topology>B0.1.T.SAP004.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP004.is</name> - <topology>B0.1.T.SAP004.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P5</name> - <description>P5</description> - <topology>B0.1.T.SAP005</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P5</targetName> - <ra>248.637970833</ra> - <dec>41.5792973056</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP005.uv.dps</name> - <topology>B0.1.T.SAP005.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP005.is</name> - <topology>B0.1.T.SAP005.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P6</name> - <description>P6</description> - <topology>B0.1.T.SAP006</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P6</targetName> - <ra>245.862029167</ra> - <dec>41.5792973056</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP006.uv.dps</name> - <topology>B0.1.T.SAP006.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP006.is</name> - <topology>B0.1.T.SAP006.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>P7</name> - <description>P7</description> - <topology>B0.1.T.SAP007</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>P7</targetName> - <ra>279.1549375</ra> - <dec>33.4702861111</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B0.1.T.SAP007.uv.dps</name> - <topology>B0.1.T.SAP007.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - <item> - <lofar:bfDataProduct> - <name>B0.1.T.SAP007.is</name> - <topology>B0.1.T.SAP007.is</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:bfDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> - </item> -</children> - </lofar:observation> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT0</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P0/1.0/PP</name> - <description>P0/1.0/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP000.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT0.pu.dps</name> - <topology>B0.1.PT0.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT1</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P1/1.1/PP</name> - <description>P1/1.1/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP001.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT1.pu.dps</name> - <topology>B0.1.PT1.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT2</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P2/1.2/PP</name> - <description>P2/1.2/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP002.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT2.pu.dps</name> - <topology>B0.1.PT2.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT3</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P3/1.3/PP</name> - <description>P3/1.3/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP003.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT3.pu.dps</name> - <topology>B0.1.PT3.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT4</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P4/1.4/PP</name> - <description>P4/1.4/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP004.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT4.pu.dps</name> - <topology>B0.1.PT4.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT5</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P5/1.5/PP</name> - <description>P5/1.5/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP005.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT5.pu.dps</name> - <topology>B0.1.PT5.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT6</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P6/1.6/PP</name> - <description>P6/1.6/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP006.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT6.pu.dps</name> - <topology>B0.1.PT6.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> - <topology>B0.1.PT7</topology> - <predecessor_topology>B0.1.T</predecessor_topology> - <name>P7/1.7/PP</name> - <description>P7/1.7/PP (Pulsar Pipeline)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Pulsar Pipeline</defaultTemplate> - <duration>10000</duration> - <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> - <_8bitConversionSigma>5.0</_8bitConversionSigma> - <decodeNblocks>6</decodeNblocks> - <decodeSigma>3</decodeSigma> - <digifilExtraOpts/> - <dspsrExtraOpts/> - <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> - <nofold/> - <nopdmp>true</nopdmp> - <norfi/> - <prepdataExtraOpts/> - <prepfoldExtraOpts/> - <prepsubbandExtraOpts/> - <pulsar>tabfind+</pulsar> - <rawTo8bit/> - <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> - <rrats/> - <singlePulse/> - <skipDsps/> - <skipDynamicSpectrum>true</skipDynamicSpectrum> - <skipPrepfold/> - <tsubint>-1</tsubint> - </pipelineAttributes> - <usedDataProducts> - <item> - <lofar:bfDataProduct topology="B0.1.T.SAP007.is"> - </lofar:bfDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:pulsarDataProduct> - <name>B0.1.PT7.pu.dps</name> - <topology>B0.1.PT7.pu.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:pulsarDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> -</children> - </lofar:folder> - </item> - <item index="0"> - <lofar:folder topology_parent="true"> - <topology>0</topology> - <name>Bookend</name> - <description>Bookend Calibrator Scan (Preprocessing)</description> - <children> - <item index="0"> - <lofar:observation> - <name>3C 196/1/TO</name> - <description>3C 196/1/TO (Target Observation)</description> - <topology>B1.1.T</topology> - <predecessor_topology/> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:observationAttributes> - <observationId> - </observationId> - <name>3C 196/1/TO</name> - <projectName>LC7_026</projectName> - <instrument>Beam Observation</instrument> - <defaultTemplate>BeamObservation</defaultTemplate> - <tbbPiggybackAllowed>true</tbbPiggybackAllowed> - <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed> - <userSpecification> - <correlatedData>true</correlatedData> - <coherentStokesData>false</coherentStokesData> - <incoherentStokesData>false</incoherentStokesData> - <antenna>HBA Zero Inner</antenna> - <clock mode="200 MHz"/> - <instrumentFilter>110-190 MHz</instrumentFilter> - <integrationInterval>1.0</integrationInterval> - <channelsPerSubband>64</channelsPerSubband> - <coherentDedisperseChannels>false</coherentDedisperseChannels> - <tiedArrayBeams> - <flyseye>false</flyseye> - </tiedArrayBeams> - <stokes> - <integrateChannels>false</integrateChannels> - <subbandsPerFileCS/> - <numberCollapsedChannelsCS/> - <stokesDownsamplingStepsCS/> - <whichCS/> - <subbandsPerFileIS/> - <numberCollapsedChannelsIS/> - <stokesDownsamplingStepsIS/> - <whichIS/> - </stokes> - <stationSet>Custom</stationSet> - <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509</stations> - <timeFrame>UT</timeFrame> - <startTime>2017-03-08T11:58:18</startTime> - <endTime>2017-03-08T12:08:18</endTime> - <duration>600</duration> - <bypassPff>false</bypassPff> - <enableSuperterp>false</enableSuperterp> - <numberOfBitsPerSample>8</numberOfBitsPerSample> - </userSpecification> - </lofar:observationAttributes> - <children> -<item index="0"> - <lofar:measurement xsi:type="lofar:BFMeasurementType"> - <name>3C 196</name> - <description>3C 196</description> - <topology>B1.1.T.SAP000</topology> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <lofar:bfMeasurementAttributes> - <measurementType>Target</measurementType> - <specification> - <targetName>3C 196</targetName> - <ra>123.400216667</ra> - <dec>48.217295</dec> - <equinox>J2000</equinox> - <duration>0</duration> - <subbandsSpecification> - <subbands>210..249</subbands> - </subbandsSpecification> - <tiedArrayBeams> - <flyseye>false</flyseye> - <nrTabRings>0</nrTabRings> - <tabRingSize/> - <tiedArrayBeamList> - - </tiedArrayBeamList> - </tiedArrayBeams> - </specification> - </lofar:bfMeasurementAttributes> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B1.1.T.SAP000.uv.dps</name> - <topology>B1.1.T.SAP000.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - </resultDataProducts> - </lofar:measurement> + <lofar:folder topology_parent="false"> + <name>Transient_2017-03-08</name> + <description>HBA Zero Inner, 110-190 MHz</description> + <children> + <item index="0"> + <lofar:folder topology_parent="true"> + <topology>0</topology> + <name>Transient follow-up</name> + <description>Target Scan (Pulsar)</description> + <children> + <item index="0"> + <lofar:observation> + <name>P0/1/TO</name> + <description>P0/1/TO (Target Observation)</description> + <topology>B0.1.T</topology> + <predecessor_topology/> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:observationAttributes> + <observationId> + </observationId> + <name>P0/1/TO</name> + <projectName>LC7_026</projectName> + <instrument>Beam Observation</instrument> + <defaultTemplate>BeamObservation</defaultTemplate> + <tbbPiggybackAllowed>true</tbbPiggybackAllowed> + <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed> + <userSpecification> + <correlatedData>true</correlatedData> + <coherentStokesData>false</coherentStokesData> + <incoherentStokesData>true</incoherentStokesData> + <antenna>HBA Zero Inner</antenna> + <clock mode="200 MHz"/> + <instrumentFilter>110-190 MHz</instrumentFilter> + <integrationInterval>2.0</integrationInterval> + <channelsPerSubband>64</channelsPerSubband> + <coherentDedisperseChannels>false</coherentDedisperseChannels> + <tiedArrayBeams> + <flyseye>false</flyseye> + </tiedArrayBeams> + <stokes> + <integrateChannels>false</integrateChannels> + <subbandsPerFileCS/> + <numberCollapsedChannelsCS/> + <stokesDownsamplingStepsCS/> + <whichCS/> + <subbandsPerFileIS>512</subbandsPerFileIS> + <numberCollapsedChannelsIS>64</numberCollapsedChannelsIS> + <stokesDownsamplingStepsIS>1</stokesDownsamplingStepsIS> + <whichIS>I</whichIS> + </stokes> + <stationSet>Custom</stationSet> + <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509</stations> + <timeFrame>UT</timeFrame> + <startTime>2017-03-08T09:56:18</startTime> + <endTime>2017-03-08T11:56:18</endTime> + <duration>7200</duration> + <bypassPff>false</bypassPff> + <enableSuperterp>false</enableSuperterp> + <numberOfBitsPerSample>8</numberOfBitsPerSample> + </userSpecification> + </lofar:observationAttributes> + <children> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P0</name> + <description>P0</description> + <topology>B0.1.T.SAP000</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P0</targetName> + <ra>247.25</ra> + <dec>43.9833333333</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP000.uv.dps</name> + <topology>B0.1.T.SAP000.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP000.is</name> + <topology>B0.1.T.SAP000.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P1</name> + <description>P1</description> + <topology>B0.1.T.SAP001</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P1</targetName> + <ra>250.025941667</ra> + <dec>43.9833333333</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP001.uv.dps</name> + <topology>B0.1.T.SAP001.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP001.is</name> + <topology>B0.1.T.SAP001.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P2</name> + <description>P2</description> + <topology>B0.1.T.SAP002</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P2</targetName> + <ra>244.474058333</ra> + <dec>43.9833333333</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP002.uv.dps</name> + <topology>B0.1.T.SAP002.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP002.is</name> + <topology>B0.1.T.SAP002.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P3</name> + <description>P3</description> + <topology>B0.1.T.SAP003</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P3</targetName> + <ra>248.637970833</ra> + <dec>46.3873693611</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP003.uv.dps</name> + <topology>B0.1.T.SAP003.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP003.is</name> + <topology>B0.1.T.SAP003.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P4</name> + <description>P4</description> + <topology>B0.1.T.SAP004</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P4</targetName> + <ra>245.862029167</ra> + <dec>46.3873693611</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP004.uv.dps</name> + <topology>B0.1.T.SAP004.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP004.is</name> + <topology>B0.1.T.SAP004.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P5</name> + <description>P5</description> + <topology>B0.1.T.SAP005</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P5</targetName> + <ra>248.637970833</ra> + <dec>41.5792973056</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP005.uv.dps</name> + <topology>B0.1.T.SAP005.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP005.is</name> + <topology>B0.1.T.SAP005.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P6</name> + <description>P6</description> + <topology>B0.1.T.SAP006</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P6</targetName> + <ra>245.862029167</ra> + <dec>41.5792973056</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP006.uv.dps</name> + <topology>B0.1.T.SAP006.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP006.is</name> + <topology>B0.1.T.SAP006.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>P7</name> + <description>P7</description> + <topology>B0.1.T.SAP007</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>P7</targetName> + <ra>279.1549375</ra> + <dec>33.4702861111</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B0.1.T.SAP007.uv.dps</name> + <topology>B0.1.T.SAP007.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + <item> + <lofar:bfDataProduct> + <name>B0.1.T.SAP007.is</name> + <topology>B0.1.T.SAP007.is</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:bfDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + </children> + </lofar:observation> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT0</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P0/1.0/PP</name> + <description>P0/1.0/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP000.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT0.pu.dps</name> + <topology>B0.1.PT0.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT1</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P1/1.1/PP</name> + <description>P1/1.1/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP001.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT1.pu.dps</name> + <topology>B0.1.PT1.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT2</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P2/1.2/PP</name> + <description>P2/1.2/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP002.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT2.pu.dps</name> + <topology>B0.1.PT2.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT3</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P3/1.3/PP</name> + <description>P3/1.3/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP003.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT3.pu.dps</name> + <topology>B0.1.PT3.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT4</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P4/1.4/PP</name> + <description>P4/1.4/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP004.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT4.pu.dps</name> + <topology>B0.1.PT4.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT5</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P5/1.5/PP</name> + <description>P5/1.5/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP005.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT5.pu.dps</name> + <topology>B0.1.PT5.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT6</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P6/1.6/PP</name> + <description>P6/1.6/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP006.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT6.pu.dps</name> + <topology>B0.1.PT6.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:PulsarPipelineType"> + <topology>B0.1.PT7</topology> + <predecessor_topology>B0.1.T</predecessor_topology> + <name>P7/1.7/PP</name> + <description>P7/1.7/PP (Pulsar Pipeline)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Pulsar Pipeline</defaultTemplate> + <duration>10000</duration> + <_2bf2fitsExtraOpts>-nsamples 8192</_2bf2fitsExtraOpts> + <_8bitConversionSigma>5.0</_8bitConversionSigma> + <decodeNblocks>6</decodeNblocks> + <decodeSigma>3</decodeSigma> + <digifilExtraOpts/> + <dspsrExtraOpts/> + <dynamicSpectrumTimeAverage>0.5</dynamicSpectrumTimeAverage> + <nofold/> + <nopdmp>true</nopdmp> + <norfi/> + <prepdataExtraOpts/> + <prepfoldExtraOpts/> + <prepsubbandExtraOpts/> + <pulsar>tabfind+</pulsar> + <rawTo8bit/> + <rfifindExtraOpts>-blocks 1</rfifindExtraOpts> + <rrats/> + <singlePulse/> + <skipDsps/> + <skipDynamicSpectrum>true</skipDynamicSpectrum> + <skipPrepfold/> + <tsubint>-1</tsubint> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:bfDataProduct topology="B0.1.T.SAP007.is"> + </lofar:bfDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:pulsarDataProduct> + <name>B0.1.PT7.pu.dps</name> + <topology>B0.1.PT7.pu.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:pulsarDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + </children> + </lofar:folder> </item> -</children> - </lofar:observation> - </item> - <item index="0"> - <lofar:pipeline xsi:type="lofar:AveragingPipelineType"> - <topology>B1.1.PT0</topology> - <predecessor_topology>B1.1.T</predecessor_topology> - <name>3C 196/1.0/TP</name> - <description>3C 196/1.0/TP (Preprocessing)</description> - <currentStatus> - <mom2:approvedStatus/> - </currentStatus> - <processingCluster> - <name>CEP4</name> - <partition>cpu</partition> - <numberOfTasks>1</numberOfTasks> - <minRAMPerTask unit="byte">1000000000</minRAMPerTask> - <minScratchPerTask unit="byte">100000000</minScratchPerTask> - <maxDurationPerTask>PT600S</maxDurationPerTask> - <numberOfCoresPerTask>20</numberOfCoresPerTask> - <runSimultaneous>true</runSimultaneous> - </processingCluster> - <pipelineAttributes> - <defaultTemplate>Preprocessing Pipeline</defaultTemplate> - <flaggingStrategy>HBAdefault</flaggingStrategy> - <duration>1500</duration> - <demixingParameters> - <averagingFreqStep>16</averagingFreqStep> - <averagingTimeStep>1</averagingTimeStep> - <demixFreqStep>64</demixFreqStep> - <demixTimeStep>10</demixTimeStep> - <demixAlways>[CygA]</demixAlways> - <demixIfNeeded/> - <ignoreTarget/> - </demixingParameters> -</pipelineAttributes> - <usedDataProducts> - <item> - <lofar:uvDataProduct topology="B1.1.T.SAP000.uv.dps"> - </lofar:uvDataProduct> - </item> - </usedDataProducts> - <resultDataProducts> - <item> - <lofar:uvDataProduct> - <name>B1.1.PT0.uv.dps</name> - <topology>B1.1.PT0.uv.dps</topology> - <status>no_data</status> - <storageCluster> - <name>CEP4</name> - <partition>/data/projects/</partition> - </storageCluster> - </lofar:uvDataProduct> - </item> - </resultDataProducts> - </lofar:pipeline> - </item> -</children> - </lofar:folder> - </item> -</children> - </lofar:folder> - </item> - </children> - </lofar:project> \ No newline at end of file + <item index="0"> + <lofar:folder topology_parent="true"> + <topology>0</topology> + <name>Bookend</name> + <description>Bookend Calibrator Scan (Preprocessing)</description> + <children> + <item index="0"> + <lofar:observation> + <name>3C 196/1/TO</name> + <description>3C 196/1/TO (Target Observation)</description> + <topology>B1.1.T</topology> + <predecessor_topology/> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:observationAttributes> + <observationId> + </observationId> + <name>3C 196/1/TO</name> + <projectName>LC7_026</projectName> + <instrument>Beam Observation</instrument> + <defaultTemplate>BeamObservation</defaultTemplate> + <tbbPiggybackAllowed>true</tbbPiggybackAllowed> + <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed> + <userSpecification> + <correlatedData>true</correlatedData> + <coherentStokesData>false</coherentStokesData> + <incoherentStokesData>false</incoherentStokesData> + <antenna>HBA Zero Inner</antenna> + <clock mode="200 MHz"/> + <instrumentFilter>110-190 MHz</instrumentFilter> + <integrationInterval>1.0</integrationInterval> + <channelsPerSubband>64</channelsPerSubband> + <coherentDedisperseChannels>false</coherentDedisperseChannels> + <tiedArrayBeams> + <flyseye>false</flyseye> + </tiedArrayBeams> + <stokes> + <integrateChannels>false</integrateChannels> + <subbandsPerFileCS/> + <numberCollapsedChannelsCS/> + <stokesDownsamplingStepsCS/> + <whichCS/> + <subbandsPerFileIS/> + <numberCollapsedChannelsIS/> + <stokesDownsamplingStepsIS/> + <whichIS/> + </stokes> + <stationSet>Custom</stationSet> + <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501,RS106,RS205,RS208,RS210,RS305,RS306,RS307,RS310,RS406,RS407,RS409,RS503,RS508,RS509</stations> + <timeFrame>UT</timeFrame> + <startTime>2017-03-08T11:58:18</startTime> + <endTime>2017-03-08T12:08:18</endTime> + <duration>600</duration> + <bypassPff>false</bypassPff> + <enableSuperterp>false</enableSuperterp> + <numberOfBitsPerSample>8</numberOfBitsPerSample> + </userSpecification> + </lofar:observationAttributes> + <children> + <item index="0"> + <lofar:measurement xsi:type="lofar:BFMeasurementType"> + <name>3C 196</name> + <description>3C 196</description> + <topology>B1.1.T.SAP000</topology> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <lofar:bfMeasurementAttributes> + <measurementType>Target</measurementType> + <specification> + <targetName>3C 196</targetName> + <ra>123.400216667</ra> + <dec>48.217295</dec> + <equinox>J2000</equinox> + <duration>0</duration> + <subbandsSpecification> + <subbands>210..249</subbands> + </subbandsSpecification> + <tiedArrayBeams> + <flyseye>false</flyseye> + <nrTabRings>0</nrTabRings> + <tabRingSize/> + <tiedArrayBeamList> + + </tiedArrayBeamList> + </tiedArrayBeams> + </specification> + </lofar:bfMeasurementAttributes> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B1.1.T.SAP000.uv.dps</name> + <topology>B1.1.T.SAP000.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + </resultDataProducts> + </lofar:measurement> + </item> + </children> + </lofar:observation> + </item> + <item index="0"> + <lofar:pipeline xsi:type="lofar:AveragingPipelineType"> + <topology>B1.1.PT0</topology> + <predecessor_topology>B1.1.T</predecessor_topology> + <name>3C 196/1.0/TP</name> + <description>3C 196/1.0/TP (Preprocessing)</description> + <currentStatus> + <mom2:approvedStatus/> + </currentStatus> + <processingCluster> + <name>CEP4</name> + <partition>cpu</partition> + <numberOfTasks>1</numberOfTasks> + <minRAMPerTask unit="byte">1000000000</minRAMPerTask> + <minScratchPerTask unit="byte">100000000</minScratchPerTask> + <maxDurationPerTask>PT600S</maxDurationPerTask> + <numberOfCoresPerTask>20</numberOfCoresPerTask> + <runSimultaneous>true</runSimultaneous> + </processingCluster> + <pipelineAttributes> + <defaultTemplate>Preprocessing Pipeline</defaultTemplate> + <flaggingStrategy>HBAdefault</flaggingStrategy> + <duration>1500</duration> + <demixingParameters> + <averagingFreqStep>16</averagingFreqStep> + <averagingTimeStep>1</averagingTimeStep> + <demixFreqStep>64</demixFreqStep> + <demixTimeStep>10</demixTimeStep> + <demixAlways>[CygA]</demixAlways> + <demixIfNeeded/> + <ignoreTarget/> + </demixingParameters> + </pipelineAttributes> + <usedDataProducts> + <item> + <lofar:uvDataProduct topology="B1.1.T.SAP000.uv.dps"> + </lofar:uvDataProduct> + </item> + </usedDataProducts> + <resultDataProducts> + <item> + <lofar:uvDataProduct> + <name>B1.1.PT0.uv.dps</name> + <topology>B1.1.PT0.uv.dps</topology> + <status>no_data</status> + <storageCluster> + <name>CEP4</name> + <partition>/data/projects/</partition> + </storageCluster> + </lofar:uvDataProduct> + </item> + </resultDataProducts> + </lofar:pipeline> + </item> + </children> + </lofar:folder> + </item> + </children> + </lofar:folder> + </item> + </children> +</lofar:project> \ No newline at end of file diff --git a/SAS/TriggerServices/bin/triggerrestinterface b/SAS/TriggerServices/bin/triggerrestinterface index 0bbaccbe0374c48c1876a9fb3c6375abf3be3d3f..6a3b6c52ba467f529a32bc6a5a5af03e21282c4b 100755 --- a/SAS/TriggerServices/bin/triggerrestinterface +++ b/SAS/TriggerServices/bin/triggerrestinterface @@ -24,7 +24,7 @@ echo "---" echo "! This is for testing only, properly deploy in Apache for production use!" echo "---" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -python $DIR/../lib/python2.7/site-packages/lofar/triggerservices/manage.py runserver +python $DIR/../lib64/python2.7/site-packages/lofar/triggerservices/manage.py runserver 0.0.0.0:8000 diff --git a/SAS/TriggerServices/django_rest/restinterface/credentials.py b/SAS/TriggerServices/django_rest/restinterface/credentials.py index 7a459457fe3b396245d0cb1166376115ce28b4fa..874953f1f56baa46b7021e8579cbd54dd8e06c88 100644 --- a/SAS/TriggerServices/django_rest/restinterface/credentials.py +++ b/SAS/TriggerServices/django_rest/restinterface/credentials.py @@ -1,9 +1,7 @@ -SECRET_KEY = 'c0m_v*ghv5-^+xy@dm7-skg5d7#q(q+*pl!@rie)6+h$ln!zoi' +SECRET_KEY = "<redacted>" AUTH_LDAP_SERVER_URI = "ldaps://webportal.astron.nl:30636" -#AUTH_LDAP_SERVER_URI = "ldaps://dop225.astron.nl:636" -#AUTH_LDAP_SERVER_URI = "ldap://10.87.2.225" -AUTH_LDAP_USER_DN_TEMPLATE="uid=%(user)s,ou=Users,o=lofar,c=eu?cn" +AUTH_LDAP_USER_DN_TEMPLATE="cn=%(user)s,ou=Users,o=lofar,c=eu" -AUTH_LDAP_BIND_DN = "cn=ltadownload,o=services" +AUTH_LDAP_BIND_DN = "<redacted>" AUTH_LDAP_BIND_PASSWORD = "<redacted>" diff --git a/SAS/TriggerServices/django_rest/restinterface/settings.py b/SAS/TriggerServices/django_rest/restinterface/settings.py index 8ecbb42a07699ea2ce9aa95c6497a43ee6af3cb3..3b2f09ea4f5d442fecb22865b2fd492d0309c3ad 100644 --- a/SAS/TriggerServices/django_rest/restinterface/settings.py +++ b/SAS/TriggerServices/django_rest/restinterface/settings.py @@ -146,29 +146,12 @@ REST_FRAMEWORK = { 'rest_framework.authentication.SessionAuthentication', ), #'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAdminUser',), - 'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.AllowAny',), # todo: CHANGE FOR PRODUCTION TO --> IsAuthenticated - #'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',), + #'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.AllowAny',), + 'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',), 'PAGE_SIZE': 10, } -# LDAP DEBUG: -#import logging, logging.handlers -#logfile = "/tmp/django-ldap-debug.log" -#my_logger = logging.getLogger('django_auth_ldap') -#my_logger.setLevel(logging.DEBUG) -#handler = logging.handlers.RotatingFileHandler( -# logfile, maxBytes=1024 * 500, backupCount=5) -#my_logger.addHandler(handler) -#import ldap -#print "---" -#server = 'ldap://10.87.2.225' -#user_dn = credentials.AUTH_LDAP_BIND_DN -#password = credentials.AUTH_LDAP_BIND_PASSWORD -#con = ldap.initialize(server) -#print "---" -#con.simple_bind_s(user_dn, password) -#print "---" - +#AUTH_LDAP_GLOBAL_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT: ldap.OPT_X_TLS_NEVER } #AUTH_LDAP_CONNECTION_OPTIONS = { ldap.OPT_X_TLS_REQUIRE_CERT : ldap.OPT_X_TLS_NEVER } AUTH_LDAP_SERVER_URI = credentials.AUTH_LDAP_SERVER_URI AUTH_LDAP_BIND_DN = credentials.AUTH_LDAP_BIND_DN diff --git a/SAS/TriggerServices/test/setup_queues_and_services.sh b/SAS/TriggerServices/test/setup_queues_and_services.sh index e7508555cdc6ba17c9fe9cd37dffdcad42a2b3b3..429ede66a160171b19368b83090854e620b3169e 100755 --- a/SAS/TriggerServices/test/setup_queues_and_services.sh +++ b/SAS/TriggerServices/test/setup_queues_and_services.sh @@ -1,7 +1,7 @@ #/bin/sh -source ~/dev/Triggers/Triggers-Task9895/build/gnu_debug/lofarinit.sh +source ~/dev/Triggers/Triggers-Taski10938/build/gnu_debug/lofarinit.sh killall qpidd killall specificationservice @@ -10,15 +10,13 @@ killall specificationtranslationservice killall triggerservice echo "Setting up queues" -cd dev/qpid-tools-0.32/src/py/ +cd ~/dev/qpid-tools-0.32/src/py/ qpidd & -./qpid-config add exchange topic specificationvalidationbus -./qpid-config add exchange topic specificationtranslationbus -./qpid-config add exchange topic specificationbus -./qpid-config add exchange topic triggerbus -./qpid-config add exchange topic lofar.ts.notification -./qpid-config add exchange topic momquerybus -./qpid-config add exchange topic mom.importxml +./qpid-config add exchange topic devel.lofar.spec.command +./qpid-config add exchange topic devel.lofar.trigger.command +./qpid-config add exchange topic devel.lofar.trigger.notification +./qpid-config add exchange topic devel.lofar.ra.command +./qpid-config add queue mom.importxml @@ -27,6 +25,7 @@ specificationservice & specificationvalidationservice & specificationtranslationservice & triggerservice & +triggerrestinterface & wait diff --git a/SAS/XSD/SAS/LofarSpecification.xsd b/SAS/XSD/SAS/LofarSpecification.xsd index 6dabda39aeba286f57c39c4c5acfd44c74db6853..5a4550b22ea93334c7bb81560e46a9c2a7dd1ce6 100644 --- a/SAS/XSD/SAS/LofarSpecification.xsd +++ b/SAS/XSD/SAS/LofarSpecification.xsd @@ -34,11 +34,15 @@ </xsd:documentation> </xsd:annotation> <xsd:complexType name="Duration"> <!-- this is a specification, not a historical duration --> - <xsd:sequence> - <xsd:element name="duration" type="xsd:duration"/><!-- FIXME we need to think about this some more, it might need to be a choice--> - <xsd:element name="minimumDuration" minOccurs="0" type="xsd:duration"/> - <xsd:element name="maximumDuration" minOccurs="0" type="xsd:duration"/> - </xsd:sequence> + <xsd:choice> + <xsd:sequence> + <xsd:element name="duration" type="xsd:duration"/> + </xsd:sequence> + <xsd:sequence> + <xsd:element name="minimumDuration" type="xsd:duration"/> + <xsd:element name="maximumDuration" type="xsd:duration"/> + </xsd:sequence> + </xsd:choice> </xsd:complexType> <xsd:simpleType name="TimeFrameType"> <!-- Should probably move to LofarBase --> <xsd:restriction base="xsd:string"> @@ -55,29 +59,37 @@ <xsd:element name="minStartTime" type="xsd:dateTime"/> <xsd:element name="maxEndTime" type="xsd:dateTime"/> <xsd:element name="duration" type="spec:Duration"/><!-- Should be less than End - Start, othterwise use one of the other options --> - </xsd:sequence> + </xsd:sequence> <!-- xsd:sequence><This one seems redundant with startTime/duration?> <xsd:element name="startTime" type="xsd:dateTime"/> <xsd:element name="endTime" type="xsd:dateTime"/> - </xsd:sequence --> + </xsd:sequence --> <xsd:sequence><!-- EndTime is implicit as startTime+duration --> <xsd:element name="startTime" type="xsd:dateTime"/> <xsd:element name="duration" type="spec:Duration"/> - </xsd:sequence> + </xsd:sequence> <xsd:sequence> <!-- Start time is dependent on other activities/events --> <xsd:element name="duration" type="spec:Duration"/> - </xsd:sequence> + </xsd:sequence> </xsd:choice> </xsd:sequence> </xsd:complexType> <xsd:simpleType name="LofarStationSelectionType"> <xsd:restriction base="xsd:string"> - <xsd:enumeration value="Single"/> <!-- Needs to be converted into Custom to support the Alwin Scheduler --> - <xsd:enumeration value="Core"/> <!-- Needs to be converted into Custom to support the Alwin Scheduler --> - <xsd:enumeration value="Dutch"/> <!-- Needs to be converted into Custom to support the Alwin Scheduler --> - <xsd:enumeration value="All"/> <!-- Needs to be converted into Custom to support the Alwin Scheduler --> - <!--xsd:enumeration value="International"/--> <!-- Currently not supported in LofarMoM3 --> - <!--xsd:enumeration value="Superterp"/--> <!-- Currently not supported in LofarMoM3 --> + <!-- This list equals the station resource_groups in SAS/ResourceAssignment/ResourceAssignmentDatabase/radb/sql/create_add_virtual_instrument.py --> + <!-- When marshalling to MoM, these need to be replaced with Custom as the Alwin Scheduler and OTDB do not support anything else --> + <xsd:enumeration value="CORE"/> + <xsd:enumeration value="REMOTE"/> + <xsd:enumeration value="INTERNATIONAL"/> + <xsd:enumeration value="SUPERTERP"/> + <xsd:enumeration value="ALL"/> + <xsd:enumeration value="NL"/> + <xsd:enumeration value="CoreSansST"/> + <xsd:enumeration value="VLBI"/> + <xsd:enumeration value="AARTFAAC"/> + <xsd:enumeration value="Core2KM"/> + <xsd:enumeration value="LORA"/> + <xsd:enumeration value="Custom"/> <!-- only one currently supported by the Alwin Scheduler and OTDB --> </xsd:restriction> </xsd:simpleType> @@ -87,7 +99,6 @@ <xsd:choice> <xsd:sequence> <xsd:element name="minimumConstraint" type="xsd:integer"/> - <xsd:element name="maximumConstraint" minOccurs="0" type="xsd:integer"/> </xsd:sequence> <xsd:element name="stations" minOccurs="0" type="base:Stations"/> </xsd:choice> @@ -138,7 +149,7 @@ <xsd:element name="ingest" type="base:Ingest"/> <xsd:element name="cleanup" type="base:Cleanup"/> </xsd:choice> - <xsd:element name="status" minOccurs="0" type="xsd:string"/><!-- default would be opened, might need to be come an enum --> + <xsd:element name="status" minOccurs="0" type="xsd:string"/><!-- default would be opened, might need to be come an enum --> <xsd:element name="qualityOfService" type="spec:QualityOfServiceType" default="THROUGHPUT"/><!-- qualityOfService and TriggerId might need to move to the base: classes --> <xsd:element name="priority" type="spec:PriorityType"/> <xsd:element name="triggerId" minOccurs="0" type="base:Identifier"/> @@ -146,8 +157,8 @@ </xsd:complexType> <xsd:annotation> <xsd:documentation>============================LOFAR Specification entities============================ - - Entities describe datasets not individual data products. + + Entities describe datasets not individual data products. MoM calls this "Placeholder dataproducts" and it is implemented this way for backward compatibility with that system. We don't need actual dataproducts here, as those don't exist yet, just a reference to the types we want to create. It might need a bit more detail with Coherent Stokes and Incoherent Stokes, which currently is coded into the topology (!!) @@ -173,12 +184,12 @@ </xsd:complexType> <xsd:annotation> <xsd:documentation>============================LOFAR Specification relations============================ - + These relations allow more flexibility than a purely nested structure. They can show the different ways that objects are related to allow for different types of visualisation. - + We decided not to make specific [Class]Identifiers because they would still all be a base:Identifier. We need to check if - relations are pointing to the correct classes outside of the XSD validation. + relations are pointing to the correct classes outside of the XSD validation. Objects that are defined in the specification XML should contain temporary Identifiers, but Relations can point to an existing Identifier from e.g. MoM or SAS. How to check this isn't clear yet, but will need to be handled at some point. @@ -272,11 +283,11 @@ </xsd:complexType> <xsd:annotation> <xsd:documentation>============================LOFAR Specification Identifier ============================ - + This is to be able to enforce the relations between the activities and entities in the specification. It might be useful to move some of this to LofarBase at some point. </xsd:documentation> - </xsd:annotation> + </xsd:annotation> <xsd:simpleType name="IdentifierType"> <!-- some of this might need to be in base: --> <xsd:restriction base="xsd:string"> <xsd:enumeration value="folder"/> @@ -296,7 +307,7 @@ </xsd:complexType> <xsd:annotation> <xsd:documentation>============================LOFAR Specification root element============================ - + This contains the other objects in the specification and their relations. It also contains properties that pertain to the whole specification and not a specific object. It needs to have at least one container/folder to put into the project in MoM that will then contain other objects. Activities and entities should and can't be related to the project directly. @@ -326,4 +337,4 @@ <xsd:field xpath="@type"/> </xsd:key> </xsd:element> -</xsd:schema> +</xsd:schema> \ No newline at end of file diff --git a/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py b/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py index 04cb1fd2a270dba10f2cd03959f9d183cef8012c..a86bca03c02a7c786436163aaf8a279c34d07a0e 100755 --- a/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py +++ b/support/tools/MoM/convert_split_and_rename_mom_database_sqldump.py @@ -1,5 +1,5 @@ #!/usr/bin/python - +import os # This script reads infile and creates sql files for each part in the infile in the # outdir directory. It also replaces references to the indatabase with references # to the outdatabase. @@ -26,7 +26,11 @@ outIDMdatabase = "lofar_mom_test_rt_trigger_idm" inUserAdmindatabase = "useradministration" outUserAdmindatabase = "lofar_mom_test_rt_trigger_useradmin" -outfile = open(outdir +"000000_CREATE_DATABASE.sql", 'w') +if os.listdir(outdir) != []: + print "Output directory not empty! Aborting" + exit() + +outfile = open(outdir + "000000_CREATE_DATABASE.sql", 'w') # Please note that "Comments" in the SQL that look like this # /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -82,6 +86,7 @@ outfile = open(outdir +"000000_CREATE_DATABASE.sql", 'w') # - Generated views for the BiRT viewer (starting with /*!50001 VIEW ) # - Comments # - USE statements +# - Foreign keys # We only check for these and not all lines of the SQL, as this saves having to parse the # WRITE statements that are 99% of the SQL and by far the longest lines. @@ -94,7 +99,8 @@ possible_trigger = False trigger = False with open(infile) as f: for line in f: - if not use_found or trigger or (line[0:13] == "/*!50001 VIEW") or (line[0:2] == '--'): + if not use_found or trigger or (line[0:13] == "/*!50001 VIEW") or (line[0:2] == '--') or \ + "CONSTRAINT" in line[0:len("CONSTRAINT") + 2]: # "/*!50001 VIEW" are special BiRT viewer generated views if indatabase in line: #doing this for each line would be expensive line = line.replace(indatabase, outdatabase)