Scientific Computing

ImageJ save multi-frame FITS files

Save a “stack” of image data open in ImageJ as FITS by

File → Save, choose save filename e.g. out.fits

Don’t use File → Save As → FITS because that only saves the FIRST frame, discarding the rest of the image stack.

TeXstudio user dictionary ignored words

The TeXstudio user dictionary is a plain-text .ign file. The user dictionary is used for simple match-and-ignore.

  • Linux: ~/.config/texstudio/texstudioen_US.ign
  • Windows: %APPDATA%/Roaming/TeXstudio/dictionaries/en_US.ign

Setup Red Pitaya for GNU Radio

Setup Red Pitaya:

Format a micro SD card to FAT32. Find the SD card device name from df – be sure you don’t overwrite your hard drive! Suppose the SD card is at /dev/mmcblk0:

umount /dev/mmcblk0
mkdosfs -F 32 -n GNURadio /dev/mmcblk0

Unzip Pavel Demins SD Card image to this SD card

mount /dev/mmcblk0 /mnt/GNURadio
unzip ecosystem-*-sdr-transceiver.zip -d /mnt/GNURadio
umount /mnt/GNURadio

Boot the Red Pitaya with this SD card. Connect to Red Pitaya via Ethernet using SSH (login/password root/root) using Avahi

ssh root@redpitaya.local

or via serial port


Setup laptop:

Setup GNU Radio Companion

cd ~
git clone https://github.com/pavel-demin/red-pitaya-notes

Create a shell script ~/rpgr to start GNU Radio Companion for Red Pitaya

#!/bin/sh
export GRC_BLOCKS_PATH=~/red-pitaya-notes/projects/sdr_transceiver/gnuradio

gnuradio-companion

Make it executable with

chmod +x ~/rpgr

Setup projects

Each directory where you have a GNU Radio Red Pitaya project must have a softlink to red_pitaya.py. In each of your GRC project code directories, do:

ln -s ~/red-pitaya-notes/projects/sdr_transceiver/gnuradio/red_pitaya.py .

This is because Red Pitaya is not yet an OOT (Out of Tree) module for GNU Radio.


Example GNU Radio code for Red Pitaya under RedPitaya/


Related: Red Pitaya Pulsed NMR image setup

Red Pitaya v1.1 educational pricing

The Red Pitaya v1.1 education pricing is currently 149 Euro or $166 US. A pair of Red Pitaya v1.1 will test the phase-modulated waveform for PiRadar.

This makes it easier to avoid fiddling around with the Raspberry Pi due to the PWM PLL timing glitches we observed in initial experiments. In fact, using the Red Pitaya for PiRadar will cost less than the Raspberry Pi!

RF Signal Generation and Reception:

  1. Transmit PiRadar waveform with 100 kHz bandwidth centered at 3.7 MHz: complex baseband → DUC → DAC
  2. Receive PiRadar waveform at 3.7 MHz with 100 kHz bandwidth: ADC → DDC → complex baseband
  3. Generate simple metric of data bandwidth vs. SNR and bandwidth in AWGN (should reasonably match theory)

Data recording: record complex baseband signal to USB HDD in digital_rf.

FPGA timing: has to work well or the rest of the radar doesn’t work – this is key project-wide blocker

  1. get 1 PPS to trigger noise sequence transmission.
  2. trigger receiver off of 1 PPS or mark receive samples with 1 PPS ticks

PiRadar Signal Processing:

  1. obtain previously recorded data
  2. what can we process onboard the Red Pitaya given limited CPU/RAM?
  3. first data reduction step: tagging obviously interesting data.
  4. Flag interesting data for long-term retention or priority over-the-air download or alerting.

Convert Latex Tikz diagram to SVG

LaTeX Tikz diagram can be converted to SVG vector graphics conversion at full quality from the command line (no GUI). Convert LaTeX Tikz diagram to SVG by generating PDF from LaTeX as usual:

pdflatex mydoc.tex

Use Inkscape from Terminal to convert PDF to SVG at full vector quality:

inkscape -l out.svg in.pdf

Convert SVG to EPS or PNG from command line

To use SVG in Overleaf or LaTeX without \usepackage{svg}, convert SVG to EPS or PNG. This may be needed for some journals that don’t allows using extra packages like svg.

Convert SVG to EPS: vector graphics conversion at full quality from the command line (no GUI). Imagemagick doesn’t seem to be able to do this (Imagemagick makes gigantic raster EPS), but Inkscape does the vector SVG to EPS conversion well.

inkscape -E out.eps in.svg

Convert SVG to PNG (raster) with

inkscape -e out.png in.svg

See man inkscape for more options e.g. to select PNG resolution.

OMTI auroral imager at RISR data download

The Optical Mesosphere Thermosphere Imager (OMTI) system used four CCD filtered cameras to gaze at the aurora from 2005-2014 at the Resolute Bay Incoherent Scatter Radar (RISR) site. Distant instruments such as satellites and SuperDARN have been used together with OMTI data in the selection of OMTI-based literature below.

year author name
1999 Kazuo Shiokawa, Yuto Katoh, M. Satoh, et al Development of Optical Mesosphere Thermosphere Imagers (OMTI)
2011 Hanna Dahlgren, Joshua Semeter, Keisuke Hosokawa Direct three-dimensional imaging of polar ionospheric structures with the Resolute Bay Incoherent Scatter Radar (Poster)
2012 Hanna Dahlgren, Gareth Perry, Joshua Semeter, et al Space-time variability of polar cap patches
2015 G. Perry, H. Dahlgren, M. Nicolls, et al Spatiotemporally resolved electrodynamic properties of a Sun-aligned arc over Resolute Bay
2015 Gareth Perry (PhD Thesis) Large scale plasma density perturbations in the polar F-region ionosphere

OMTI data download, plot and register

The OMTI data have been posted along with OMTI-RISR plotting/registration software.

Recursively download OMTI data:

wget -r -np -nc -nH --cut-dirs=4 --random-wait --wait 1 -e robots=off https://ergsc.isee.nagoya-u.ac.jp/data/ergsc/ground/camera/omti/asi/

you can specify individual folders too.

Final verification of Intel vPro on site setup

When setting up a distant observatory it’s good to do a few final checks that otherwise require a site visit to fix. Although remote connection via SSH to the observatory PC is standard, the Intel vPro chipset, specifically the Intel Manageability Engine, serves as a crucial backup in case of operating system failure. This technology enables remote initiation of a Clonezilla USB stick or CD left in the PC to reimage the complete drive using the on-site external HDD prepared with Clonezilla prior to shipping. If this system fails, a site visit will be necessary to address major software issues.

To verify the Intel ME web server from the remote PC, access:

  • http://localhost:16992
  • https://localhost:16993

Verification from a laptop requires port forwarding SSH on the final hop, ensuring these ports are not exposed to the public Internet.

Access to the web interface allows selection of the boot drive. While this alone does not suffice for reimaging, maintaining two installed operating systems with boot-flagged partitions on each drive can be beneficial. Connection verification can be performed using MeshCommander, providing visibility and access to BIOS during boot and graphical remote control as if physically present at the PC.

Be sure the CPU fan hasn’t become loose from the CPU, that no wires are near the fan blades, and every cable is still plugged snug into the motherboard.

Using RFspace SDR-IQ on Linux with CuteSDR

Using the RFspace SDR-IQ on Linux is done with the CuteSDR program.

  1. install CuteSDR
    apt install cutesdr
  2. In CuteSDR, click Setup → Network and enter 127.0.0.1 IP address.
  3. click Find → Find SDR then click OK. You should see the “run” button is available–even if you didn’t see a radio pop up under Find SDR.

Run

SDR-IQ on Linux is run using two terminals. Forking siqs_ftdi & didn’t seem to work for me.

Terminal #1:

siqs_ftdi

Terminal #2:

CuteSdr

Alternative

RFSpace SDR-IQ via SpectraVue on Linux WINE