Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create time_bnds for output netCDF files #74

Closed
huard opened this issue Oct 22, 2018 · 10 comments
Closed

Create time_bnds for output netCDF files #74

huard opened this issue Oct 22, 2018 · 10 comments
Labels
enhancement New feature or request

Comments

@huard
Copy link
Collaborator

huard commented Oct 22, 2018

Description

Compute time_bnds and attach them to output.

Can probably be done using OCGIS, also see pydata/xarray#2481 for xarray functionality that could help go into this direction.

@tlogan2000
Copy link
Collaborator

This could be potentially solved by resampling the ds.time with the same frequency as the indicator and exratcing min / max

@tlogan2000
Copy link
Collaborator

@huard here is the bit of code that I was talking about (I used it when making mf-datasets filenames but it could maybe serve for the time bounds as well)

freq = 'YS'
timestamps = ds.time.resample(time=freq)

for n, i in enumerate(zip(timestamps.min(),timestamps.max())):
    print('year', n, 'start', i[0], '\nyear',n,'end', i[1], '\n\n')
    

@huard huard modified the milestones: v1.0, xclim Long Term Goals Aug 21, 2019
@Zeitsperre
Copy link
Collaborator

With the merge of #164 I'm pushing this up to v0.15. Work for you, @huard?

@huard
Copy link
Collaborator Author

huard commented Feb 13, 2020

Sure. Want to include the PR for the doc refactoring in it or not ?

@Zeitsperre
Copy link
Collaborator

If it's feasible, why not? I need to speak with @aulemahal to see if there's anything that I can help with with regards to that PR.

@Zeitsperre Zeitsperre modified the milestones: v0.15, v0.16 Feb 24, 2020
@aulemahal
Copy link
Collaborator

@huard Is this a priority? It could be done for 0.15 or we wait for the CRIM's suggestion for the refactoring and then we implement this?

@huard
Copy link
Collaborator Author

huard commented Mar 10, 2020

@aulemahal No, this is a bonus feature.

@huard
Copy link
Collaborator Author

huard commented Apr 17, 2020

We can't add a coordinate with a new dimension (nbnd) to a DataArray. This would only work on a dataset. What do we do with this ?

@huard huard mentioned this issue Apr 17, 2020
6 tasks
@huard
Copy link
Collaborator Author

huard commented Apr 21, 2020

aulemahal added a commit that referenced this issue Nov 15, 2022
<!--Please ensure the PR fulfills the following requirements! -->
<!-- If this is your first PR, make sure to add your details to the
AUTHORS.rst! -->
### Pull Request Checklist:
- [x] This PR addresses an already opened issue (for bug fixes /
features)
- This PR fixes one need of #74, but it doesn't add it to the outputs.
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [x] HISTORY.rst has been updated (with summary of main changes)
- [x] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added
- [x] The relevant author information has been added to `AUTHORS.rst`
and `.zenodo.json`

### What kind of change does this PR introduce?

* Refactor of `time_bnds`, I think it is not better!

### Does this PR introduce a breaking change?
Results from `time_bnds` will change.

### Other information:
Old work that I finally had time to clean because of the slow VPN.
@Zeitsperre
Copy link
Collaborator

Closed with #1207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants