Skip to content

patch.coords.step("time") returns None #509

@ahmadtourei

Description

@ahmadtourei

Description

The example throws an error for some of the chunked patches. The issue disappears when chunking is disabled (and only using select on the spool).

Example

import dascore as dc

data_path = "path/to/data" # Terra15 data in velocity
sp = dc.spool(data_path).update()

T_1 = "2022-06-25 00:00:00"
T_2 = "2022-06-26 00:00:00"
sub_sp_time = sp.select(time=(T_1, T_2))

sub_sp_chunked = sub_sp_time.sort("time").chunk(time=2, overlap=1)

for patch in sub_sp_chunked:
    time_step = patch.coords.step("time")
    if time_step is None:
        raise ValueError("time_step is None for this patch!")

Here is an example of a chunked patch with time_step returned None:

DASCore Patch---------------Coordinates (time: 4001, distance: 276)
    *time: CoordMonotonicArray( min: 2022-06-25T01:08:45.983509853 max: 2022-06-25T01:08:47.982493992 shape: (4001,) dtype: datetime64[ns] units: s )
    *distance: CoordRange( min: 2.07e+03 max: 3.64e+03 step: 5.72 shape: (276,) dtype: float64 units: m )
➤ Data (float32, units: 1.0 m / s)
   [[-5.535e-05 -5.720e-05 -5.440e-05 ...  8.766e-04  8.848e-04  8.472e-04]
    [-3.164e-04 -3.124e-04 -3.204e-04 ...  5.752e-04  6.105e-04  5.983e-04]
    [-4.037e-05 -3.120e-05 -2.086e-05 ...  7.733e-04  8.078e-04  8.435e-04]
    ...
    [ 1.527e-03  1.529e-03  1.544e-03 ...  2.365e-03  2.384e-03  2.406e-03]
    [ 1.693e-03  1.686e-03  1.689e-03 ...  2.475e-03  2.483e-03  2.541e-03]
    [ 9.161e-05  1.019e-04  1.076e-04 ...  8.835e-04  9.173e-04  9.852e-04]]
➤ Attributes
    data_type: velocity
    data_units: m / s
    instrument_id: TrebleIISystem04
    pulse_rate: 4.24e+03
    pulse_length: 5.72
    gauge_length: 5.72

Expected behavior

Versions

  • OS [e.g. Ubuntu 20.04]:
  • DASCore Version [e.g. 0.0.5]:
  • Python Version [e.g. 3.10]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions