Merged
Conversation
New Files
- src/interface/timeseries_popup.h - Header declaring init/show/cleanup for the time series popup
- src/interface/timeseries_popup.c (~400 lines) - Non-modal popup window with custom XLib drawing:
- "Nice numbers" tick algorithm for human-readable axis intervals
- Y-axis with numeric tick labels (left margin 80px)
- X-axis with CF time date formatting (if detected) or numeric labels
- Light gray grid lines, blue data line (2px) with dots at data points
- Gaps in line for fill/missing values
- Deep-copies data for Expose redraws
- Close button to dismiss
Modified Files
1. src/ushow.defines.h - Added TSData struct (times, values, valid, title, axis labels)
2. src/file_netcdf.h/c - Added netcdf_read_timeseries() and netcdf_read_timeseries_fileset() for single-point time series extraction (handles structured 2D and unstructured 1D,
scale_factor/add_offset, fill values)
3. src/file_zarr.h/c - Added zarr_read_timeseries() and zarr_read_timeseries_fileset() (reads per-timestep slices and extracts node value)
4. src/interface/x_interface.h/c - Added MouseClickCallback, x_set_mouse_click_callback(), x_show_timeseries(), ButtonPress event handler on image widget, init/cleanup calls for
timeseries popup
5. src/ushow.c - Added on_mouse_click() handler that converts pixel→regrid→node, dispatches to correct reader, builds TSData, shows popup. Registered in main()
6. Makefile - Added timeseries_popup.c to sources and dependency rules
Problem: When multiple files in a fileset have different time units (e.g., "seconds since 1850-01-01" in file 1, "seconds since 1851-01-01" in file 2), the raw time coordinate values were
concatenated without conversion. This made file 2's time=0 (meaning 1851-01-01) display as 1850-01-01 (file 0's epoch).
Fix: Added convert_time_units(value, src_units, dst_units) helper to both file_netcdf.c and file_zarr.c. It:
1. Parses both CF time unit strings to extract the epoch and unit scale
2. Converts the value to absolute seconds via the source epoch
3. Converts back to the destination (file 0) units
This is now applied in 4 places:
- netcdf_get_dim_info_fileset() — time step display labels
- netcdf_read_timeseries_fileset() — time series plot X axis
- zarr_get_dim_info_fileset() — zarr time step display labels
- zarr_read_timeseries_fileset() — already used zarr_get_dim_info_fileset which is now fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Files
Modified Files
Problem: When multiple files in a fileset have different time units (e.g., "seconds since 1850-01-01" in file 1, "seconds since 1851-01-01" in file 2), the raw time coordinate values were
concatenated without conversion. This made file 2's time=0 (meaning 1851-01-01) display as 1850-01-01 (file 0's epoch).
Fix: Added convert_time_units(value, src_units, dst_units) helper to both file_netcdf.c and file_zarr.c. It:
This is now applied in 4 places: