home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 1355733363

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1355733363 I_kwDOAMm_X85Qztlz 6968 Extracting annual amplitude and phase of xarray dataset for each pixel using xarray.DataArray.curvefit 1238713 closed 1     1 2022-08-30T12:59:17Z 2022-10-13T09:13:31Z 2022-10-13T09:13:31Z NONE      

What is your issue?

I was wondering how can I extract annual amplitude and phase of xarray time series using xarray.DataArray.curvefit. We fit a 1d function in time to return annual and seasonal amplitude and phase with dims (x, y)

We can use formula similar to https://stats.stackexchange.com/questions/77543/how-do-i-get-the-amplitude-and-phase-for-sine-wave-from-lm-summary but I have difficulty to extract a0,a1,a2 pixelwise for the dataset.I have tried also to convert time to julian day to use instead of ds.time in ds.curvefit but it didn't work. I really appreciate if you can help me. Similar problem with numpy is solved in https://stackoverflow.com/questions/15094619/fitting-a-3d-array-of-data-to-a-1d-function-with-numpy-or-scipy

ds = xr.tutorial.open_dataset('air_temperature') ds['air2'] = ds.air.copy() timejulian=ds.time.dt.strftime('%y%j') def timeseries_function_season(x, a0, a1, a2): return a0+(a1*np.cos((2*np.pi/365)*x)+a2*np.sin((2*np.pi/365)*x)) dn = ds.curvefit('time', func=timeseries_function_season)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6968/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.692ms · About: xarray-datasette