XMM HTML Summary Files

XMM has observation summary files that are part of the PPS files. The summary files are written in HTML. Is there a way to open the HTML summary file in a browser tab from inside a Jupyter Notebook?

I can display the contents inside of a Jupyter Notebook, but there are internal links to other summary files that don’t work.

This is not something critical so if there isn’t an easy fix that’s ok. I just need to know so I know what options I have available while making improvements to pySAS.

Just for completeness this will “recreate” the issue (or allow for testing):

import pysas
import re
from IPython.display import HTML

obsid = '0123700101'
my_obs = pysas.ObsID(obsid)
my_obs.download_PPS_data(repo='heasarc')

html_file = []

for filename in my_obs.files['PPS']:
    if re.search('.*OBX.*SUMMAR.*.HTM$',filename):
        html_file.append(filename)

HTML(filename = html_file[0])

This will download the PPS files for a single Obs ID and get the filename (and path) to the main summary file and then display the contents of the summary file inside of a Jupyter notebook. But this just displays the contents and internal links do not work.

Supposedly this command should open the file in a new browser tab:

import webbrowser
webbrowser.open(html_file[0])

But this doesn’t work.

Generally, an HTML file can be opened from the file browser on the left by clicking it, and it opens Jupyter’s html viewer, which is a basic html renderer.

Files with .HTM extension (used in the XMM PPS) are not recognized by that html viewer and so when you click on them, they open in an editor not a viewer. If you rename them to from .HTM to .HTML, they become viewable as a tab inside jupyterlab.

It looks to me like you are trying to open them from inside python code, which I don’t think is doable in a trivial way without doing a jupyterlab extension.

In the code above, the first part does not work because HTML only displays html text it gets from filesname. A link brings a new file that the widget does not know how to open.

webbrowser does not work because it tries to open a standard browser (e.g. firefox or chrome), but it cannot because the code is running in remove server, and it cannot open a browser inside the container because that is not supported by jupyterlab interface.

Since Jupyterlab does not recognize .HTM files as html files, we will be updating our deployment to register that extension as an HTML extension so the HTML viewer can display it correctly. This will be deployed in the next software update.

1 Like

The changes have been deployed on 01/09/2026.