Commit 987624c528cbf1bcbcdafc521cbb7d5bb6149364

Authored by Alexis Koralewski
1 parent 18ec3272
Exists in dev

adding obs configuration for tests and first test of obs config

src/core/pyros_django/obsconfig/fixtures/computer_test.yml 0 → 100644
... ... @@ -0,0 +1,24 @@
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_computer-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated computer
  5 +COMPUTER:
  6 +
  7 + _inventory_label: CPT-XCY-001
  8 + _manufacturer: XCY
  9 + _model: X26A
  10 + _description: "Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz 1.90 GHz RAM = 4 GB"
  11 + _sn: 00331-10000-00001-AA478
  12 + _power:
  13 + _voltage: 12
  14 + _intensity: 5
  15 + _socket: "IEC 60130-10 Type A: 5.5 mm OD, 2.5 mm ID"
  16 +
  17 + _hostname: XCY1
  18 + _virtual_machine: False
  19 + _os: Windows
  20 + _os_version: "10"
  21 + _network_interfaces:
  22 + - 00-A8-3D-68-22-87 # Gigabit 2
  23 + - 00-A8-3D-68-22-86 # Gigabit 3
  24 + - 16-82-FE-44-64-E8 # Wifi
... ...
src/core/pyros_django/obsconfig/fixtures/device_Astromecca_TM350_test.yml 0 → 100644
... ... @@ -0,0 +1,46 @@
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + inventory_label: Undefined
  8 + manufacturer: AstroMecCA
  9 + model: TM350
  10 + description: "Tracking Mount 350"
  11 + sn: Undefined
  12 + power:
  13 + voltage: 220
  14 + intensity: 5
  15 + socket: "CEE 7/7 2P+T"
  16 +
  17 + connector:
  18 + input: ground
  19 + output: "2 plates"
  20 +
  21 + CAPABILITIES:
  22 +
  23 + - CAPABILITY:
  24 + component: MountPointing
  25 +
  26 + attributes:
  27 +
  28 + - attribute:
  29 + key: manufacturer
  30 + value: AstroMecCA
  31 +
  32 + - attribute:
  33 + key: model
  34 + value: TM350
  35 +
  36 + - attribute:
  37 + key: orientation_type
  38 + value: HADEC
  39 +
  40 + - attribute:
  41 + key: velocity_profile
  42 + value: ["TRAPEZIUM"]
  43 +
  44 + - attribute:
  45 + key: connect_real_mount
  46 + value: False
... ...
src/core/pyros_django/obsconfig/fixtures/device_Raspberry_MiFe_test.yml 0 → 100644
... ... @@ -0,0 +1,60 @@
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + inventory_label: SEC-RSP-001
  8 + manufacturer: Klotz
  9 + model: MiFe
  10 + description: "Opening and closing the roof is not available externally"
  11 + sn: 004
  12 + power:
  13 + voltage: 220
  14 + intensity: 1
  15 + socket: "CEE 7/7 2P+T"
  16 +
  17 + hostname: ""
  18 + virtual_machine: False
  19 + os: Linux
  20 + os_version: Raspbian
  21 + network_interfaces:
  22 + - B8:27:EB:8B:99:BE # RJ45
  23 + - b8:27:eb:de:cc:eb # Wifi
  24 + protocol:
  25 + transport: TCP
  26 + langage: Json
  27 + read: True
  28 + write: False
  29 +
  30 + CAPABILITIES:
  31 +
  32 + - CAPABILITY:
  33 + component: WeatherStation
  34 +
  35 + attributes:
  36 +
  37 + - attribute:
  38 + key: manufacturer
  39 + value: AKlotz
  40 +
  41 + - attribute:
  42 + key: model
  43 + value: Raspberry
  44 +
  45 + - CAPABILITY:
  46 + component: BuildingCover
  47 +
  48 + attributes:
  49 +
  50 + - attribute:
  51 + key: manufacturer
  52 + value: CAME
  53 +
  54 + - attribute:
  55 + key: model
  56 + value: X20
  57 +
  58 + - attribute:
  59 + key: type_cover
  60 + value: ["RollingRoof"]
... ...
src/core/pyros_django/obsconfig/fixtures/device_SkyWatcher_ED80_test.yml 0 → 100644
... ... @@ -0,0 +1,46 @@
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + inventory_label: Undefined
  8 + manufacturer: SkyWatcher
  9 + model: "AP 80/600 ED"
  10 + description: "Apochromatic doublet refractor AP 80/600 EvoStar ED. Glass Schott FPL-53 + coating MHC"
  11 + sn: Undefined
  12 + power:
  13 + voltage: ~
  14 + intensity: ~
  15 + socket: ~
  16 +
  17 + connector:
  18 + input: aperture
  19 + output: "female 2 inches"
  20 +
  21 + CAPABILITIES:
  22 +
  23 + - CAPABILITY:
  24 + component: OpticImager
  25 +
  26 + attributes:
  27 +
  28 + - attribute:
  29 + key: foclen
  30 + value: 0.600
  31 +
  32 + - attribute:
  33 + key: transmissions
  34 + # Schott FPL-53 + MHC (Metallic High-Transmission)
  35 + # https://refractiveindex.info/?shelf=glass&book=OHARA-FPL&page=S-FPL53
  36 + value:
  37 + wavelengths: [280e-9, 2400e-9]
  38 + transmission: [ 1.0, 1.0]
  39 +
  40 + - attribute:
  41 + key: appdiam
  42 + value: 0.08
  43 +
  44 + - attribute:
  45 + key: psf_sigma
  46 + value: 8e-6
