Markus Wildi replied to the topic 'ASI294MC-Pro 16 bit download problem.' in the forum. 2 months ago

I forgot to mention the streaming setup:

2.2 fps: with ssh -X remote host, executing kstars, Ethernet connection

6 fps: local kstars via device manager, tab client name, host, port, WiFi connection.

bye wildi

Read More...

Markus Wildi replied to the topic 'ASI294MC-Pro 16 bit download problem.' in the forum. 2 months ago

Hello

I'd like confirm ecloud's idea that it is a Rock64 USB 3 problem., see Pine Rock64 forum or better if USB 2 and USB 3 devices are mixed, as the thread suggests.

I'm running Rock64 at the latest build:

Linux rock64 4.4.190-1233-rockchip-ayufan-gd3f1be0ed310 #1 SMP Wed Aug 28 08:59:34 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

and use a ZWO ASI294MC camera and a USB WiFi dongle:

Ralink Technology, Corp. RT5370 Wireless Adapter

Having the camera and the WiFi dongle plugged in both at USB 2 port, besides that the camera has longer to download, the
system works. If I plug in the camera at the USB 3 port and reboot, the wireless connection speed is never faster than 1...10 Mb/s
(should be ca. 60 Mb/s). If I do the same while the system is running I loose WiFi connection at all (see log file at the end).

A possible solution:
If I use a powered USB 3 hub and connect all devices to the hub, while no device is attached to USB 2, I can even stream
at 4x4 binning with about 2.2 fps. Even under these circumstances the INDI GUI is still responsive.

Kind regards, wildi

Sep 25 16:09:34 rock64 kernel: [ 1595.124675] usb 1-1: USB disconnect, device number 4
Sep 25 16:09:36 rock64 kernel: [ 1597.764558] usb 5-1: new SuperSpeed USB device number 2 using xhci-hcd
Sep 25 16:09:36 rock64 kernel: [ 1597.781805] usb 5-1: New USB device found, idVendor=03c3, idProduct=294b
Sep 25 16:09:36 rock64 kernel: [ 1597.781838] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Sep 25 16:09:36 rock64 kernel: [ 1597.781860] usb 5-1: Product: ASI294MC
Sep 25 16:09:36 rock64 kernel: [ 1597.781881] usb 5-1: Manufacturer: ZWO
Sep 25 16:09:36 rock64 mtp-probe: checking bus 5, device 2: "/sys/devices/platform/usb@ff600000/ff600000.dwc3/xhci-hcd.10.auto/usb5/5-1"
Sep 25 16:09:36 rock64 mtp-probe: bus: 5, device: 2 was not an MTP device
Sep 25 16:09:37 rock64 systemd-networkd[2200]: wlx000f55a844e3: Lost carrier
Sep 25 16:09:37 rock64 avahi-daemon[495]: Withdrawing address record for 192.168.3.67 on wlx000f55a844e3.
Sep 25 16:09:37 rock64 systemd-networkd[2200]: wlx000f55a844e3: DHCP lease lost
Sep 25 16:09:37 rock64 avahi-daemon[495]: Leaving mDNS multicast group on interface wlx000f55a844e3.IPv4 with address 192.168.3.67.
Sep 25 16:09:38 rock64 wpa_supplicant[2199]: wlx000f55a844e3: CTRL-EVENT-DISCONNECTED bssid=24:65:11:ee:cd:dc reason=4 locally_generated=1
Sep 25 16:09:38 rock64 avahi-daemon[495]: Interface wlx000f55a844e3.IPv4 no longer relevant for mDNS.


Read More...

Markus Wildi replied to the topic 'Saved fits not debayred' in the forum. 2 months ago

Hello

Jasem, thanks for your hint.

To keep things simple, I wrote a minimal example Python script, which performs the conversion from RGGB data, stored in a FITS File, to an RGB numpy array which is stored as a 16 bit PNG file.
The RGB array comes in two variants, interpolated and non-interpolated. For the latter case I adapted code from Osmo Systems' picamraw.

Provide a FITS file in the directory where this script is executed and rename it to 4sec.fits.

bye, wildi

#!/usr/bin/env python3                                                                                                                                                                                         
                                                                                                                                                                                                               
'''                                                                                                                                                                                                            
  Fetch RGGB data from FITS file, convert it to an RGB numpy                                                                                                                                                   
  array, with and without interpolation, and store it as                                                                                                                                                       
  uint16 PNG. This code serves as an example.                                                                                                                                                                  
                                                                                                                                                                                                               
  Variant "no interpolation" based on Osmo Systems' picamraw.                                                                                                                                                  
                                                                                                                                                                                                               
  Requires Python >= 3.5                                                                                                                                                                                       
                                                                                                                                                                                                               
  Markus Wildi, 2019                                                                                                                                                                                           
                                                                                                                                                                                                               
'''                                                                                                                                                                                                            
                                                                                                                                                                                                               
import cv2                                                                                                                                                                                                     
from astropy.io import fits                                                                                                                                                                                    
                                                                                                                                                                                                               
import numpy as np                                                                                                                                                                                             
from enum import Enum                                                                                                                                                                                          
                                                                                                                                                                                                               
# source: adapted from Osmo Systems' picamraw (https://github.com/osmosystems/picamraw).                                                                                                                       
                                                                                                                                                                                                               
class BayerOrder(Enum):                                                                                                                                                                                        
    ''' There are four supported arrangements of the R, G, G, and B pixels:                                                                                                                                    
        RGGB:                                                                                                                                                                                                  
              RG                                                                                                                                                                                               
              GB                                                                                                                                                                                               
        GBRG:                                                                                                                                                                                                  
              GB                                                                                                                                                                                               
              RG                                                                                                                                                                                               
        BGGR:                                                                                                                                                                                                  
              BG                                                                                                                                                                                               
              GR                                                                                                                                                                                               
        GRBG:                                                                                                                                                                                                  
              GR                                                                                                                                                                                               
              BG                                                                                                                                                                                               
    '''                                                                                                                                                                                                        
                                                                                                                                                                                                               
    RGGB = 'RGGB'                                                                                                                                                                                              
    GBRG = 'GBRG'                                                                                                                                                                                              
    BGGR = 'BGGR'                                                                                                                                                                                              
    GRBG = 'GRBG'                                                                                                                                                                                              
                                                                                                                                                                                                               
R_CHANNEL_INDEX, G_CHANNEL_INDEX, B_CHANNEL_INDEX = [0, 1, 2]                                                                                                                                                  
                                                                                                                                                                                                               
BAYER_ORDER_TO_RGB_CHANNEL_COORDINATES = {                                                                                                                                                                     
    # (ry, rx), (gy, gx), (Gy, Gx), (by, bx)                                                                                                                                                                   
    BayerOrder.RGGB: ((0, 0), (1, 0), (0, 1), (1, 1)),                                                                                                                                                         
    BayerOrder.GBRG: ((1, 0), (0, 0), (1, 1), (0, 1)),                                                                                                                                                         
    BayerOrder.BGGR: ((1, 1), (0, 1), (1, 0), (0, 0)),                                                                                                                                                         
    BayerOrder.GRBG: ((0, 1), (1, 1), (0, 0), (1, 0)),                                                                                                                                                         
}                                                                                                                                                                                                              
                                                                                                                                                                                                               
def _guard_attribute_is_a_multiple_of(attribute_name, attribute_value, multiple):                                                                                                                              
    if not attribute_value % multiple == 0:                                                                                                                                                                    
        raise ValueError(                                                                                                                                                                                      
            'Incoming data is the wrong shape: {attribute_name} ({attribute_value}) is not a multiple of {multiple}'                                                                                           
            .format(**locals())                                                                                                                                                                                
        )                                                                                                                                                                                                      
                                                                                                                                                                                                               
                                                                                                                                                                                                               
bggr = fits.getdata('4sec.fits')                                                                                                                                                                               
#                                                                                                                                                                                                              
# variant without interpolation                                                                                                                                                                                
#                                                                                                                                                                                                              
_guard_attribute_is_a_multiple_of('width', bggr.shape[0], 2)                                                                                                                                                   
_guard_attribute_is_a_multiple_of('height', bggr.shape[1], 2)                                                                                                                                                  
                                                                                                                                                                                                               
rgb_no_int = np.zeros((int(bggr.shape[0]/2), int(bggr.shape[1]/2), 3))                                                                                                                                         
                                                                                                                                                                                                               
