diff --git a/docker-compose/logstash/loki.conf b/docker-compose/logstash/loki.conf index 0423b33144dbe6d61fb22e583c9385ce99a7dd90..b0b22e26996f82f5dcdb9561183090abb131dbad 100644 --- a/docker-compose/logstash/loki.conf +++ b/docker-compose/logstash/loki.conf @@ -97,16 +97,16 @@ filter { } filter { - # mark all our mariadb instances + # mark our tangodb instances grok { match => { - "program" => [ "archiver-maria-db", "tangodb" ] + "program" => ["tangodb" ] } - add_tag => [ "mariadb" ] + add_tag => [ "tangodb" ] } - # parse mariadb output - if "mariadb" in [tags] { + # parse tangodb output + if "tangodb" in [tags] { grok { match => { "message" => [ diff --git a/jupyter-notebooks/Archiving_load_test.ipynb b/jupyter-notebooks/Archiving_load_test.ipynb deleted file mode 100644 index 1a39a3115949398fd2743d4122aa053bd6f880f6..0000000000000000000000000000000000000000 --- a/jupyter-notebooks/Archiving_load_test.ipynb +++ /dev/null @@ -1,1135 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "d9f35471", - "metadata": {}, - "outputs": [], - "source": [ - "import sys, time\n", - "import numpy as np\n", - "sys.path.append('/hosthome/tango/tangostationcontrol/tangostationcontrol')\n", - "from toolkit.archiver import *\n", - "from matplotlib import pyplot as plt" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "5817986f", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/recv/1/version_r not found in archiving list!\n", - "Attribute stat/recv/1/opcua_missing_attributes_r not found in archiving list!\n", - "Attribute stat/recv/1/ant_status_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_colour_r not found in archiving list!\n", - "Attribute stat/recv/1/ant_mask_rw removed!\n", - "Attribute stat/recv/1/hbat_bf_delays_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_bf_delays_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_led_on_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_led_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_on_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_adc_locked_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_attenuator_db_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_attenuator_db_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_band_select_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_band_select_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_dth_freq_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_dth_freq_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_dth_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_green_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_green_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_red_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_red_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_mask_rw removed!\n", - "Attribute stat/recv/1/rcu_pcb_id_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pcb_number_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pcb_version_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_1v8_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_2v5_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_3v3_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_analog_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_iout_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vin_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vout_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_digital_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_good_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_temp_r not found in archiving list!\n", - "Attribute stat/recv/1/recvtr_i2c_error_r not found in archiving list!\n", - "Attribute stat/recv/1/recvtr_monitor_rate_rw not found in archiving list!\n", - "Attribute stat/recv/1/recvtr_translator_busy_r not found in archiving list!\n", - "Attribute stat/recv/1/state removed!\n", - "Attribute stat/recv/1/status not found in archiving list!\n", - "Attribute stat/sdp/1/version_r not found in archiving list!\n", - "Attribute stat/sdp/1/opcua_missing_attributes_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_phase_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_firmware_version_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_global_node_index_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_hardware_version_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_processing_enable_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_processing_enable_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_scrap_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_scrap_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_antenna_band_index_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_block_period_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_f_adc_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_fsub_type_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_subband_weights_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_subband_weights_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_temp_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_weights_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_weights_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_enable_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_enable_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_phase_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_fpga_mask_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_fpga_mask_rw not found in archiving list!\n", - "Attribute stat/sdp/1/tr_fpga_communication_error_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_sdp_config_first_fpga_nr_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_beamsets_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_fpgas_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_software_version_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_start_time_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_tod_r removed!\n", - "Attribute stat/sdp/1/tr_tod_pps_delta_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_signal_input_mean_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_signal_input_rms_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_rbd_count_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_dev_syncn_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err0_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err1_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_bsn_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_packets_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_valid_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_err_r not found in archiving list!\n", - "Attribute stat/sdp/1/state not found in archiving list!\n", - "Attribute stat/sdp/1/status not found in archiving list!\n", - "Device STAT/SST/1 offline\n", - "Device STAT/XST/1 offline\n", - "Device STAT/UNB2/1 offline\n" - ] - } - ], - "source": [ - "# Apply the chosen JSON configuration file in directory toolkit/archiver_config/\n", - "archiver = Archiver(selector_filename='lofar2.json')" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "848dc5e7", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "lofar2.json\n" - ] - }, - { - "data": { - "text/plain": [ - "{'global_variables': {'development_polling_time': '10000',\n", - " 'development_archive_time': '60000'},\n", - " 'devices': {'STAT/RECV/1': {'environment': 'development',\n", - " 'include': [],\n", - " 'exclude': ['CLK_Enable_PWR_R',\n", - " 'CLK_I2C_STATUS_R',\n", - " 'CLK_PLL_error_R',\n", - " 'CLK_PLL_locked_R',\n", - " 'CLK_translator_busy_R']},\n", - " 'STAT/SDP/1': {'environment': 'development',\n", - " 'include': [],\n", - " 'exclude': ['FPGA_scrap_R', 'FPGA_scrap_RW']},\n", - " 'STAT/SST/1': {'environment': 'development', 'include': [], 'exclude': []},\n", - " 'STAT/XST/1': {'environment': 'development', 'include': [], 'exclude': []},\n", - " 'STAT/UNB2/1': {'environment': 'development', 'include': [], 'exclude': []}}}" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the configuration file (as a dictionary)\n", - "selector = archiver.selector\n", - "print(selector.filename)\n", - "env_dict = selector.get_dict()\n", - "env_dict" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "a81e8b3b", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "OFF\n" - ] - } - ], - "source": [ - "device_name = 'STAT/RECV/1'\n", - "d=DeviceProxy(device_name) \n", - "d.set_timeout_millis(10000)\n", - "state = str(d.state())\n", - "print(state)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "f5394d09", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/recv/1/version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/opcua_missing_attributes_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/ant_status_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_colour_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_bf_delays_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_bf_delays_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_led_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_led_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_adc_locked_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_attenuator_db_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_attenuator_db_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_band_select_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_band_select_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_dth_freq_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_dth_freq_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_dth_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_green_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_green_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_red_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_red_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pcb_id_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pcb_number_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pcb_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_1v8_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_2v5_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_3v3_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_analog_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_iout_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vin_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vout_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_digital_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_good_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_temp_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/recvtr_i2c_error_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/recvtr_monitor_rate_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/recvtr_translator_busy_r will not be archived because polling is set to FALSE!\n" - ] - } - ], - "source": [ - "# Add RECV attributes to perform load test\n", - "archiver.add_attributes_by_device(device_name,global_archive_period=5000)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "ba3a25ac", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'tango://databaseds:10000/stat/recv/1/ant_mask_rw': 'Read value for attribute ANT_mask_RW has not been updated',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_mask_rw': 'Read value for attribute RCU_mask_RW has not been updated',\n", - " 'tango://databaseds:10000/stat/recv/1/status': 'Storing Error: mysql_stmt_bind_param() failed, err=Buffer type is not supported'}" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the errors for each attribute\n", - "# If the device is in OFF state, all its attributes should be in error (normal behaviour)\n", - "err_dict = archiver.get_subscriber_errors()\n", - "err_dict" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "b4de92a0", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Device is now in ON state\n" - ] - } - ], - "source": [ - "# Start the device\n", - "if state == \"OFF\":\n", - " time.sleep(1)\n", - " d.initialise()\n", - " time.sleep(1)\n", - "state = str(d.state())\n", - "if state == \"STANDBY\":\n", - " d.set_defaults()\n", - " d.on()\n", - "state = str(d.state())\n", - "if state == \"ON\":\n", - " print(\"Device is now in ON state\")" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "5d40b87c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['tango://databaseds:10000/stat/recv/1/ant_mask_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_mask_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/state',\n", - " 'tango://databaseds:10000/stat/recv/1/status']" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the attributes currently managed by the event subscriber\n", - "attrs = archiver.get_subscriber_attributes()\n", - "attrs" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "678879e3", - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "data": { - "text/plain": [ - "{'tango://databaseds:10000/stat/recv/1/ant_mask_rw': 'Read value for attribute ANT_mask_RW has not been updated',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_mask_rw': 'Read value for attribute RCU_mask_RW has not been updated',\n", - " 'tango://databaseds:10000/stat/recv/1/status': 'Storing Error: mysql_stmt_bind_param() failed, err=Buffer type is not supported'}" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the errors for each attribute\n", - "err_dict = archiver.get_subscriber_errors()\n", - "err_dict" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "d3904658", - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Attribute Poll Period Archive Period \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 1000 5000 \n", - "STAT/RECV/1/rcu_mask_rw 1000 5000 \n", - "STAT/RECV/1/state 1000 5000 \n", - "STAT/RECV/1/status 1000 5000 \n" - ] - } - ], - "source": [ - "# Print the attribute periods\n", - "def print_periods(attrs):\n", - " print(\"{:<45} {:<15} {:<15}\".format('Attribute','Poll Period','Archive Period'))\n", - " print(\"----------\")\n", - " for a in attrs:\n", - " a = parse_attribute_name(a)\n", - " ap = AttributeProxy(a)\n", - " att_fqname = ap.get_device_proxy().name()+'/'+ap.name()\n", - " print(\"{:<45} {:<15} {:<15}\".format(att_fqname,ap.get_poll_period(),ap.get_property('archive_period')['archive_period'][0],sep='\\t'))\n", - "\n", - "attrs = archiver.get_subscriber_attributes()\n", - "print_periods(attrs)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "27ef5564", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'0.0 events/period'" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the current event subscriber archive frequency (number of total archive events per minute)\n", - "# Be aware that these statistics need some time (even minutes) since the device initialization to be reliable\n", - "archiver.get_subscriber_load()" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "241b5282", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Attribute Record Freq Failure Freq \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 0.0 12.0 \n", - "STAT/RECV/1/rcu_mask_rw 0.0 12.0 \n", - "STAT/RECV/1/state 0.0 12.0 \n", - "STAT/RECV/1/status 0.0 12.0 \n" - ] - } - ], - "source": [ - "# Print the current attribute archive frequency (number of events per minute)\n", - "# E.G. if an attribute is supposed to be archived every 10s, its frequency value should be 6\n", - "def print_freq(attrs):\n", - " print(\"{:<45} {:<15} {:<15}\".format('Attribute','Record Freq','Failure Freq'))\n", - " print(\"----------\")\n", - " for a in attrs:\n", - " a = parse_attribute_name(a)\n", - " ap = AttributeProxy(a)\n", - " att_fqname = ap.get_device_proxy().name()+'/'+ap.name()\n", - " print(\"{:<45} {:<15} {:<15}\".format(att_fqname,archiver.get_attribute_freq(att_fqname),archiver.get_attribute_failures(att_fqname)))\n", - "\n", - "attrs = archiver.get_subscriber_attributes()\n", - "print_freq(attrs)" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "25446390", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute STAT/RECV/1/rcu_mask_rw removed!\n" - ] - } - ], - "source": [ - "# Update the archive time of an attribute\n", - "archiver.update_archiving_attribute('STAT/RECV/1/rcu_mask_rw',polling_period=1000,event_period=10000)" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "9cc4f883", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Attribute Poll Period Archive Period \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 1000 5000 \n", - "STAT/RECV/1/state 1000 5000 \n", - "STAT/RECV/1/status 1000 5000 \n", - "STAT/RECV/1/rcu_mask_rw 1000 10000 \n", - "\n", - "Attribute Record Freq Failure Freq \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 0.0 3.0 \n", - "STAT/RECV/1/state 1.0 2.0 \n", - "STAT/RECV/1/status -1.0 4.0 \n", - "STAT/RECV/1/rcu_mask_rw 1.0 0.0 \n" - ] - } - ], - "source": [ - "attrs = archiver.get_subscriber_attributes()\n", - "print_periods(attrs)\n", - "print()\n", - "print_freq(attrs)" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "c3415c09", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/sdp/1/version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/opcua_missing_attributes_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_phase_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_rw will not be archived because polling is set to FALSE!\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "OFF\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/sdp/1/fpga_beamlet_output_scale_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_firmware_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_global_node_index_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_hardware_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_processing_enable_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_processing_enable_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_antenna_band_index_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_block_period_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_f_adc_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_fsub_type_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_subband_weights_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_subband_weights_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_enable_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_enable_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_phase_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_fpga_mask_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_fpga_mask_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_fpga_communication_error_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_sdp_config_first_fpga_nr_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_beamsets_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_fpgas_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_software_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_start_time_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_tod_pps_delta_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_signal_input_mean_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_signal_input_rms_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_rbd_count_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_dev_syncn_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err0_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err1_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_bsn_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_packets_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_valid_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_err_r will not be archived because polling is set to FALSE!\n" - ] - } - ], - "source": [ - "# Add SDP attributes to load test\n", - "sdp_name = 'STAT/SDP/1'\n", - "d2=DeviceProxy(sdp_name) \n", - "state = str(d2.state())\n", - "print(state)\n", - "archiver.add_attributes_by_device(sdp_name,global_archive_period=5000)" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "141c52da", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Device is now in ON state\n" - ] - } - ], - "source": [ - "# Start the SDP device\n", - "if state == \"OFF\":\n", - " d2.set_timeout_millis(10000)#Temporary workaround due to new SPD implementation\n", - " time.sleep(1)\n", - " d2.initialise()\n", - " time.sleep(1)\n", - "state = str(d2.state())\n", - "if state == \"STANDBY\":\n", - " d.set_defaults()\n", - " d2.on()\n", - "state = str(d2.state())\n", - "if state == \"ON\":\n", - " print(\"Device is now in ON state\")" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "b53e5b8b", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'tango://databaseds:10000/stat/recv/1/status': 'Storing Error: mysql_stmt_bind_param() failed, err=Buffer type is not supported',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_scrap_r': 'Read value for attribute FPGA_scrap_R has not been updated',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_scrap_rw': 'Read value for attribute FPGA_scrap_RW has not been updated',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_temp_r': 'Read value for attribute FPGA_temp_R has not been updated',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_weights_r': 'Read value for attribute FPGA_weights_R has not been updated',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_weights_rw': 'Read value for attribute FPGA_weights_RW has not been updated',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_tod_r': 'Read value for attribute TR_tod_R has not been updated'}" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Check errors\n", - "err_dict = archiver.get_subscriber_errors()\n", - "err_dict\n", - "#Reminder: MySQL DBMS cannot handle SPD/FPGA_scrap_R attribute probably due to its dimension (8192)" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "4fed6cf4", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Attribute Poll Period Archive Period \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 1000 5000 \n", - "STAT/RECV/1/state 1000 5000 \n", - "STAT/RECV/1/status 1000 5000 \n", - "STAT/RECV/1/rcu_mask_rw 1000 10000 \n", - "STAT/SDP/1/fpga_scrap_r 1000 5000 \n", - "STAT/SDP/1/fpga_scrap_rw 1000 5000 \n", - "STAT/SDP/1/fpga_temp_r 1000 5000 \n", - "STAT/SDP/1/fpga_weights_r 1000 5000 \n", - "STAT/SDP/1/fpga_weights_rw 1000 5000 \n", - "STAT/SDP/1/tr_tod_r 1000 5000 \n", - "\n", - "Attribute Record Freq Failure Freq \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 0.0 3.0 \n", - "STAT/RECV/1/state 1.0 2.0 \n", - "STAT/RECV/1/status -1.0 4.0 \n", - "STAT/RECV/1/rcu_mask_rw 1.0 0.0 \n", - "STAT/SDP/1/fpga_scrap_r -6.0 18.0 \n", - "STAT/SDP/1/fpga_scrap_rw -6.0 18.0 \n", - "STAT/SDP/1/fpga_temp_r 0.0 12.0 \n", - "STAT/SDP/1/fpga_weights_r -6.0 18.0 \n", - "STAT/SDP/1/fpga_weights_rw -6.0 18.0 \n", - "STAT/SDP/1/tr_tod_r 0.0 12.0 \n" - ] - } - ], - "source": [ - "# Check frequencies\n", - "attrs = archiver.get_subscriber_attributes()\n", - "print_periods(attrs)\n", - "print()\n", - "print_freq(attrs)" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "6e495661", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'stat/recv/1/ant_mask_rw'" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Initialise the retriever object and print the archived attributes in the database\n", - "retriever = Retriever()\n", - "# Attribute chosen to be retrieved\n", - "attr_name = 'ant_mask_rw'\n", - "attr_fq_name = str(device_name+'/'+attr_name).lower()\n", - "attr_fq_name" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "304f50f1", - "metadata": {}, - "outputs": [], - "source": [ - "# Retrieve records in the last n hours (works even with decimals)\n", - "\n", - "# Use alternatively one of the following two methods to retrieve data (last n hours or interval)\n", - "records= retriever.get_attribute_value_by_hours(attr_fq_name,hours=0.1)\n", - "#records = retriever.get_attribute_value_by_interval(attr_fq_name,'2021-09-01 16:00:00', '2021-09-01 16:03:00')\n", - "\n", - "if not records:\n", - " print('Empty result!')\n", - "else:\n", - " # Convert DB Array records into Python lists\n", - " data = build_array_from_record(records,records[0].dim_x_r)\n", - " # Extract only the value from the array \n", - " array_values = get_values_from_record(data)\n", - "\n", - "#records\n", - "#data\n", - "#array_values" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "fb2c19f4", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[[<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:29.957895',recv_time='2021-11-09 11:52:30.955440',insert_time='2021-11-09 11:52:30.957113',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:29.957895',recv_time='2021-11-09 11:52:30.955440',insert_time='2021-11-09 11:52:30.957113',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:29.957895',recv_time='2021-11-09 11:52:30.955440',insert_time='2021-11-09 11:52:30.957113',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:40.957954',recv_time='2021-11-09 11:52:40.997550',insert_time='2021-11-09 11:52:40.998981',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:40.957954',recv_time='2021-11-09 11:52:40.997550',insert_time='2021-11-09 11:52:40.998981',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:40.957954',recv_time='2021-11-09 11:52:40.997550',insert_time='2021-11-09 11:52:40.998981',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:50.958367',recv_time='2021-11-09 11:52:51.031650',insert_time='2021-11-09 11:52:51.033094',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:50.958367',recv_time='2021-11-09 11:52:51.031650',insert_time='2021-11-09 11:52:51.033094',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:52:50.958367',recv_time='2021-11-09 11:52:51.031650',insert_time='2021-11-09 11:52:51.033094',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:00.957834',recv_time='2021-11-09 11:53:01.070405',insert_time='2021-11-09 11:53:01.071890',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:00.957834',recv_time='2021-11-09 11:53:01.070405',insert_time='2021-11-09 11:53:01.071890',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:00.957834',recv_time='2021-11-09 11:53:01.070405',insert_time='2021-11-09 11:53:01.071890',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:10.957778',recv_time='2021-11-09 11:53:11.109409',insert_time='2021-11-09 11:53:11.110791',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:10.957778',recv_time='2021-11-09 11:53:11.109409',insert_time='2021-11-09 11:53:11.110791',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:10.957778',recv_time='2021-11-09 11:53:11.109409',insert_time='2021-11-09 11:53:11.110791',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:20.958163',recv_time='2021-11-09 11:53:21.139904',insert_time='2021-11-09 11:53:21.141175',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:20.958163',recv_time='2021-11-09 11:53:21.139904',insert_time='2021-11-09 11:53:21.141175',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:20.958163',recv_time='2021-11-09 11:53:21.139904',insert_time='2021-11-09 11:53:21.141175',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:30.958127',recv_time='2021-11-09 11:53:31.177200',insert_time='2021-11-09 11:53:31.178474',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:30.958127',recv_time='2021-11-09 11:53:31.177200',insert_time='2021-11-09 11:53:31.178474',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:30.958127',recv_time='2021-11-09 11:53:31.177200',insert_time='2021-11-09 11:53:31.178474',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:40.957758',recv_time='2021-11-09 11:53:41.215064',insert_time='2021-11-09 11:53:41.216572',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:40.957758',recv_time='2021-11-09 11:53:41.215064',insert_time='2021-11-09 11:53:41.216572',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:40.957758',recv_time='2021-11-09 11:53:41.215064',insert_time='2021-11-09 11:53:41.216572',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:50.958355',recv_time='2021-11-09 11:53:51.248946',insert_time='2021-11-09 11:53:51.250289',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:50.958355',recv_time='2021-11-09 11:53:51.248946',insert_time='2021-11-09 11:53:51.250289',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:53:50.958355',recv_time='2021-11-09 11:53:51.248946',insert_time='2021-11-09 11:53:51.250289',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:00.958079',recv_time='2021-11-09 11:54:01.282162',insert_time='2021-11-09 11:54:01.283518',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:00.958079',recv_time='2021-11-09 11:54:01.282162',insert_time='2021-11-09 11:54:01.283518',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:00.958079',recv_time='2021-11-09 11:54:01.282162',insert_time='2021-11-09 11:54:01.283518',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:10.958288',recv_time='2021-11-09 11:54:11.313545',insert_time='2021-11-09 11:54:11.314891',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:10.958288',recv_time='2021-11-09 11:54:11.313545',insert_time='2021-11-09 11:54:11.314891',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:10.958288',recv_time='2021-11-09 11:54:11.313545',insert_time='2021-11-09 11:54:11.314891',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:20.958563',recv_time='2021-11-09 11:54:21.344520',insert_time='2021-11-09 11:54:21.345807',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:20.958563',recv_time='2021-11-09 11:54:21.344520',insert_time='2021-11-09 11:54:21.345807',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:20.958563',recv_time='2021-11-09 11:54:21.344520',insert_time='2021-11-09 11:54:21.345807',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:30.958539',recv_time='2021-11-09 11:54:31.379597',insert_time='2021-11-09 11:54:31.380996',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:30.958539',recv_time='2021-11-09 11:54:31.379597',insert_time='2021-11-09 11:54:31.380996',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:30.958539',recv_time='2021-11-09 11:54:31.379597',insert_time='2021-11-09 11:54:31.380996',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:40.958046',recv_time='2021-11-09 11:54:41.414444',insert_time='2021-11-09 11:54:41.415878',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:40.958046',recv_time='2021-11-09 11:54:41.414444',insert_time='2021-11-09 11:54:41.415878',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:40.958046',recv_time='2021-11-09 11:54:41.414444',insert_time='2021-11-09 11:54:41.415878',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:50.958498',recv_time='2021-11-09 11:54:51.446569',insert_time='2021-11-09 11:54:51.447766',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:50.958498',recv_time='2021-11-09 11:54:51.446569',insert_time='2021-11-09 11:54:51.447766',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:54:50.958498',recv_time='2021-11-09 11:54:51.446569',insert_time='2021-11-09 11:54:51.447766',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:00.958172',recv_time='2021-11-09 11:55:01.478610',insert_time='2021-11-09 11:55:01.480002',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:00.958172',recv_time='2021-11-09 11:55:01.478610',insert_time='2021-11-09 11:55:01.480002',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:00.958172',recv_time='2021-11-09 11:55:01.478610',insert_time='2021-11-09 11:55:01.480002',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:10.957568',recv_time='2021-11-09 11:55:11.517281',insert_time='2021-11-09 11:55:11.518621',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:10.957568',recv_time='2021-11-09 11:55:11.517281',insert_time='2021-11-09 11:55:11.518621',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:10.957568',recv_time='2021-11-09 11:55:11.517281',insert_time='2021-11-09 11:55:11.518621',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:20.958282',recv_time='2021-11-09 11:55:21.552854',insert_time='2021-11-09 11:55:21.554212',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:20.958282',recv_time='2021-11-09 11:55:21.552854',insert_time='2021-11-09 11:55:21.554212',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:20.958282',recv_time='2021-11-09 11:55:21.552854',insert_time='2021-11-09 11:55:21.554212',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:30.957464',recv_time='2021-11-09 11:55:31.585827',insert_time='2021-11-09 11:55:31.587218',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:30.957464',recv_time='2021-11-09 11:55:31.585827',insert_time='2021-11-09 11:55:31.587218',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:30.957464',recv_time='2021-11-09 11:55:31.585827',insert_time='2021-11-09 11:55:31.587218',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:40.958453',recv_time='2021-11-09 11:55:41.618850',insert_time='2021-11-09 11:55:41.620081',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:40.958453',recv_time='2021-11-09 11:55:41.618850',insert_time='2021-11-09 11:55:41.620081',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:40.958453',recv_time='2021-11-09 11:55:41.618850',insert_time='2021-11-09 11:55:41.620081',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:50.958024',recv_time='2021-11-09 11:55:51.653490',insert_time='2021-11-09 11:55:51.654830',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:50.958024',recv_time='2021-11-09 11:55:51.653490',insert_time='2021-11-09 11:55:51.654830',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:55:50.958024',recv_time='2021-11-09 11:55:51.653490',insert_time='2021-11-09 11:55:51.654830',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:00.957550',recv_time='2021-11-09 11:56:01.685266',insert_time='2021-11-09 11:56:01.686650',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:00.957550',recv_time='2021-11-09 11:56:01.685266',insert_time='2021-11-09 11:56:01.686650',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:00.957550',recv_time='2021-11-09 11:56:01.685266',insert_time='2021-11-09 11:56:01.686650',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:10.958180',recv_time='2021-11-09 11:56:11.728988',insert_time='2021-11-09 11:56:11.730311',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:10.958180',recv_time='2021-11-09 11:56:11.728988',insert_time='2021-11-09 11:56:11.730311',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:10.958180',recv_time='2021-11-09 11:56:11.728988',insert_time='2021-11-09 11:56:11.730311',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:20.957521',recv_time='2021-11-09 11:56:21.762715',insert_time='2021-11-09 11:56:21.763981',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:20.957521',recv_time='2021-11-09 11:56:21.762715',insert_time='2021-11-09 11:56:21.763981',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:20.957521',recv_time='2021-11-09 11:56:21.762715',insert_time='2021-11-09 11:56:21.763981',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:30.957691',recv_time='2021-11-09 11:56:31.798641',insert_time='2021-11-09 11:56:31.799975',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:30.957691',recv_time='2021-11-09 11:56:31.798641',insert_time='2021-11-09 11:56:31.799975',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:30.957691',recv_time='2021-11-09 11:56:31.798641',insert_time='2021-11-09 11:56:31.799975',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:40.957644',recv_time='2021-11-09 11:56:41.839704',insert_time='2021-11-09 11:56:41.841005',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:40.957644',recv_time='2021-11-09 11:56:41.839704',insert_time='2021-11-09 11:56:41.841005',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:40.957644',recv_time='2021-11-09 11:56:41.839704',insert_time='2021-11-09 11:56:41.841005',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:50.957540',recv_time='2021-11-09 11:56:51.873701',insert_time='2021-11-09 11:56:51.875028',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:50.957540',recv_time='2021-11-09 11:56:51.873701',insert_time='2021-11-09 11:56:51.875028',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:56:50.957540',recv_time='2021-11-09 11:56:51.873701',insert_time='2021-11-09 11:56:51.875028',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:00.957772',recv_time='2021-11-09 11:57:01.913800',insert_time='2021-11-09 11:57:01.915239',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:00.957772',recv_time='2021-11-09 11:57:01.913800',insert_time='2021-11-09 11:57:01.915239',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:00.957772',recv_time='2021-11-09 11:57:01.913800',insert_time='2021-11-09 11:57:01.915239',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:10.957623',recv_time='2021-11-09 11:57:11.952909',insert_time='2021-11-09 11:57:11.954569',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:10.957623',recv_time='2021-11-09 11:57:11.952909',insert_time='2021-11-09 11:57:11.954569',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:10.957623',recv_time='2021-11-09 11:57:11.952909',insert_time='2021-11-09 11:57:11.954569',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:51.958517',recv_time='2021-11-09 11:57:52.032720',insert_time='2021-11-09 11:57:52.034096',idx='0',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:51.958517',recv_time='2021-11-09 11:57:52.032720',insert_time='2021-11-09 11:57:52.034096',idx='1',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:57:51.958517',recv_time='2021-11-09 11:57:52.032720',insert_time='2021-11-09 11:57:52.034096',idx='2',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:01.957612',recv_time='2021-11-09 11:58:02.070025',insert_time='2021-11-09 11:58:02.071232',idx='0',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:01.957612',recv_time='2021-11-09 11:58:02.070025',insert_time='2021-11-09 11:58:02.071232',idx='1',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:01.957612',recv_time='2021-11-09 11:58:02.070025',insert_time='2021-11-09 11:58:02.071232',idx='2',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:11.957976',recv_time='2021-11-09 11:58:12.098246',insert_time='2021-11-09 11:58:12.099522',idx='0',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:11.957976',recv_time='2021-11-09 11:58:12.098246',insert_time='2021-11-09 11:58:12.099522',idx='1',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:11.957976',recv_time='2021-11-09 11:58:12.098246',insert_time='2021-11-09 11:58:12.099522',idx='2',dim_x_r='3',dim_y_r='32',value_r='0',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>],\n", - " [<Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:21.957645',recv_time='2021-11-09 11:58:22.132944',insert_time='2021-11-09 11:58:22.134263',idx='0',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:21.957645',recv_time='2021-11-09 11:58:22.132944',insert_time='2021-11-09 11:58:22.134263',idx='1',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>,\n", - " <Array_Boolean_RW(att_conf_id='1',data_time='2021-11-09 11:58:21.957645',recv_time='2021-11-09 11:58:22.132944',insert_time='2021-11-09 11:58:22.134263',idx='2',dim_x_r='3',dim_y_r='32',value_r='1',dim_x_w='3',dim_y_w='32',value_w='1',quality='0',att_error_desc_id='None')>]]" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "data" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "id": "eb97ee97", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/recv/1/status removed!\n", - "Attribute stat/sdp/1/fpga_scrap_r removed!\n", - "Attribute stat/sdp/1/fpga_scrap_rw removed!\n", - "Attribute stat/sdp/1/fpga_weights_r removed!\n", - "Attribute stat/sdp/1/fpga_weights_rw removed!\n" - ] - } - ], - "source": [ - "#archiver.remove_attribute_from_archiver('STAT/recv/1/rcu_temperature_r')\n", - "archiver.remove_attributes_in_error()" - ] - }, - { - "cell_type": "code", - "execution_count": 27, - "id": "6ffaeab3", - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['tango://databaseds:10000/archiving/hdbpp/eventsubscriber01']\n", - "tango://databaseds:10000/archiving/hdbpp/eventsubscriber01\n", - "tango://databaseds:10000/archiving/hdbpp/eventsubscriber01\n" - ] - } - ], - "source": [ - "# Add a new subscriber if not already present\n", - "print(archiver.es_list)\n", - "print(archiver.get_next_subscriber())\n", - "if len(archiver.es_list)==1:\n", - " archiver.add_event_subscriber()\n", - "print(archiver.get_next_subscriber()) # choose the best one with minimum load\n", - "new_subscriber = archiver.get_next_subscriber()" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "id": "39f49c8e", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/sdp/1/version_r not found in archiving list!\n", - "Attribute stat/sdp/1/opcua_missing_attributes_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_phase_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_firmware_version_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_global_node_index_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_hardware_version_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_processing_enable_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_processing_enable_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_scrap_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_scrap_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_antenna_band_index_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_block_period_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_f_adc_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_fsub_type_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_subband_weights_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_subband_weights_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_temp_r removed!\n", - "Attribute stat/sdp/1/fpga_weights_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_weights_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_enable_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_enable_rw not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_wg_phase_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_fpga_mask_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_fpga_mask_rw not found in archiving list!\n", - "Attribute stat/sdp/1/tr_fpga_communication_error_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_sdp_config_first_fpga_nr_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_beamsets_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_fpgas_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_software_version_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_start_time_r not found in archiving list!\n", - "Attribute stat/sdp/1/tr_tod_r removed!\n", - "Attribute stat/sdp/1/tr_tod_pps_delta_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_signal_input_mean_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_signal_input_rms_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_rbd_count_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_dev_syncn_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err0_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err1_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_bsn_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_packets_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_valid_r not found in archiving list!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_err_r not found in archiving list!\n", - "Attribute stat/sdp/1/state not found in archiving list!\n", - "Attribute stat/sdp/1/status not found in archiving list!\n", - "Attribute stat/sdp/1/version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/opcua_missing_attributes_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_amplitude_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_phase_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_enable_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_beamlet_output_scale_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_firmware_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_global_node_index_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_hardware_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_processing_enable_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_processing_enable_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_antenna_band_index_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_block_period_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_f_adc_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_fsub_type_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_observation_id_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_sdp_info_station_id_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_subband_weights_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_subband_weights_rw will not be archived because polling is set to FALSE!\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/sdp/1/fpga_wg_amplitude_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_enable_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_enable_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_frequency_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_wg_phase_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_fpga_mask_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_fpga_mask_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_fpga_communication_error_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_sdp_config_first_fpga_nr_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_beamsets_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_sdp_config_nof_fpgas_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_software_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_start_time_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/tr_tod_pps_delta_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_signal_input_mean_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_signal_input_rms_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_rbd_count_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_csr_dev_syncn_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err0_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_jesd204b_rx_err1_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_bsn_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_packets_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_valid_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/sdp/1/fpga_bsn_monitor_input_nof_err_r will not be archived because polling is set to FALSE!\n" - ] - } - ], - "source": [ - "# Move SDP attributes from one EventSubscriber to another one\n", - "archiver.remove_attributes_by_device(sdp_name)\n", - "archiver.add_attributes_by_device(sdp_name,global_archive_period=5000,es_name=new_subscriber)" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "id": "a554cff4", - "metadata": {}, - "outputs": [], - "source": [ - "d.off()\n", - "d2.off()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "100664ab", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "StationControl", - "language": "python", - "name": "stationcontrol" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/jupyter-notebooks/HdbppReader_demonstrator.ipynb b/jupyter-notebooks/HdbppReader_demonstrator.ipynb deleted file mode 100644 index ea1786979fa6083cc7660176f1ece3da2bba21ad..0000000000000000000000000000000000000000 --- a/jupyter-notebooks/HdbppReader_demonstrator.ipynb +++ /dev/null @@ -1,1172 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 3, - "id": "d0328351", - "metadata": {}, - "outputs": [], - "source": [ - "import sys, time\n", - "sys.path.append('/hosthome/tango/tangostationcontrol/tangostationcontrol/toolkit/libhdbpp-python')\n", - "from hdbpp_reader.timescaledb import TimescaleDbReader" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "c2295969", - "metadata": {}, - "outputs": [], - "source": [ - "# Initialise a Reader object\n", - "reader = TimescaleDbReader({'database':'hdb', 'user':'postgres', 'password':'password', 'port':5432,'host':'archiver-timescale'})" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "24cd0dbc", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'user': 'postgres',\n", - " 'password': 'password',\n", - " 'host': 'archiver-timescale',\n", - " 'database': 'hdb',\n", - " 'port': 5432}" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "reader.parse_config('postgres:password@archiver-timescale:5432/hdb')" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "2e01bf2a", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "<connection object at 0x7fcf8f18ee08; dsn: 'user=postgres password=xxx dbname=hdb host=archiver-timescale port=5432', closed: 0>" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Check connection\n", - "reader.get_connection()" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "582e2c9e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['tango://databaseds:10000/stat/sdp/1/fpga_temp_r',\n", - " 'tango://databaseds:10000/stat/recv/1/version_r',\n", - " 'tango://databaseds:10000/stat/recv/1/opcua_missing_attributes_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_green_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_green_on_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_red_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_red_on_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_mask_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pcb_id_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pcb_number_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pcb_version_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_1v8_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_2v5_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_3v3_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_analog_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_digital_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_good_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_temp_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recvtr_i2c_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recvtr_monitor_rate_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/recvtr_translator_busy_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_colour_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recv_iout_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recv_temp_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recv_vout_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/state',\n", - " 'tango://databaseds:10000/stat/recv/1/status',\n", - " 'tango://databaseds:10000/stat/sdp/1/version_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/opcua_missing_attributes_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_enable_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_enable_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_hdr_eth_destination_mac_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_hdr_ip_destination_address_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_hdr_udp_destination_port_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_scale_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_beamlet_output_scale_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_boot_image_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_boot_image_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_global_node_index_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_pps_present_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_pps_capture_cnt_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_pps_expected_cnt_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_pps_expected_cnt_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_processing_enable_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_processing_enable_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_scrap_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_scrap_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_antenna_band_index_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_block_period_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_f_adc_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_fsub_type_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_nyquist_sampling_zone_index_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_observation_id_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_observation_id_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_station_id_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_sdp_info_station_id_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_time_since_last_pps_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_fpga_mask_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_sdp_config_first_fpga_nr_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_sdp_config_nof_beamsets_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_sdp_config_nof_fpgas_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_start_time_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_tod_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_tod_pps_delta_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_bsn_monitor_input_bsn_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_bsn_monitor_input_nof_packets_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_bsn_monitor_input_nof_valid_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_bsn_monitor_input_nof_err_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_error_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_processing_error_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_input_error_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/state',\n", - " 'tango://databaseds:10000/stat/sdp/1/status',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_firmware_version_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/fpga_hardware_version_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_fpga_mask_rw',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_fpga_communication_error_r',\n", - " 'tango://databaseds:10000/stat/sdp/1/tr_software_version_r']" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Get the list of all the archived attributes\n", - "reader.get_attributes()" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "9f985ceb", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['tango://databaseds:10000/stat/recv/1/version_r',\n", - " 'tango://databaseds:10000/stat/recv/1/opcua_missing_attributes_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_green_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_green_on_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_red_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_red_on_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_mask_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pcb_id_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pcb_number_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pcb_version_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_1v8_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_2v5_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_3v3_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_analog_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_digital_on_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_pwr_good_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_temp_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recvtr_i2c_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recvtr_monitor_rate_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/recvtr_translator_busy_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_led_colour_r',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recv_iout_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recv_temp_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/recv_vout_error_r',\n", - " 'tango://databaseds:10000/stat/recv/1/state',\n", - " 'tango://databaseds:10000/stat/recv/1/status']" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Given a name pattern, return a list of archived attributes\n", - "device_name = 'STAT/RECV/1'\n", - "reader.get_attributes(pattern=f'*{device_name}*'.lower())" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "5517c508", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "1" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Check if an attribute is archived\n", - "attr_name = 'rcu_mask_rw'\n", - "reader.is_attribute_archived(f'{device_name}/{attr_name}'.lower())" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "740064f3", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{}" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Return the list of the last n value for a given attribute(s)\n", - "# ! Cannot figure out why it does not work ... on the other hand, the relative code \n", - "# in the next cell works!\n", - "a = 'tango://databaseds:10000/stat/sdp/1/fpga_temp_r'\n", - "columns = [\"value_r\", \"value_w\", \"quality\", \"att_error_desc_id\"]\n", - "reader.get_last_attributes_values(attributes=a,columns=columns,n=3)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "d48fe536", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[(datetime.datetime(2022, 3, 9, 12, 0, 27, 686930, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 1),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 34, 497576, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 23, 838368, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2)]" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "reader._cursor.execute(\"SELECT att_conf_id, table_name, att_name FROM att_conf WHERE att_name LIKE %s;\", ('%'+a+'%',))\n", - "att_id = reader._cursor.fetchall()\n", - "\n", - "reader._cursor.execute(f\"SELECT data_time, value_r, value_w, quality, att_error_desc_id FROM {att_id[0][1]} WHERE att_conf_id={att_id[0][0]} ORDER BY data_time DESC LIMIT 3\")\n", - "reader._cursor.fetchall()" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "id": "fcab2a21", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[(datetime.datetime(2022, 3, 9, 12, 0, 27, 686930, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 1),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 34, 497576, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 23, 838368, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 23, 401983, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 12, 908590, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 12, 398194, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 1, 974671, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 38, 1, 400801, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 51, 57525, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 50, 398277, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 40, 124000, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 39, 402424, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 29, 194141, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 28, 403995, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 18, 325812, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 17, 414731, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 7, 423699, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 37, 6, 406963, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 56, 399116, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 55, 406792, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 45, 491806, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 44, 401894, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 34, 594970, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 33, 385793, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 23, 718610, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 23, 402214, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 12, 785296, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 12, 392858, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 1, 840443, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 36, 1, 404531, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 50, 913943, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 50, 401988, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 39, 984898, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 39, 393043, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 29, 69789, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 28, 409644, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 18, 114191, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 17, 388089, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 7, 192311, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 35, 6, 400084, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 56, 295447, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 55, 390150, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 45, 458677, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 44, 386107, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 34, 598981, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 33, 384623, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 23, 717252, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 22, 394157, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 12, 660277, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 11, 390295, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 1, 641750, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 34, 0, 385438, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 33, 50, 633679, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 33, 49, 396047, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 33, 39, 494091, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 33, 38, 392001, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 33, 27, 532083, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 33, 7, 927971, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 1),\n", - " (datetime.datetime(2022, 3, 8, 15, 31, 15, 82880, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 31, 4, 961433, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 31, 4, 405487, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 30, 54, 841743, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 30, 54, 402356, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 30, 44, 727440, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 2),\n", - " (datetime.datetime(2022, 3, 8, 15, 30, 44, 400452, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 30, 33, 414200, tzinfo=datetime.timezone.utc),\n", - " [0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0,\n", - " 0.0],\n", - " None,\n", - " 0,\n", - " None),\n", - " (datetime.datetime(2022, 3, 8, 15, 30, 15, 378183, tzinfo=datetime.timezone.utc),\n", - " None,\n", - " None,\n", - " 1,\n", - " 1)]" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Get the last attribute values given a start date and optionally a stop date\n", - "reader.get_attribute_values(a, start_date='2022-03-08 00:00:00')" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "StationControl", - "language": "python", - "name": "stationcontrol" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/jupyter-notebooks/RECV_archive_all_attributes.ipynb b/jupyter-notebooks/RECV_archive_all_attributes.ipynb deleted file mode 100644 index 9e3e2192d4931ad5894707d6286240626e56f09a..0000000000000000000000000000000000000000 --- a/jupyter-notebooks/RECV_archive_all_attributes.ipynb +++ /dev/null @@ -1,502 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 5, - "id": "b14a15ae", - "metadata": {}, - "outputs": [], - "source": [ - "import sys, time\n", - "import numpy as np\n", - "sys.path.append('/hosthome/tango/tangostationcontrol/tangostationcontrol')\n", - "from toolkit.archiver import *\n", - "from matplotlib import pyplot as plt" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "1514b0cd", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/recv/1/version_r not found in archiving list!\n", - "Attribute stat/recv/1/opcua_missing_attributes_r not found in archiving list!\n", - "Attribute stat/recv/1/ant_status_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_colour_r not found in archiving list!\n", - "Attribute stat/recv/1/ant_mask_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_bf_delays_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_bf_delays_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_led_on_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_led_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_on_r not found in archiving list!\n", - "Attribute stat/recv/1/hbat_pwr_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_adc_locked_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_attenuator_db_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_attenuator_db_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_band_select_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_band_select_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_dth_freq_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_dth_freq_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_dth_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_green_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_green_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_red_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_led_red_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_mask_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pcb_id_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pcb_number_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pcb_version_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_1v8_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_2v5_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_3v3_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_analog_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_iout_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_rw not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vin_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vout_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_digital_on_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_pwr_good_r not found in archiving list!\n", - "Attribute stat/recv/1/rcu_temp_r not found in archiving list!\n", - "Attribute stat/recv/1/recvtr_i2c_error_r not found in archiving list!\n", - "Attribute stat/recv/1/recvtr_monitor_rate_rw not found in archiving list!\n", - "Attribute stat/recv/1/recvtr_translator_busy_r not found in archiving list!\n", - "Attribute stat/recv/1/state not found in archiving list!\n", - "Attribute stat/recv/1/status not found in archiving list!\n", - "Device STAT/SDP/1 offline\n", - "Device STAT/SST/1 offline\n", - "Device STAT/XST/1 offline\n", - "Device STAT/UNB2/1 offline\n" - ] - } - ], - "source": [ - "# Apply the chosen JSON configuration file in directory toolkit/archiver_config/\n", - "# RECV is set on PRODUCTION mode to test the archiving of all its attributes\n", - "archiver = Archiver(selector_filename='lofar2.json')" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "03dafaed", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "lofar2.json\n" - ] - }, - { - "data": { - "text/plain": [ - "{'global_variables': {'development_polling_time': '10000',\n", - " 'development_archive_time': '60000'},\n", - " 'devices': {'STAT/RECV/1': {'environment': 'development',\n", - " 'include': [],\n", - " 'exclude': ['CLK_Enable_PWR_R',\n", - " 'CLK_I2C_STATUS_R',\n", - " 'CLK_PLL_error_R',\n", - " 'CLK_PLL_locked_R',\n", - " 'CLK_translator_busy_R']},\n", - " 'STAT/SDP/1': {'environment': 'development',\n", - " 'include': [],\n", - " 'exclude': ['FPGA_scrap_R', 'FPGA_scrap_RW']},\n", - " 'STAT/SST/1': {'environment': 'development', 'include': [], 'exclude': []},\n", - " 'STAT/XST/1': {'environment': 'development', 'include': [], 'exclude': []},\n", - " 'STAT/UNB2/1': {'environment': 'development', 'include': [], 'exclude': []}}}" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the configuration file (as a dictionary)\n", - "selector = archiver.selector\n", - "print(selector.filename)\n", - "env_dict = selector.get_dict()\n", - "env_dict" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "8720f9e7", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "OFF\n" - ] - } - ], - "source": [ - "device_name = 'STAT/RECV/1'\n", - "d=DeviceProxy(device_name) \n", - "state = str(d.state())\n", - "print(state)" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "id": "6a9c4f4c", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Device is now in ON state\n" - ] - } - ], - "source": [ - "# Start the device\n", - "if state == \"OFF\":\n", - " time.sleep(1)\n", - " d.initialise()\n", - " time.sleep(1)\n", - "state = str(d.state())\n", - "if state == \"STANDBY\":\n", - " d.set_defaults()\n", - " d.on()\n", - "state = str(d.state())\n", - "if state == \"ON\":\n", - " print(\"Device is now in ON state\")" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "f85bd73f", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Attribute stat/recv/1/version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/opcua_missing_attributes_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/ant_status_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_colour_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_bf_delays_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_bf_delays_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_led_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_led_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_lna_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/hbat_pwr_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_adc_locked_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_attenuator_db_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_attenuator_db_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_band_select_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_band_select_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_dth_freq_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_dth_freq_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_dth_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_green_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_green_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_red_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_led_red_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pcb_id_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pcb_number_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pcb_version_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_1v8_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_2v5_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_3v3_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_analog_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_iout_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_on_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vin_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_ant_vout_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_digital_on_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_pwr_good_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/rcu_temp_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/recvtr_i2c_error_r will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/recvtr_monitor_rate_rw will not be archived because polling is set to FALSE!\n", - "Attribute stat/recv/1/recvtr_translator_busy_r will not be archived because polling is set to FALSE!\n" - ] - } - ], - "source": [ - "# Add RECV attributes to perform load test\n", - "archiver.add_attributes_by_device(device_name,global_archive_period=5000)" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "1a872f87", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['tango://databaseds:10000/stat/recv/1/ant_mask_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/rcu_mask_rw',\n", - " 'tango://databaseds:10000/stat/recv/1/state',\n", - " 'tango://databaseds:10000/stat/recv/1/status']" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the attributes currently managed by the event subscriber\n", - "attrs = archiver.get_subscriber_attributes()\n", - "attrs" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "ca5e58fa", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'tango://databaseds:10000/stat/recv/1/status': 'Storing Error: mysql_stmt_bind_param() failed, err=Buffer type is not supported'}" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Print the errors for each attribute\n", - "err_dict = archiver.get_subscriber_errors()\n", - "err_dict" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "id": "c96f1a8d", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Attribute Poll Period Archive Period \n", - "----------\n", - "STAT/RECV/1/ant_mask_rw 1000 5000 \n", - "STAT/RECV/1/rcu_mask_rw 1000 5000 \n", - "STAT/RECV/1/state 1000 5000 \n", - "STAT/RECV/1/status 1000 5000 \n" - ] - } - ], - "source": [ - "# Print the attribute periods\n", - "def print_periods(attrs):\n", - " print(\"{:<45} {:<15} {:<15}\".format('Attribute','Poll Period','Archive Period'))\n", - " print(\"----------\")\n", - " for a in attrs:\n", - " ap = AttributeProxy(a)\n", - " att_fqname = ap.get_device_proxy().name()+'/'+ap.name()\n", - " print(\"{:<45} {:<15} {:<15}\".format(att_fqname,ap.get_poll_period(),ap.get_property('archive_period')['archive_period'][0],sep='\\t'))\n", - "\n", - "attrs = archiver.get_subscriber_attributes()\n", - "print_periods(attrs)" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "b12e8887", - "metadata": {}, - "outputs": [], - "source": [ - "# Turn off the device\n", - "d.off()" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "a906823c", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[<Attribute(fullname='tango://databaseds:10000/stat/recv/1/ant_mask_rw',data_type ='4',ttl='0',facility ='tango://databaseds:10000',domain ='stat',family ='recv',member ='1',name ='ant_mask_rw')>,\n", - " <Attribute(fullname='tango://databaseds:10000/stat/recv/1/rcu_mask_rw',data_type ='4',ttl='0',facility ='tango://databaseds:10000',domain ='stat',family ='recv',member ='1',name ='rcu_mask_rw')>,\n", - " <Attribute(fullname='tango://databaseds:10000/stat/recv/1/state',data_type ='45',ttl='0',facility ='tango://databaseds:10000',domain ='stat',family ='recv',member ='1',name ='state')>,\n", - " <Attribute(fullname='tango://databaseds:10000/stat/recv/1/status',data_type ='41',ttl='0',facility ='tango://databaseds:10000',domain ='stat',family ='recv',member ='1',name ='status')>]" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Initialise the retriever object and print the archived attributes in the database\n", - "retriever = Retriever()\n", - "retriever.get_all_archived_attributes()" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "id": "770d6dbc", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'stat/recv/1/rcu_mask_rw'" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Attribute chosen to be retrieved\n", - "attr_name = 'rcu_mask_rw'\n", - "attr_fq_name = str(device_name+'/'+attr_name).lower()\n", - "attr_fq_name" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "id": "3734554e", - "metadata": {}, - "outputs": [], - "source": [ - "# Retrieve records in the last n hours (works even with decimals)\n", - "\n", - "# Use alternatively one of the following two methods to retrieve data (last n hours or interval)\n", - "records= retriever.get_attribute_value_by_hours(attr_fq_name,hours=0.1)\n", - "#records = retriever.get_attribute_value_by_interval(attr_fq_name,'2021-09-01 16:00:00', '2021-09-01 16:03:00')\n", - "\n", - "if not records:\n", - " print('Empty result!')\n", - "else:\n", - " # Convert DB Array records into Python lists\n", - " data = build_array_from_record(records,records[0].dim_x_r)\n", - " # Extract only the value from the array \n", - " array_values = get_values_from_record(data)\n", - "\n", - "#records\n", - "#data\n", - "#array_values" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "id": "edb9f117", - "metadata": {}, - "outputs": [], - "source": [ - "# Extract and process timestamps for plotting purposes\n", - "def get_timestamps(data,strformat):\n", - " timestamps = []\n", - " for i in range(len(data)):\n", - " timestamps.append(data[i][0].recv_time.strftime(strformat))\n", - " return timestamps\n", - "timestamps = get_timestamps(data,\"%Y-%m-%d %X\")" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "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q4GMwGLgGGx+UrxfnZcf1G/RTnMdHnbODoJhuPA5s1Lfs+4YH2/YSku1ldcQIjCT0SH4gx/TswuN312ccYJwBGSEIz4ufYdtYlcADwKKGH1clx2b8AB7aqC8KtzTnAIyS9p7JstuG3s0xxAt8AXk/qbwahg09u+9cU58djHDMInWY+mtjcnnDQnwNMIw6WUEeccd0ewJ1N9tpenyVi3IFwfHydcLX3YNHvaVnr0kemcBzHcTqaFfHWn+M4jjOA8ETlOI7jdDSeqBzHcZyOxhOV4ziO09F4onIcx3E6Gk9UjuM4TkfjicpxHMfpaDxROY7jOB3N/wGf1vCbptllLwAAAABJRU5ErkJggg==\n", - "text/plain": [ - "<Figure size 432x288 with 2 Axes>" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" - } - ], - "source": [ - "# Plot of array values\n", - "\n", - "heatmap = np.array(array_values,dtype=np.float64)\n", - "fig = plt.figure()\n", - "plt.rcParams['figure.figsize'] = [128, 64]\n", - "plt.rcParams['figure.dpi'] = 128\n", - "ax = fig.add_subplot(111)\n", - "im = ax.imshow(heatmap, interpolation='nearest',cmap='coolwarm')\n", - "ax.set_xlabel('Array index')\n", - "ax.set_ylabel('Timestamp')\n", - "ax.set_xlim([0,(records[0].dim_x_r)-1])\n", - "ax.set_xticks(np.arange(0,records[0].dim_x_r))\n", - "\n", - "ax.set_yticks(range(0,len(timestamps)))\n", - "ax.set_yticklabels(timestamps,fontsize=4)\n", - "\n", - "# Comment the previous two lines and uncomment the following line if there are too many timestamp labels\n", - "#ax.set_yticks(range(0,len(timestamps),10))\n", - "\n", - "ax.set_title('Archived data for '+ attr_fq_name)\n", - "ax.grid()\n", - "cbar = fig.colorbar(ax=ax, mappable=im, orientation='horizontal')\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a4a7caae", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "StationControl", - "language": "python", - "name": "stationcontrol" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/jupyter-notebooks/archiving_demo.ipynb b/jupyter-notebooks/archiving_demo.ipynb deleted file mode 100644 index d478c20c71ce35a7c4d017a180bdd404d0b06c2d..0000000000000000000000000000000000000000 --- a/jupyter-notebooks/archiving_demo.ipynb +++ /dev/null @@ -1,351 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "d56e59b7", - "metadata": {}, - "outputs": [], - "source": [ - "import sys, time\n", - "import numpy as np\n", - "sys.path.append('/hosthome/tango/tangostationcontrol/tangostationcontrol/')\n", - "from toolkit.archiver_util import *\n", - "from toolkit.archiver_configurator import *\n", - "from toolkit.archiver import *\n", - "from toolkit.retriever import *\n", - "from matplotlib import pyplot as plt" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fd619562", - "metadata": {}, - "outputs": [], - "source": [ - "# Create an archiver object\n", - "archiver = Archiver()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b3748c34", - "metadata": {}, - "outputs": [], - "source": [ - "# Safety cleanup\n", - "DeviceProxy(archiver.get_subscribers()[0]).delete_property('AttributeList')\n", - "DeviceProxy(archiver.get_subscribers()[0]).delete_property('__SubDevices')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c1eedafb", - "metadata": { - "scrolled": true - }, - "outputs": [], - "source": [ - "# Apply the chosen JSON configuration file in directory toolkit/archiver_config/\n", - "config_dict = archiver.get_configuration()\n", - "#print(config_dict)\n", - "archiver.apply_configuration(config_dict)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "76e9656f", - "metadata": {}, - "outputs": [], - "source": [ - "# Print max loads\n", - "# print(DATATYPES_SIZE_DICT)\n", - "print(archiver.get_maximum_device_load('STAT/SDP/1'))\n", - "print(archiver.get_maximum_device_load('STAT/RECV/1'))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "948e95f0", - "metadata": {}, - "outputs": [], - "source": [ - "# RECV device\n", - "device_name = 'STAT/RECV/1'\n", - "#device_name = 'STAT/UNB2/1'\n", - "d=DeviceProxy(device_name) \n", - "d.set_timeout_millis(30000)\n", - "state = str(d.state())\n", - "print(device_name + ' : ' + state)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "225a5e06", - "metadata": {}, - "outputs": [], - "source": [ - "# Start RECV device\n", - "if state == 'FAULT':\n", - " d.off()\n", - " time.sleep(3)\n", - "if state == \"OFF\":\n", - " time.sleep(1)\n", - " d.initialise()\n", - " time.sleep(1)\n", - "state = str(d.state())\n", - "if state == \"STANDBY\":\n", - " d.set_defaults()\n", - " d.on()\n", - "state = str(d.state())\n", - "if state == \"ON\":\n", - " print(f\"Device {device_name} is now in ON state\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0e27ac40", - "metadata": {}, - "outputs": [], - "source": [ - "# SDP device\n", - "device_name = 'STAT/SDP/1'\n", - "d2=DeviceProxy(device_name) \n", - "d2.set_timeout_millis(10000)\n", - "state = str(d2.state())\n", - "print(device_name + ' : ' + state)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "348a9d44", - "metadata": {}, - "outputs": [], - "source": [ - "# Start SDP device\n", - "if state == 'FAULT':\n", - " d2.off()\n", - " time.sleep(3)\n", - "if state == \"OFF\":\n", - " time.sleep(1)\n", - " d2.initialise()\n", - " time.sleep(1)\n", - "state = str(d2.state())\n", - "if state == \"STANDBY\":\n", - " d2.set_defaults()\n", - " d2.on()\n", - "state = str(d2.state())\n", - "if state == \"ON\":\n", - " print(f\"Device {device_name} is now in ON state\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c33fa7ee", - "metadata": {}, - "outputs": [], - "source": [ - "# Add boolean scalar attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/RECVTR_translator_busy_R', polling_period=1000, archive_event_period=5000)\n", - "# Add boolean array attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/rcu_mask_rw', polling_period=1000, archive_event_period=5000)\n", - "# Add boolean image attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/ANT_mask_RW', polling_period=1000, archive_event_period=5000)\n", - "\n", - "# Add double scalar attribute\n", - "archiver.add_attribute_to_archiver('stat/sdp/1/TR_tod_pps_delta_R', polling_period=1000, archive_event_period=5000)\n", - "# Add double array attribute\n", - "archiver.add_attribute_to_archiver('stat/sdp/1/fpga_temp_r', polling_period=1000, archive_event_period=5000)\n", - "# Add double image attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/HBAT_antenna_ITRF_offsets_R', polling_period=1000, archive_event_period=5000)\n", - "\n", - "# Add long array attribute\n", - "#archiver.add_attribute_to_archiver('stat/sdp/1/FPGA_bsn_monitor_input_nof_err_R', polling_period=1000, archive_event_period=5000)\n", - "\n", - "# Add ulong scalar attribute\n", - "#archiver.add_attribute_to_archiver('stat/sdp/1/TR_sdp_config_first_fpga_nr_R', polling_period=1000, archive_event_period=5000)\n", - "# Add ulong array attribute\n", - "#archiver.add_attribute_to_archiver('stat/recv/1/RCU_LED_colour_R', polling_period=1000, archive_event_period=5000)\n", - "\n", - "# Add long64 scalar attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/RECVTR_monitor_rate_RW', polling_period=1000, archive_event_period=5000)\n", - "# Add long64 array attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/RCU_PCB_ID_R', polling_period=1000, archive_event_period=5000)\n", - "# Add long64 image attribute\n", - "archiver.add_attribute_to_archiver('stat/recv/1/HBAT_BF_delay_steps_R', polling_period=1000, archive_event_period=5000)\n", - "\n", - "# Add string scalar attribute\n", - "#archiver.add_attribute_to_archiver('stat/recv/1/status', polling_period=1000, archive_event_period=5000)\n", - "# Add string array attribute\n", - "#archiver.add_attribute_to_archiver('stat/recv/1/opcua_missing_attributes_R', polling_period=1000, archive_event_period=5000)\n", - "\n", - "# Add state scalar attribute\n", - "#archiver.add_attribute_to_archiver('stat/recv/1/state', polling_period=1000, archive_event_period=5000)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ec7878b2", - "metadata": {}, - "outputs": [], - "source": [ - "# Print the errors for each attribute\n", - "# If the device is in OFF state, all its attributes should be in error (normal behaviour)\n", - "err_dict = archiver.get_subscriber_errors()\n", - "err_dict" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3d2ce2da", - "metadata": {}, - "outputs": [], - "source": [ - "# Print the attributes currently managed by the event subscriber\n", - "attrs = archiver.get_subscriber_attributes()\n", - "attrs" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0ec2abd3", - "metadata": {}, - "outputs": [], - "source": [ - "retriever = RetrieverTimescale()\n", - "attr_name = 'stat/sdp/1/tr_tod_pps_delta_r'\n", - "records = retriever.get_attribute_value_by_hours(attr_name,1.5)\n", - "records" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "81b60192", - "metadata": {}, - "outputs": [], - "source": [ - "timestamps = [item.data_time.strftime(\"%Y-%m-%d %X:%f\") for item in records]\n", - "values = [float(item.value_r) for item in records]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "26b4aab8", - "metadata": {}, - "outputs": [], - "source": [ - "plt.plot(timestamps,values)\n", - "plt.title('Archived data for '+ attr_name)\n", - "plt.xticks(rotation=90)\n", - "plt.grid()\n", - "#plt.rcParams['figure.figsize'] = [12, 8]\n", - "plt.rcParams['figure.dpi'] = 60\n", - "plt.show()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "18aeb91f", - "metadata": {}, - "outputs": [], - "source": [ - "views_records = retriever.get_lofar_attribute('stat/sdp/1/tr_tod_pps_delta_r')\n", - "views_records" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "eb24ed8f", - "metadata": {}, - "outputs": [], - "source": [ - "views_records = retriever.get_lofar_attribute('stat/sdp/1/fpga_temp_r')\n", - "views_records" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d7a624b0", - "metadata": {}, - "outputs": [], - "source": [ - "d.off()\n", - "d2.off()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "3e08fc4a", - "metadata": {}, - "outputs": [], - "source": [ - "# Retrieve boolean image attributes\n", - "attr_name = 'stat/recv/1/ant_mask_rw'\n", - "records = retriever.get_attribute_value_by_hours(attr_name,1.5)\n", - "print(np.array(records[0].value_r).shape)\n", - "#records[0].value_r" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cb2f36f6", - "metadata": {}, - "outputs": [], - "source": [ - "# Retrieve numeric image attributes\n", - "attr_name = 'stat/recv/1/HBAT_antenna_ITRF_offsets_R'.lower()\n", - "records = retriever.get_attribute_value_by_hours(attr_name,0.5)\n", - "print(np.array(records[0].value_r).shape)\n", - "#records[0].value_r" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a53be0f9", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "StationControl", - "language": "python", - "name": "stationcontrol" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}