Skip to content

tips and tricks: export in a way compatible with thredds servers #99

Description

@jerabaul29

Looks like thredds servers do not accept int64 variables :( . I got an error message, and this seems similar to: https://stackoverflow.com/questions/48895227/output-int32-time-dimension-in-netcdf-using-xarray .

To generate files that are compatible with thredds server, and be able to upload files to e.g. adc.met.no that is hosted on thredds, one needs to make the time variables 32 bit ints (which is ok if "seconds since" and the deployment time is not many 10s of years).

This can be done by exporting as the following for now (may need to expand to more time variables if there are more included in the future):

ds.to_netcdf("./SOME_FILENAME.nc", encoding={'time': {'dtype': 'i4'}, 'time_waves_imu': {'dtype': 'i4'}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions