This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*========================================================== | |
* solpos.c - NREL solar position calculator | |
* | |
* calculates solar position from location and time | |
* | |
* The calling syntax is: | |
* | |
* angles = solpos(location,datetime,weather) | |
* | |
* This is a MEX-file for MATLAB. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function, absolute_import | |
import warnings | |
import numpy as np | |
# Newton-Raphson method | |
def newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50, | |
fprime2=None, **kwargs): | |
if tol <= 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function, absolute_import | |
from math import sqrt, exp, sin, cos | |
import warnings | |
import numpy as np | |
# Newton-Raphson method | |
def scalar_newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50, | |
fprime2=None): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function, absolute_import | |
from math import exp, sin | |
from scipy.optimize.cython_optimize cimport zeros | |
NUM_OF_IRRAD = 10 | |
IL = [sin(il) + 6.0 for il in range(NUM_OF_IRRAD)] | |
# governing equations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Writing Fixed Length Strings to HDF5 file using HDF5DotNet | |
# http://hdf5.net/ | |
# * download HDF5 library and install first | |
# * add shared objects to PATH | |
# set PATH=%PATH%;C:\Program Files\HDF Group\HDF5\1.8.9\bin | |
# * download and extract HDF5DotNet assemblies | |
# * start IronPython (ipy64.exe), must be 64-bit version! | |
# help links: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tzwhere import tzwhere | |
from datetime import datetime | |
import pytz | |
# timezone lookup, force nearest tz for coords outside of polygons | |
WHERETZ = tzwhere.tzwhere(shapely=True, forceTZ=True) | |
# daylight savings time (DST) in northern hemisphere starts in March and ends | |
# in November and the opposite in southern hemisphere | |
JAN1 = datetime(2016, 1, 1) # date with standard time in northern hemisphere | |
JUN1 = datetime(2016, 6, 1) # date with standard time in southern hemisphere |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Determine last version string from tags. | |
Alternate to `Versioneer <https://pypi.python.org/pypi/versioneer/>`_ using | |
`Dulwich <https://pypi.python.org/pypi/dulwich>`_ to sort tags by time from | |
newest to oldest. | |
Copy the following into the package ``__init__.py`` module:: | |
from dulwich.contrib.release_robot import get_current_version | |
__version__ = get_current_version('..') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
from django.db import models | |
class HeaderField(models.CharField): | |
""" | |
Custom field class based on :class:`~django.db.models.CharField` that | |
creates a unique header from the header, data source and site coordinates. | |
""" | |
def pre_save(self, model_instance, add): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define macros | |
SOLPOSAM = libsolposAM.dylib | |
SOLPOSAM_LIB = solposAM | |
SPECTRL2 = libspectrl2.dylib | |
SPECTEST = spectest | |
STEST00 = stest00 | |
SRC_DIR = src | |
BUILD_DIR = build |