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

For reconstruction jobs, use an API to load the data instead of a pickle file. #6

Closed khider closed 5 months ago

khider commented 1 year ago

The load_proxy method for the class ReconJob requires a pickle file (which I'm guessing has fixed keys). Would like an alternative as was done for ProxyDatabase().from_df, specifying the columns. Example:

pdb = cfr.ProxyDatabase().from_df(df, pid_column='dsname', lat_column='lat', lon_column='lon', time_column='timeval', value_column='val', proxy_type_column='proxyobs', archive_type_column='archive', value_name_column='varname', value_unit_column='varunits')

fzhu2e commented 1 year ago

ReconJob.load_proxydb() calls ProxyDatabase().from_df() under the hood and those arguments can be specified directly in ReconJob.load_proxydb(path=..., pid_column='dsname', lat_column='lat', lon_column='lon', time_column='timeval', value_column='val', proxy_type_column='proxyobs', archive_type_column='archive', value_name_column='varname', value_unit_column='varunits').

It's basically a shortcut/wrapper to load from a pickle file that stores a DataFrame.