((ry, rx), (gy, gx), (Gy, Gx), (by, bx)) = BAYER_ORDER_TO_RGB_CHANNEL_COORDINATES[BayerOrder.RGGB]                                                                                                             
                                                                                                                                                                                                               
rgb_no_int[:, :, R_CHANNEL_INDEX] = bggr[ry::2, rx::2]                                                                                                                                                         
rgb_no_int[:, :, G_CHANNEL_INDEX] = (bggr[gy::2, gx::2] + bggr[Gy::2, Gx::2])/2.                                                                                                                               
rgb_no_int[:, :, B_CHANNEL_INDEX] = bggr[by::2, bx::2]                                                                                                                                                         
cv2.imwrite( '4sec_no_int.png', rgb_no_int.astype(np.uint16))                                                                                                                                                  
#                                                                                                                                                                                                              
# variant with interpolation                                                                                                                                                                                   
#                                                                                                                                                                                                              
rgb = cv2.cvtColor(bggr, cv2.COLOR_BAYER_BG2RGB)                                                                                                                                                               
                                                                                                                                                                                                               
cv2.imwrite('4sec_int.png', rgb)    


Read More...

Markus Wildi created a new topic ' Saved fits not debayred' in the forum. 2 months ago

Hello

if I take an image with setting: Controls, Format, RGB 24 and open it with gimp 2.10,
dialog: Load Fits File: Image Composing NAXIS=3, NAXIS3=2,...,4 I see an RGB image.

If I switch to: Controls, Format 16 bit, I see with INDI fits viewer an RGB image and if
I save it (as FITS, no other choice), I see the RGGB pattern and in gimp it is of type
greyscale and the RGGB pattern is clearly visible.

What are the steps to convert an 16 bit RGGB image to, eg. 16 bit TIFF, or any other
format?

Kind regards, wildi

camera: ASI294MC
indi_asi_ccd driver settings: Controls, Format Raw 16 bit
kstars settings: auto debayer: true, 3d cube: true
Ubuntu: DISTRIB_RELEASE=19.04, DISTRIB_CODENAME=disco
INDIlib repo: ppa.launchpad.net/mutlaqja/ppa/ubuntu disco InRelease

Read More...

Markus Wildi replied to the topic 'Dome Sync Gateway not producing timely GOTO commands' in the forum. 2 years ago

Hello Scott and all

I got hold of P.T. Wallace paper about dome slit synchronization
( www.tpointsw.uk/edome.pdf ) and implemented it as a Python
script and as a C library:

github.com/RTS2/rts2/blob/master/scripts/dome_target_az.py
github.com/RTS2/rts2/blob/master/lib/rts2/slitazimuth.c

Wallace's solution has the advantage being simpler and supporting
the cupola center versus HA/Dec axis intersection offset in x,y,z.

I tested it at Obs. Vermes (radius 1.26 meter) and the optical axis
pointed within 1...2 deg to the slit center with dec axis being set
to HA +/- pi/2 ("East", "West").

Before using it, read Wallace's paper and have a look at the
C library version. The script has an option: --test-wallace
which reproduces the values from the paper.

ciao, wildi

example values from the paper:
longitude: 0.00, latitude: 36.18, h: 2.50, dec:37.90
WALLACE : x_m: -35.0, y_m: 370.0, z_m: 1250.0, r: 0.0, p: 0.0, q: 505.0, rdome: 1900.0
WALLACE : lat: 36.182, h: 149.886 arcmin, dec: 37.901, dome az: 50.369/50.3694111 deg, el: 72.052/72.051742 deg
WALLACE_LB: dome az: 50.369/50.3694111 deg

WALLACE : x_m: -35.0 m, y_m: 370.0 m, z_m: 1250.0 m, r: 0.0, p: 0.0, q: 505.0, rdome: 1900.0 m
WALLACE : dome az: 305.595/305.595067 deg, el: 68.824/68.824495 deg
WALLACE_LB: dome az: 305.595/305.595067 deg

Read More...

Markus Wildi replied to the topic 'Dome Sync Gateway not producing timely GOTO commands' in the forum. 3 years ago

Hello Scott

it took me a while to get Obs. Vermes up and running. I checked the dome slit / mount synchronization and it worked reasonable.

regards, ciao, wildi

Read More...

Markus Wildi replied to the topic 'Dome Sync Gateway not producing timely GOTO commands' in the forum. 3 years ago

Hello Scott and Ferran

I have not seen RTS2 on OSX (and I would not try it, at least not for this purpose). There is an easier way: use Docker which provides an Ubuntu container on your OSX computer. But this is a several hours task.

My idea is, that Ferran produces a similar table with his code and depending on the results when know better where to dig deeper.
I read through my original notes and found that I was checking my code against Toshimi Taki's "reference implementation" saying it is identical (see www.geocities.jp/toshimi_taki/matrix/matrix.htm paragraph Applications and my similar plot: azug.minpet.unibas.ch/wikiobsvermes/images/9/97/DomeSync.jpg )

ciao, wildi

Read More...

Markus Wildi replied to the topic 'Dome Sync Gateway not producing timely GOTO commands' in the forum. 3 years ago

Hello Ferran and Scott

Jasem informed me about your issue. I quickly wrote a Python script which calls RTS2's slitazimuth.c,
my original implementation of Toshimi Taki's solution. It is available at

github.com/RTS2/rts2/blob/master/scripts/dome_target_az.py

In order to use it you must clone RTS2 and compile it (installation is not required)
and in do

cd ~/rts2/lib/rts2
gcc -c -Werror -fpic slitazimuth.c -I../../include/ && gcc -shared -o libslitazimuth.so slitazimuth.o -lnova

ciao, wildi


wildi@dc11:~/rts2/scripts$ ./dome_target_az.py
AZ coordinate systen: S=0, W=90 deg
xd: -0.0684 m, zd: -0.1934 m, rdec: 0.338 m, rdome: 1.265 m
telescope alt: 0.000, az: 0.000, dome az: 15.688 deg
telescope alt: 10.000, az: 0.000, dome az: 15.505 deg
telescope alt: 20.000, az: 0.000, dome az: 15.859 deg
telescope alt: 30.000, az: 0.000, dome az: 16.852 deg
telescope alt: 40.000, az: 0.000, dome az: 18.724 deg
telescope alt: 50.000, az: 0.000, dome az: 21.986 deg
telescope alt: 60.000, az: 0.000, dome az: 27.781 deg
telescope alt: 70.000, az: 0.000, dome az: 38.917 deg
telescope alt: 80.000, az: 0.000, dome az: 62.186 deg
telescope alt: 0.000, az: 90.000, dome az: 108.680 deg
telescope alt: 10.000, az: 90.000, dome az: 108.213 deg
telescope alt: 20.000, az: 90.000, dome az: 108.252 deg
telescope alt: 30.000, az: 90.000, dome az: 108.814 deg
telescope alt: 40.000, az: 90.000, dome az: 109.964 deg
telescope alt: 50.000, az: 90.000, dome az: 111.790 deg
telescope alt: 60.000, az: 90.000, dome az: 114.285 deg
telescope alt: 70.000, az: 90.000, dome az: 116.795 deg
telescope alt: 80.000, az: 90.000, dome az: 115.961 deg
telescope alt: 0.000, az: 180.000, dome az: 195.688 deg
telescope alt: 10.000, az: 180.000, dome az: 195.500 deg
telescope alt: 20.000, az: 180.000, dome az: 195.741 deg
telescope alt: 30.000, az: 180.000, dome az: 196.489 deg
telescope alt: 40.000, az: 180.000, dome az: 197.915 deg
telescope alt: 50.000, az: 180.000, dome az: 200.364 deg
telescope alt: 60.000, az: 180.000, dome az: 204.563 deg
telescope alt: 70.000, az: 180.000, dome az: 212.184 deg
telescope alt: 80.000, az: 180.000, dome az: 132.560 deg
telescope alt: 0.000, az: 270.000, dome az: 281.824 deg
telescope alt: 10.000, az: 270.000, dome az: 281.814 deg
telescope alt: 20.000, az: 270.000, dome az: 282.165 deg
telescope alt: 30.000, az: 270.000, dome az: 282.975 deg
telescope alt: 40.000, az: 270.000, dome az: 284.456 deg
telescope alt: 50.000, az: 270.000, dome az: 287.077 deg
telescope alt: 60.000, az: 270.000, dome az: 292.066 deg
telescope alt: 70.000, az: 270.000, dome az: 304.223 deg
telescope alt: 80.000, az: 270.000, dome az: 15.060 deg

Read More...