Notes on Open Meteo's UV Index

There is no built-in UV index in the original’s NOAA’s GFS data. However, Open Meteo provides UV index forecast in GFS’s data API and other weather models. That’s very interesting because it means that Open Meteo is doing some additional processing on top of the raw GFS data to derive the UV index. So I dig into it’s source code to see how they are calculating the UV index: 1 2 3 4 5 6 7 8 9 10 11 // https://github.com/open-meteo/open-meteo/blob/bf9577492dde460f9428d5d892b43bab9faa93ef/Sources/App/Gfs/GfsVariableDownloadable.swift#L473-L477 func multiplyAdd(domain: GfsDomain) -> (multiply: Float, add: Float)? { switch self { // ... case .uv_index, .uv_index_clear_sky: // UVB to etyhemally UV factor 18.9 https://link.springer.com/article/10.1039/b312985c // 0.025 m2/W to get the uv index // compared to https://www.aemet.es/es/eltiempo/prediccion/radiacionuv return (18.9 * 0.025, 0) // ... That make things simple. Just use existing GFS UVB data and apply a simple linear transformation to get the UV index. ...

 · 1 min · 147 words · ringsaturn

Hosting LaTeX-compiled PDFs on GitHub Pages

A few days ago, I wanted to organize my resume information. Following my usual habit, I wrote it in LaTeX. However, when I wanted to publish it online to share the resume link, I needed to upload the PDF somewhere. The PDF file of the resume is a binary file, and I didn’t want to store it directly in the repository. So I decided to use GitHub Actions to automatically compile the LaTeX file and publish the generated PDF to GitHub Pages. ...

 · 2 min · 273 words · ringsaturn
Precipitation Comparison of Beijing/Shanghai/Tokyo

Historical Weather Statistics Using GHCNd Dataset

The full name of the GHCNd dataset is the Global Historical Climatology Network daily. It is a global observation dataset publicly released by NOAA, with data starting from 1763, containing daily meteorological observation data from a total of 120,000 weather stations worldwide. The monthly summary version of the GHCNd dataset is the Global Historical Climatology Network monthly. During the weekend, I performed some statistical analysis on this dataset, and I’d like to record the general processing workflow. ...

 · 2 min · 287 words · ringsaturn

Reverse Geocoding of Japanese Administrative Divisions

A few months ago, I wanted to map Japanese coordinate data to administrative division levels. To achieve this, I developed a reverse geocoding tool reversejp using administrative boundary data from the Japan Meteorological Agency (JMA). The core functionality is implemented in Rust, and I packaged it as a Python library using PyO3 and Maturin. Although Japan’s land area is not very large, the JMA dataset subdivides the country into over 3,000 administrative units at its finest level. Considering Japan’s total land area, this results in extremely fine-grained coverage. ...

 · 2 min · 231 words · ringsaturn

A Local Debugging MongoDB Proxy

A local debugging MongoDB proxy

 · 1 min · 122 words · ringsaturn

Group world cities by timezone

A simple example of how to group world cities by timezone

 · 4 min · 725 words · ringsaturn

Released pg-tzf: High-Performance Lat/Lon → Time Zone PostgreSQL Extension

Developed and released pg-tzf, a PostgreSQL extension providing microsecond-level latitude/longitude to time zone conversion, based on the Rust library tzf-rs and the pgrx framework.

 · 1 min · 145 words · ringsaturn

Just Writing Something

A record of blog improvements, including multilingual support, SEO optimization, and a personalized logo generated by ChatGPT.

 · 2 min · 289 words

Short URL in Hugo

A guide to implementing short URL redirects in Hugo static sites, featuring both manual HTML redirect pages and an automated Go-based solution for generating redirect pages.

 ·  · 2 min · 288 words · ringsaturn

Auto center with caption for images in Hugo

Create a file: layouts/_default/_markup/render-image.html: 1 2 3 4 5 6 <figure class="align-center "> <img loading="lazy" src="{{ .Destination | safeURL }}#center" alt="{{ .PlainText }}" > {{ with .Text }} <figcaption><p>{{ . | safeHTML }}</p></figcaption> {{ end }} </figure> Then magic happens: 1 ![sample](/img/nmc-bin/RADAR_L3_MST_CREF_GISJPG_Tiles_CR_20250126_13_06_3_2_6.png) Render as: sample

 · 1 min · 45 words · ringsaturn