Scientific Computing

GnssLogger app save file location

The Android GnssLogger app logs data in the user-selected formats, including RINEX. GnssLogger can run for hours or days, assuming the device has enough storage. Do test runs to be sure unnecessary other data files aren’t also stored as they can be much larger than the RINEX data.

Android Raw GNSS measurements are available on numerous listed devices.

When clicking “save and send” to end a logging session, the app asks where to save in the cloud. Simply canceling the upload retains the data in the “Downloads” folder on the device. This can be useful when the device has a low-bandwidth or expensive data connection, and the data can be uploaded later or copied to a computer via USB.

Fortran alias procedure name

In addition to generic and polymorphic procedures, Fortran also allows aliasing procedure names. This is useful to provide a shorter or more convenient name for a procedure.

It’s easiest to understand from the example below.

program main

interface easy
procedure :: long_and_descriptive_procedure_name
end interface

call easy()

contains

subroutine long_and_descriptive_procedure_name
print '(a)', "Hello from long name"
end subroutine long_and_descriptive_procedure_name

end program

Install Matlab Engine API in Python

Matlab Engine API allows calling Matlab functions from Python code.

These commands are executed from Terminal, not from Matlab. Go to the Matlab Engine directory to setup Matlab Engine, where “python” starts the desired Python executable.

r=$(matlab -batch "disp(matlabroot)" | tail -n1)

python -m pip install -e ${r} --user

Root / admin permissions are NOT needed.


A simple example of using Matlab from Python:

import matlab.engine
eng = matlab.engine.start_matlab('-nojvm')
y = eng.asin(1.)

eng.quit()

The Matlab Engine should take about 1 second for Matlab Engine to start when called from Python. For Matlab functions requiring JVM remove the “-nojvm” option.

Many Matlab numeric classes (single, double, logical) can be converted to Python types like:

numpy.asarray(x)

Python floats pass into Matlab Engine by including a period . after the number.

  • asin(1) fails
  • asin(1.) works

Python can pass N-dimensional arrays to Matlab.

Matlab Engine provides asynchronous call with background=True


References:

Related:

CTest parallel run by default

CMake environment variable CTEST_PARALLEL_LEVEL controls default test parallellism to save test run wallclock time. CTEST_PARALLEL_LEVEL=0 uses unbounded test parallelism. If the computer runs out of memory or has conflicts with parallel tests, use fixtures and resource locks to control test run parallelism on a per-test basis.

CTest parallel somewhat randomizes the order of the tests. ctest –schedule-random randomizes the order of tests even for serial test runs.

This example run on a 4-core machine shows that no extra command line parameters are needed to use CTEST_PARALLEL_LEVEL:

CMakeLists.txt:

cmake_minimum_required(VERSION 3.12)

project(par LANGUAGES NONE)

enable_testing()

message(STATUS "ENV{CTEST_PARALLEL_LEVEL}: $ENV{CTEST_PARALLEL_LEVEL}")

foreach(t RANGE 8)
  add_test(NAME sleep${t} COMMAND ${CMAKE_COMMAND} -E sleep 1)
endforeach()
export CTEST_PARALLEL_LEVEL=0

ctest --test-dir build

or

ctest --test-dir build --parallel
Internal ctest changing into directory: C:/temp/build
Test project C:/temp/build
    Start 2: sleep1
    Start 5: sleep4
    Start 3: sleep2
    Start 7: sleep6
1/8 Test #5: sleep4 ...........................   Passed    1.05 sec
    Start 6: sleep5
2/8 Test #7: sleep6 ...........................   Passed    1.04 sec
    Start 1: sleep0
3/8 Test #2: sleep1 ...........................   Passed    1.06 sec
    Start 8: sleep7
4/8 Test #3: sleep2 ...........................   Passed    1.06 sec
    Start 4: sleep3
5/8 Test #1: sleep0 ...........................   Passed    1.06 sec
6/8 Test #6: sleep5 ...........................   Passed    1.06 sec
7/8 Test #8: sleep7 ...........................   Passed    1.05 sec
8/8 Test #4: sleep3 ...........................   Passed    1.05 sec

100% tests passed, 0 tests failed out of 8

Total Test time (real) =   2.14 sec

X11 on macOS

X11 can be accessed using XQuartz as available via Homebrew.

brew install libx11 xquartz

To finish the one-time setup of XQuartz, logout/login or reboot. Check that X11 server is available by

echo $DISPLAY

which should show a temporary directory ending like “org.xquartz:0”.

Demo and troubleshooting

See that X11 is working with the classic Xeyes test GUI.

xeyes

A useful image browsing program on Linux, macOS etc. is feh:

brew install feh

Troubleshooting: XQuartz GitHub Issues

Specifically, be sure XQuartz is enabled in Login Items to fix problems like the XQuartz window won’t open.

XQuartz will open automatically when any X11 program is started.


Related: PulseAudio on macOS

macOS power-off USB sleep

By default, macOS keeps USB ports constantly providing power while in sleep mode, which can run down the laptop battery if a USB device such as a docking station is plugged in without a power adapter. pmset macOS command utility can set USB ports to power-off when the lid is closed. This works by putting the laptop into hibernate mode, which makes the laptop wake up a few seconds slower than the standard sleep.

Get current power settings:

pmset -g

Note the “hibernatemode” value.

  • 3: sleep mode with power on to USB ports.
  • 25: DeepSleep hibernate, which powers off USB ports.
pmset -a hibernatemode 25

Test this by pushing the power button or closing the laptop lid. Wait a minute to see if the USB device loses power. A USB power analyzer (volt meter) can be used to check the USB port power as well.

10 meter AM / FM calling frequency

The 10 meter ham radio band has a suggested FM calling frequency of 29.6 MHz, which is nestled among the repeater frequencies. With a dedicated 10 meter FM band antenna tuned for the 29.5 - 29.7 MHz range, this works fine. However, many 10 meter operators primarily use CW, data, SSB, and similar modes in the 28.0 - 28.5 MHz range. Most popular 10m antennas such as a dipole antenna or 1/4 wavelength vertical antenna tuned for say 28.3 MHz may have an excessively high SWR at 29.6 MHz. Operators using inexpensive converted 27 MHz CB radios may not be able to tune the non-5kHz offset channel. That is, they might be able to tune to 29.605 MHz, but not 29.600 MHz.

The 10m AM mode calling frequency is generally 29.0 MHz, which is much closer to the 28 MHz SSB/CW frequencies. This allows more efficient use of the same antenna for both 10m SSB/CW and AM. An AM channel offset as much as 5 kHz can generally still be heard by another AM receiver, but with reduced signal efficiency. 10 kHz AM channel spacing is generally adequate for AM radios (as observed by CB radio channel plans and MW AM broadcast plans).

It is worth considering a “new” FM calling frequency near but just above 29 MHz with a 5 kHz offset to address using inexpensive converted CB radios and more optimally using the same antenna as for 28 MHz SSB/CW. We suggest considering 29.055 MHz as a new 10 meter FM calling frequency. This is far enough away from the AM calling frequency of 29.0 MHz and typically working frequencies just above 29.0 MHz.

In this table, the “converted CB channel” assumes common export radio channel charts. The specific radio may have a different channel number for the same frequency. We’ve put in a possible “new” AM calling frequency of 29.005 MHz for converted CB radios, if such would be desired. The jump in channel sequencing from channels 23, 24, 25 is a de facto standard.

frequency (MHz) mode description converted CB channel
29.000 AM 10 meter AM calling frequency
29.005 AM AM calling freq. for converted CB radios 20
29.015 AM AM working frequency 1 21
29.025 AM AM working frequency 2 22
29.035 FM FM working frequency 1 24
29.045 FM FM working frequency 2 25
29.055 FM 10 meter FM calling frequency 23

CB Radio 11 meter DX

In 2017, WT Docket 10-119 modernized FCC 27 MHz (11 meter) CB Radio Rules as published in the Federal Register, including replacing 95.333 and 95.933. The obsolete Part 95.413 rule limiting legal CB radio communications to 250 km was removed.

CB Radio rules do not specify a maximum range for CB radio communications, as long as the other station is in the United States or Canada. Therefore, “DX”, two-way long distance communication typically using non-groundwave propagation such as skywave, meteor scatter, etc. is legal for USA CB radio operators with other CB radio stations in the United States and Canada.

At dusk/dawn, a form of skywave propagation known as greyline propagation can occur, allowing strong signals between distant stations within the same dawn/dusk region as seen on this live map. If propagation is enhanced but no station is transmitting on the frequency one is listening to, the propagation enhancement is not noticed. Like on other frequency bands, listening for known transmitters is a useful DX detection technique in the 11 meter band. For example, Broadcast Auxiliary Remote Stations (STL) can be heard around 26 MHz. 27.025 MHz CB radio channel 6 in the AM mode is a common frequency for CB DX. The 12 meter and 10 meter NCDXF beacons provide another source of live propagation detection, especially for seeing if the MUF is near the 11 meter band. The UK CADS and Ireland WPAS 11 meter community service broadcasts overlap with some traditional CB radio frequencies.

International DX groups may use calling frequencies including SSB 26.285 MHz, FM 26.805 MHz, and SSB 27.555 MHz, but these frequencies are generally not legal to transmit on.