pvdeg.geospatial.output_template#

pvdeg.geospatial.output_template(ds_gids: Dataset, shapes: dict, attrs={}, global_attrs={}, add_dims={})[source]#

Generate xarray template for output data.

Output variables and associated dimensions need to be specified via the shapes dictionary. The dimension length are derived from the input data. Additonal output dimensions can be defined with the add_dims argument.

Examples

Providing the shapes dictionary can be confusing. Here is what the shapes dictionary should look like for pvdeg.standards.standoff. Refer to the docstring, the function will have one result per location so the only dimension for each return value is “gid”, a geospatial ID number.

Note: The dimensions are stored in a tuple, this this why all of the parenthesis have commas after the single string, otherwise python will interpret the value as a string.

This is what the shapes dictinoary should look like for pvdeg.humidity.module. Refering to the docstring, we can see that the function will return a timeseries result for each location. This means we need dimensions of “gid” and “time”.

Parameters:
  • ds_gids (xarray.Dataset) – Dataset containing the gids and their associated dimensions. Dataset should already be chunked.

  • shapes (dict) – Dictionary of variable names and their associated dimensions.

  • attr (dict) – Dictionary of attributes for each variable (e.g. units).

  • add_dims (dict) – Dictionary of dimensions to add to the output template.

Returns:

output_template (xarray.Dataset) – Template for output data.