Skip to content

cellstacking if data is only 2 dimensional (e.g. time, depth) #64

Description

@florianboergel

This must be verified, but I encountered problems when analyzing stational data with a depth dimension. I had to adjust the code like this to make it work

For example, in threshold()

    if point:
        ds["thresh"] = thresh_results[0]
        ds["seas"] = seas_results[0]
    else:
        ds["thresh"] = xr.concat(results[0], dim='cell')
        ds["seas"] = xr.concat(results[1], dim='cell')
        dims = [k for k in ts.cell.coords.keys()]
        if len(dims) == 1: # This would be equal to time and another dimension
            ds = ds.swap_dims({"cell":dims[0]})
            ds = ds.transpose("doy", dims[0])
        else:
            ds = ds.set_xindex(dims)
            ds = ds.unstack(dim='cell')

The same applies to the detect() function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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