... ...
src/core/pyros_django/obsconfig/fixtures/device_ZWO_ASI1600MMPro_test.yml 0 → 100644
... ... @@ -0,0 +1,109 @@
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + inventory_label: Undefined
  8 + manufacturer: ZWO
  9 + model: "ASI1600MM Pro"
  10 + description: "ZWO CMOS camera ASI 1600MM Pro. Sensor Panasonic MN34230"
  11 + sn: Undefined
  12 + power:
  13 + voltage: 12
  14 + intensity: 5
  15 + socket: "IEC 60130-10 Type A: 5.5 mm OD, 2.5 mm ID"
  16 +
  17 + connector:
  18 + input: "male 2 inches"
  19 + output: USB3
  20 +
  21 + CAPABILITIES:
  22 +
  23 + - CAPABILITY:
  24 + component: DetectorSensor
  25 +
  26 + attributes:
  27 +
  28 + - attribute:
  29 + key: manufacturer
  30 + value: Panasonic
  31 +
  32 + - attribute:
  33 + key: model
  34 + value: MN34230
  35 +
  36 + - attribute:
  37 + key: type
  38 + value: ["CMOS"]
  39 +
  40 + - attribute:
  41 + key: exposuretime
  42 + value: 1.0
  43 + liminf: 0.001
  44 + limsup: 1000
  45 + is_editable: True
  46 +
  47 + - attribute:
  48 + key: binnings
  49 + value:
  50 + binxy: [ [1,1], [2,2] ]
  51 + readouttime: [ 0.8, 0.8 ]
  52 + is_editable: True
  53 +
  54 + - attribute:
  55 + key: celldimx
  56 + value: 3.8e-6
  57 + - attribute:
  58 + key: celldimy
  59 + value: 3.8e-6
  60 +
  61 + - attribute:
  62 + key: cellnbx
  63 + value: 4656
  64 + - attribute:
  65 + key: cellnby
  66 + value: 3520
  67 +
  68 + - attribute:
  69 + key: color
  70 + value: ["None"]
  71 +
  72 + - attribute:
  73 + key: qdes
  74 + # http://www.astrosurf.com/buil/atik_vs_zwo/
  75 + value:
  76 + wavelengths: [350e-9, 375e-9, 400e-9, 425e-9, 450e-9, 475e-9, 500e-9, 525e-9, 550e-9, 575e-9, 600e-9, 625e-9, 650e-9, 675e-9, 700e-9, 725e-9, 750e-9, 775e-9, 800e-9, 900e-9, 1000e-9, 1100e-9]
  77 + qde: [ 0.0, 0.15, 0.4, 0.5, 0.6, 0.62, 0.6, 0.58, 0.55, 0.52, 0.48, 0.47, 0.41, 0.37, 0.32, 0.26, 0.22, 0.18, 0.16, 0.08, 0.04, 0.0]
  78 +
  79 + - attribute:
  80 + key: electronic
  81 + # for binning 1
  82 + value:
  83 + gain_manufacturer: [ 0, 50, 100, 200, 300]
  84 + gain_eadu: [ 5.06, 2.75, 1.51, 0.475, 0.151]
  85 + readout_noise: [ 3.9, 2.4, 1.8, 1.3, 1.1]
  86 + readout_signal: [ 778, 773, 768, 762, 756]
  87 + saturation_level: [65535, 65535, 65535, 65535, 65535]
  88 +
  89 + - CAPABILITY:
  90 + component: DetectorShutter
  91 +
  92 + attributes:
  93 +
  94 + - attribute:
  95 + key: manufacturer
  96 + value: None
  97 +
  98 + - attribute:
  99 + key: model
  100 + value: None
  101 +
  102 + - attribute:
  103 + key: type
  104 + value: ['rolling']
  105 +
  106 + - attribute:
  107 + key: modes
  108 + value: ["opened"]
  109 + is_editable: False
... ...
src/core/pyros_django/obsconfig/fixtures/observatory_configuration_ko.yml 0 → 100644
... ... @@ -0,0 +1,134 @@
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_observatory-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an observatory
  5 +OBSERVATORY:
  6 +
  7 + name: observatory_test
  8 +
  9 + # === Inventory of available devices
  10 + # A device is a hardware with a maximum of one connection to drive it with a computer.
  11 + # As a device can be shared with various units, it is defined at the observatory level.
  12 + DEVICES:
  13 +
  14 + # Each device is defined by a specific configuration file that enumarate the components.
  15 +
  16 + - DEVICE:
  17 + name: AstroMecCA
  18 + file: device_Astromecca_TM350_test.yml
  19 +
  20 + - DEVICE:
  21 + name: PLC-meteo
  22 + file: device_Raspberry_MiFe_test.yml
  23 + # Describe here the configuration of the device in operation
  24 + network_interface_index: 0
  25 + network_ip: 192.168.0.2
  26 +
  27 + - DEVICE:
  28 + name: SkyWatcher-ED80
  29 + file: device_SkyWatcher_ED80_test.yml
  30 +
  31 +
  32 + - DEVICE:
  33 + name: ZWO-ASI1600MMPro
  34 + file: device_ZWO_ASI1600MMPro_test.yml
  35 +
  36 +
  37 + # === Inventory of available computers
  38 + # A computer is a hardware of a virtual machine.
  39 + # As a computer can be shared with various units, it is defined at the observatory level.
  40 + COMPUTERS:
  41 +
  42 + - COMPUTER:
  43 +
  44 + name: MainComputer
  45 + file: computer_test.yml
  46 + # Describe here the configuration of the computer in operation
  47 + role: Main
  48 + # Choice of the interface to connect the computer to the network (cf.network_interfaces infile)
  49 + network_interface_index: 0
  50 + # IP attributed by the Router
  51 + network_ip: 192.168.0.11
  52 +
  53 + # === Assembly of devices into units
  54 + # A unit is a robotic telescope
  55 + UNITS:
  56 +
  57 + - UNIT:
  58 + name: test-unit
  59 + home: "GPS 2.0375 E 43.6443484725 136.9"
  60 + horizon:
  61 + type: ALTAZ
  62 + line: [ [0,0], [360,0] ]
  63 +
  64 + DATABASE:
  65 + computer: MainComputer
  66 + file: pyros/docker/variables.env
  67 +
  68 + AGENTS:
  69 +
  70 + - AGENT_DEVICE:
  71 + computer: MainComputer
  72 + name: plc
  73 + device: PLC-meteo
  74 + is_real: False
  75 +
  76 + - AGENT_DEVICE:
  77 + computer: MainComputer
  78 + name: mount
  79 + # device name should be AstroMecCA
  80 + device: AstroMecCA-TM350
  81 + is_real: False
  82 +
  83 + - AGENT_DEVICE:
  84 + computer: None
  85 + name: optic
  86 + device: SkyWatcher-ED80
  87 + is_real: False
  88 +
  89 + - AGENT_DEVICE:
  90 + computer: MainComputer
  91 + name: camera
  92 + path: private/plugin/agent_devices
  93 + device: ZWO-ASI1600MMPro
  94 + protocol: private/plugin/agent_devices/camera_protocol.py
  95 + is_real: False
  96 +
  97 + - AGENT:
  98 + computer: MainComputer
  99 + name: majordome
  100 + path: ~
  101 +
  102 +
  103 + key_shouldnt_be_here: hello
  104 +
  105 + TOPOLOGY:
  106 +
  107 + SECURITY:
  108 + name: PLC
  109 + COMPONENT_AGENTS:
  110 + - WeatherStation: plc
  111 + - BuildingCover: plc
  112 +
  113 + MOUNT:
  114 + name: TM350-prototype
  115 + COMPONENT_AGENTS:
  116 + - MountPointing: mount
  117 +
  118 + CHANNELS:
  119 +
  120 + - CHANNEL:
  121 + name: OpticalChannel
  122 + COMPONENT_AGENTS:
  123 + - OpticImager: optic
  124 + - DetectorSensor: camera
  125 + - DetectorShutter: camera
  126 +
  127 + CHANNEL_GROUPS:
  128 +
  129 + logic: 'or' # opt
  130 + GROUPS:
  131 + - GROUP:
  132 + logic: 'and' # opt
  133 + channels:
  134 + - OpticalChannel
... ...
src/core/pyros_django/obsconfig/tests.py
1 1 from django.test import TestCase
2   -
3   -# Create your tests here.
  2 +from common.models import PyrosUser
  3 +from .configpyros import ConfigPyros
  4 +import unittest
  5 +class ObservatoryConfigurationTests(TestCase):
  6 + fixtures = ['tests/common_test_TZ.json']
  7 + @unittest.expectedFailure
  8 + def test_OCF_view_config_ko(self):
  9 + u1 = PyrosUser.objects.get(username="haribo")
  10 + config_ko = ConfigPyros("obsconfig/fixtures/observatory_configuration_ko.yml")
  11 +
4 12 \ No newline at end of file
... ...