Skip to content

Generate lat/lon variable for wave spectra #135

Description

@hevgyrt

Comparing observed and modeled wave spectra, it would be convenient to have the lat/lon variables on the spectra.

The way I do it now is to find the obs indexes closest to the time_waves_imu values like

obs_ids = []
for i in range(subset.obs_waves_imu.size):
    if np.isfinite(subset.time_waves_imu.values[i]):
        diff = np.abs(subset.time.values-subset.time_waves_imu.values[i])
        obs_ids.append(np.argmin(diff[np.isfinite(diff)]))

Is there a method already taking care of this? Or could you simply add two variables called lon_waves, lat_waves

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