<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Peijin Zhang (张沛锦)</title>
    <description>The latest articles on DEV Community by Peijin Zhang (张沛锦) (@peijin94).</description>
    <link>https://dev.to/peijin94</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3615548%2Fb6e3ffb2-d974-4eb7-b78d-13f9dca6ab2c.jpeg</url>
      <title>DEV Community: Peijin Zhang (张沛锦)</title>
      <link>https://dev.to/peijin94</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peijin94"/>
    <language>en</language>
    <item>
      <title>Use a container for astronomy data processing</title>
      <dc:creator>Peijin Zhang (张沛锦)</dc:creator>
      <pubDate>Tue, 18 Nov 2025 20:23:34 +0000</pubDate>
      <link>https://dev.to/peijin94/use-a-container-for-astronomy-data-processing-4pb6</link>
      <guid>https://dev.to/peijin94/use-a-container-for-astronomy-data-processing-4pb6</guid>
      <description>&lt;p&gt;Radio astronomy needs a lot of software: CASA, WSClean, DP3, LOFAR tools, custom scripts—and installing all of them cleanly on every machine is painful. &lt;/p&gt;

&lt;p&gt;Containers let you ship a complete, working environment that runs the same on your laptop, workstation, and HPC.&lt;/p&gt;

&lt;p&gt;Below is a short, practical workflow using &lt;strong&gt;Podman&lt;/strong&gt; and the astronrd/linc image, and then an example of building your own image like &lt;code&gt;peijin/lwa-solar-pipehost&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Install Podman
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://podman.io/docs/installation" rel="noopener noreferrer"&gt;https://podman.io/docs/installation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MacOS, (need brew &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;https://brew.sh/&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install podman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Windows, need WSL (follow instructions here:&lt;a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/windows/wsl/install&lt;/a&gt;) then inside WSL is a ubuntu.&lt;/p&gt;

&lt;p&gt;Or linux&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Debian/Ubuntu
sudo apt-get update
sudo apt-get install -y podman

# Fedora
sudo dnf install -y podman
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pull and run image
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;astronrd/linc&lt;/code&gt; image (from ASTRON) is a great “batteries included” environment for radio interferometric calibration and imaging.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman pull docker.io/astronrd/linc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then try to start an interactive shell inside the container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run --rm -it \
  -v /your/data/path:/data \
  docker.io/astronrd/linc \
  /bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--rm&lt;/code&gt; – delete the container when you exit&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-it&lt;/code&gt; – interactive terminal&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-v /your/data/path:/data&lt;/code&gt; – mount your local data directory into /data inside the container&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker.io/astronrd/linc&lt;/code&gt; – the image to run&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/bin/bash&lt;/code&gt; – start a bash shell inside&lt;/p&gt;

&lt;p&gt;Now you’re inside a fully configured environment with tools like DP3 and WSClean available, without installing them on your host system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try WSClean and DP3 inside &lt;code&gt;astronrd/linc&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Once inside the container shell, you can test the tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wsclean --version
DP3 --help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then exit to escape the shell.&lt;/p&gt;

&lt;h2&gt;
  
  
  (optional) Build your own Docker/Podman image
&lt;/h2&gt;

&lt;p&gt;Although there are so many plug-and-play-ready prebuilt container images, sometimes when a more customized package is needed, it's more convenient to create an image.&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pin exact versions (WSClean v3.x, DP3 commit XYZ, CASA version, etc.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add your own pipelines/scripts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pre-configure environment variables, paths, and helper tools&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following is a minimal example of how you might build an image like &lt;code&gt;peijin/lwa-solar-pipehost&lt;/code&gt; for an OVRO-LWA–style pipeline host.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: create &lt;code&gt;Dockerfile&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Create a file called Dockerfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Start from a base astronomy image (or just Ubuntu)
FROM docker.io/astronrd/linc:latest
# or: FROM ubuntu:22.04

# Set a working directory
WORKDIR /opt/pipeline

# Install extra system packages (example)
RUN apt-get update &amp;amp;&amp;amp; apt-get install -y --no-install-recommends \
    git \
    python3 \
    python3-pip \
    &amp;amp;&amp;amp; rm -rf /var/lib/apt/lists/*

# Copy your pipeline scripts into the image
COPY pipeline/ /opt/pipeline/

# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt

# Set environment variables (example)
ENV PYTHONUNBUFFERED=1 \
    OMP_NUM_THREADS=8

# Default entrypoint (can be a shell, or a pipeline script)
ENTRYPOINT ["/bin/bash"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course, you can do other optimizations to include more packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Build the image
&lt;/h3&gt;

&lt;p&gt;From the directory with your Dockerfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman build -t peijin/lwa-solar-pipehost:latest .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Run container with the image
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;podman run --rm -it \
  -v /your/data/path:/data \
  peijin/lwa-solar-pipehost:latest \
  /bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside, your pipeline code is already in /opt/pipeline.&lt;/p&gt;

</description>
      <category>astronomy</category>
      <category>radio</category>
      <category>hpc</category>
      <category>computing</category>
    </item>
  </channel>
</rss>
