Skip to content

Commit

Permalink
Merge pull request #181 from NREL/gb/bias_nc
Browse files Browse the repository at this point in the history
Gb/bias nc
  • Loading branch information
grantbuster committed Dec 18, 2023
2 parents 62c3c44 + 90e44b6 commit 6d0f100
Show file tree
Hide file tree
Showing 18 changed files with 674 additions and 377 deletions.
6 changes: 4 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
'sphinx_click.ext',
"sphinx_tabs.tabs",
"sphinx_copybutton",
]

intersphinx_mapping = {
Expand All @@ -81,7 +83,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -140,7 +142,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'rexdoc'
htmlhelp_basename = 'sup3rdoc'

# -- Options for LaTeX output ------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion sup3r/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"""Super Resolving Renewable Energy Resource Data (SUP3R)"""
import os
from sup3r.version import __version__
import sup3r.cli # import sets up CLI commands
# Next import sets up CLI commands
# This line could be "import sup3r.cli" but that breaks sphinx as of 12/11/2023
from sup3r.cli import main

__author__ = """Brandon Benton"""
__email__ = "[email protected]"
Expand Down
3 changes: 2 additions & 1 deletion sup3r/bias/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"""Bias calculation and correction modules."""
from .bias_transforms import (global_linear_bc, local_linear_bc,
monthly_local_linear_bc)
from .bias_calc import LinearCorrection, MonthlyLinearCorrection
from .bias_calc import (LinearCorrection, MonthlyLinearCorrection,
SkillAssessment)
355 changes: 250 additions & 105 deletions sup3r/bias/bias_calc.py

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion sup3r/bias/bias_correct_means.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import numpy as np
import pandas as pd
import rioxarray
import xarray as xr
from rex import Resource
from scipy.interpolate import interp1d
Expand Down Expand Up @@ -116,6 +115,11 @@ def convert_month_height_tif(self, month, height):
os.remove(outfile)

if not os.path.exists(outfile) or self.overwrite:
try:
import rioxarray
except ImportError as e:
msg = 'Need special installation of "rioxarray" to run this!'
raise ImportError(msg) from e
tmp = rioxarray.open_rasterio(infile)
ds = tmp.to_dataset("band")
ds = ds.rename(
Expand Down

0 comments on commit 6d0f100

Please sign in to comment.