fzhu2e / cfr

A Python package for Climate Field Reconstruction
https://fzhu2e.github.io/cfr
BSD 3-Clause "New" or "Revised" License
13 stars 6 forks source link

Trying to annualize records in the PAGE2k database - Error 'year 0 is out of range' #5

Closed khider closed 5 months ago

khider commented 1 year ago

Code to reproduce:

pdb.annualize()

Using the example from: https://fzhu2e.github.io/cfr/notebooks/proxy-ops.html

fzhu2e commented 1 year ago

There are long records beyond year 0. The function utilizes datetime that doesn't support year 0. So we need to preprocess the database and truncate the time period to be starting from year 1. This can be achieved by calling ProxyDatabase.slice([1, 2000]).