html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/577#issuecomment-455104534,https://api.github.com/repos/pydata/xarray/issues/577,455104534,MDEyOklzc3VlQ29tbWVudDQ1NTEwNDUzNA==,10194086,2019-01-17T09:34:37Z,2019-01-17T09:34:56Z,MEMBER,"I don't think `.roll` actually handles this, as wrapping changes the coordinate values. But as xarray does not support domain-specific functions it's good to close this.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,106595746 https://github.com/pydata/xarray/issues/577#issuecomment-454535041,https://api.github.com/repos/pydata/xarray/issues/577,454535041,MDEyOklzc3VlQ29tbWVudDQ1NDUzNTA0MQ==,5635139,2019-01-15T20:15:01Z,2019-01-15T20:15:01Z,MEMBER,"Closing as stale, please reopen if still relevant (Does `.roll` do this now?)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,106595746 https://github.com/pydata/xarray/issues/577#issuecomment-140465411,https://api.github.com/repos/pydata/xarray/issues/577,140465411,MDEyOklzc3VlQ29tbWVudDE0MDQ2NTQxMQ==,1217238,2015-09-15T17:07:56Z,2015-09-15T17:07:56Z,MEMBER,"Yes, this is similar to how I've done this in the past. Your function works fine, but I would probably use `ds = ds.assign(**{lon: mod(ds[lon], 360})` to avoid modifying the existing coordinates in-place. Also, it would be nice if we supported `ds.sort_index(lon)` instead of requiring an explicit reindex. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,106595746 https://github.com/pydata/xarray/issues/577#issuecomment-140457546,https://api.github.com/repos/pydata/xarray/issues/577,140457546,MDEyOklzc3VlQ29tbWVudDE0MDQ1NzU0Ng==,10194086,2015-09-15T16:40:53Z,2015-09-15T16:40:53Z,MEMBER,"I found a way, leaving this here for reference. Or is there something better? ``` def wrap360(ds, lon='lon'): """""" wrap longitude coordinates to 0..360 Parameters ---------- ds : Dataset object with longitude coordinates lon : string name of the longitude ('lon', 'longitude', ...) Returns ------- wrapped : Dataset Another dataset array wrapped around. """""" # wrap -180..179 to 0..359 ds.coords[lon] = np.mod(ds[lon], 360) # sort the data return ds.reindex({ lon : np.sort(ds[lon])}) ``` ","{""total_count"": 2, ""+1"": 2, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,106595746