xarray.open_dataset
can open HDF5 files.
However, unexpected HDF5 file layouts can cause Python to quietly crash without error message.
This is true even with the minimum required versions of xarray, h5py and h5netcdf installed.
We don’t have a specific workaround for this other than to use
h5py
to build up an xarray Dataset variable-by-variable.
One should almost always use a Python
context manager
when working with file I/O in Python.
Context managers for Python I/O resources help avoid exceeding system
resource limits.
For long running jobs, context managers help avoid random crashes due to excess file I/O resource utilization from files left hanging open.
There are edge cases where you do need to keep the handle open without context manager–for example, inside a for loop.
In many cases, it may be better and easier to let the file open and close with the context manager.
It is also possible to create your own content managers with Python
contextlib,
which we use in
georinex
for example.
The Free TightVNC server works with Ubuntu and other modern Linux distros.
In general the default 3-D Ubuntu desktop is not available over VNC, so we use a traditional 2-D desktop environment over VNC.
Install Linux VNC Server:
apt install tightvncserver openbox
Choose desktop environment on server PC: XFCE4, Openbox or other you prefer.
Pick ONE of the following:
Openbox is the lightest-weight desktop environment–right click to open a menu.
Otherwise, you just have a plain gray background, extremely minimal–good for embedded systems and old PCs.
Openbox-Message: Unable to find a valid menu file “/var/lib/openbox/debian-menu.xml”
Wwhen I get this error, I’m also unable to open a terminal.
You can leave your VNC desktop running – it is not the same as your local desktop.
It is a little tricky to share your local desktop reliably. X11VNC can be more trouble than it is worth.
It’s MUCH easier to startup a new separate desktop session with vncserver or x11vnc
After installing a new desktop environment, at your next local login, you’ll need to rechoose the traditional Ubuntu desktop (it will then remember this choice).
Meson does not have built-in the ability to download any file.
While this could also be done via a custom_target(), we do it via run_command() in meson.build.
This
technique
uses only Python stdlib modules; no extra pip install is needed.
Python’s
urllib.request.urlretrieve
doesn’t have a way to handle connection timeouts.
This can lead to user complaints where they think your program is hanging, when really it’s a bad internet connection since urlretrieve will hang for many minutes.
For CDF file read / write, pure Python + Numpy
cdflib
as cdflib is OS-agnostic, easy to install and performant.
The .cdf file format is totally different from “.nc” NetCDF4 files, which are essentially specially formatted HDF5 files.
OpenGL support is widespread.
OpenGL enables extremely fast 2D and 3D animation–including from Python.
With VisPy, OpenGL is easily used with Matplotlib-like syntax to make interesting 3-D plots from Numpy arrays.
VisPy also has an advanced interface to OpenGL from Python.
Installing VisPy is easiest by:
conda install vispy
Examples:
git clone https://github.com/vispy/vispy
in the vispy/examples/demo directory are numerous examples.
Try using the mouse scroll wheel to zoom on some demos.