-
Notifications
You must be signed in to change notification settings - Fork 97
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
Preparation of v0.2 #20
Conversation
@euronion : Do you have time to test whether this branch works for you? The easiest invocation to get a cutout for wind generation covering germany now is something along the lines of: germanshapefile = ...
cutout = atlite.Cutout("<cutoutname>", bounds=germanshapefile.buffer(0.2).bounds, time="2012", module="era5")
cutout.prepare(["wind"]) This generates a The previously used wind generation function |
I'd love to, but I can't spare sufficient ressource on it at the moment. I would also
And do I would at the same time work on an
including
I really hope you can wait that long :) |
@euronion We're not under any particular time pressure right now. I'd like to merge this around mid-July. Would be great if you can integrate your changes. I think it would be ideal to work on pull requests against this branch! |
@coroa Yes o/c only PR against this branch. Mid of July sounds good. |
Atlite in the current version |
Hi @coroa , |
Cross-checking: In any case think best practice is to include the Python versino into the
|
Semi-intended. I don't want to miss out on f-strings anymore, and even Debian stable these days already ships with python 3.7 so a requirement for 3.6 seems fair to me. Is there any reason to have a python 3.5 or lower? Making the requirement explicit in |
Mainly just asking.
|
The |
Omitting it, is equivalent to the argument windows = xr.core.groupby.DatasetGroupBy(self.data, self.data['time'], grouper=pd.Grouper(freq="M"))._iter_grouped() over which the Other allowed strings are This grouping mechanism can be switched off using for feature in cutout.dataset_module.features["wind"]:
cutout.data[feature].load() and convert it in one go cutout.wind(turbine=..., windows=False) What needs to be investigated a bit further is the possibility to use dask automatically for the heavy lifting: |
What the Preloading features has become really easy and convinient with the change. As a universal and really simple solution for the
I doubt we will find a better universal solution for the E.g.: |
The |
I'd be open to throwing it out in a separate PR in which we transition everything to The bottleneck will be the conversion of the pv module. When I originally tried to implement it using |
No, let's have the Not knowing what went wrong back then with |
utlis.py add class arrowdict
* solve #55 * fixup
* ci: use mamba instead of conda * follow up, add comment [skip travis] * follow up * follow up, fix conda activate * ci: playaround, remove conda specifications
* irradiation.py: replace .clip by .where due to new numpy/dask incompatibility * follow up, only apply .where where necessary
* enable ci on windows * data.py: use TemporaryDirectory instead of mkdtemp * data.py revert last commit, try now with wrapper * fix travis env for windows machines * follow up: write pip and pytest dependencies in env file * env: add libspatialindex to requirements * travis: reintroduce strict channel order due to installation problems on windows
* introduce Cutout.grid make Cutout.grid_cells and Cutout.grid_coordinates deprecated * follow up * adjust plotting example * update release notes * test_creation.py adjust test * test: tiny fix up * add crs to Cutout.grid * follow up: add comment [skip travis] * release notes: fix typo [skip travis]
* Rename projection to crs Follows pyproj in nomenclature. See https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1 . * environment: Remove channel pinning Channel pinning has been superseed by strict channel_priority as proposed at https://conda-forge.org/docs/user/tipsandtricks.html. * gis: Add grid_cell_areas function to compute areas of grid cells * cutout: Fix forgotten conversion * gis: Improve grid_cell_areas * remove area calculation due to geopandas implementation * update release notes * gis.py: revise imports Co-authored-by: Fabian <[email protected]>
* gebco: Extract and resample data from GEBCO using rasterio * tiny fixup of inversed y-axis and data array accessing * fix numeric tags Co-authored-by: Fabian <[email protected]>
* * add warning for ignoring cutoutparams if cutout already exists * reintroduce Cutout.prepared * follow up
cutout.py make prepared features more secure
* cutout.py add merge function pytest add merge test * cutout.py: when data is passed and path is non-existent, write out file path in cutout.merge and cutout.sel has to be non-existent * adjust docstrings * revert second last commit, add cutou.to_file function * revert unneeded assert * follow up: update docstrings [skip travis]
solar_position.py: saver/cleaner approach for chunking
* convert.py catch case of no layout given * convert.py: restructure convert_and_aggregate for correctly handling all input combinations * test: pv add rounding to assert
finally :) |
The first official version of atlite is getting closer and there is a bunch of good stuff coming.
Changes
The main change is that a cutout corresponds to a single netcdf file for the whole cutout period, which is fully accessible as a xarray at
cutout.data
.This makes it possible to iterate over the data in customizable slices:
cutout.wind(shapes=countries, turbine="Vestas_V90_3MW")
uses months as in the previous version, while f.ex.cutout.wind(..., windows='Y')
uses years.windows
can be anything thatpd.Grouper
understands, ie. 'D', 'M', 'Y' or even '2D'.windows = False
makes it possible to apply the conversion function to the data as a whole. It should also be possible to choose windows compatible with a particular time zone to avoid the re-averaging that was necessary forheat_demand
.The data for cutouts is now grouped into different
features
(from the ERA-5 dataset):It's possible to prepare a cutout only for a subset of the available features:
cutout.prepare(['runoff', 'wind'])
. One can always extend the cutout by runningprepare
again.One can load a cutout fully into memory using
cutout.data.load()
(orcutout.data.wnd100m.load()
,cutout.data.roughness.load()
for wind only), which should fully supersede @euronion 's caching from Introduce dataset caching and outsource wind speed extrapolation #9 .It's easy to get a subset of a cutout using
.sel
directly induced by atlite'ssel
function:cutout.sel(time="2012-01")
orcutout.sel(time="2012-07", bounds=german_shape.bounds)
Open questions
config.py
has been completely removed instead one has to provide the necessary paths explicitly when creating new cutouts. In addition we could allow reading in a config file like~/.atlite.config
or some such?Remaining TODOS
documentation
branch)documentation
branch)documentation
branchI'm happy about everyone, who wants to test the new version, provide feedback or help with documentation or the remaining todos! @leonsn @nworbmot @FabianHofmann @schlott @fneum