Skip to content

FCI L1C reader overwrites units attribute on time metadata, making the data hard to interpret #3349

@gerritholl

Description

@gerritholl

Describe the bug

When loading time data with the FCI L1C NC reader, such as vis_06_time, the time attribute says s. In the original NetCDF files, it says seconds since 2000-01-01 00:00:00.0. Without looking at the original file, the user cannot interpret the float data in vis_06_time.

To Reproduce

import netCDF4
import hdf5plugin
from satpy import Scene
sc = Scene(filenames={"fci_l1c_nc": ["/media/nas/x23352/MTG/FCI/L1c-cases/202601051630/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--DIS-NC4E_C_EUMT_20260105164035_IDPFI_OPE_20260105163819_20260105163855_N_JLS_O_0100_0036.nc"]})
sc.load(["vis_06_time"])
print(sc["vis_06_time"].attrs["units"])

nc = netCDF4.Dataset("/media/nas/x23352/MTG/FCI/L1c-cases/202601051630/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--DIS-NC4E_C_EUMT_20260105164035_IDPFI_OPE_20260105163819_20260105163855_N_JLS_O_0100_0036.nc")
print(nc["time"].units)

Expected behavior

I expect the units are the same:

seconds since 2000-01-01 00:00:00.0
seconds since 2000-01-01 00:00:00.0

Actual results

Satpy turns it into s:

s
seconds since 2000-01-01 00:00:00.0

Environment Info:

  • Satpy Version: v0.60.0

Additional context

I guess this happens because s is explicitly set as a unit in the YAML config:

I have not tested what happens if this field is removed or changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions