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
import seaborn | |
def light_response(light, EC50, hillslop=2.5): | |
'''Typical response function for EC50 tests''' | |
import numpy | |
# http://www.sigmaplot.co.uk/splot/products/sigmaplot/productuses/prod-uses43.php | |
# Response to concentration | |
dose_min = light.min() | |
dose_max = light.max() |
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
def lip2dens(p_lipid, lipid_dens=0.9007, prot_dens=1.34, water_dens=0.994, a_dens=2.3): | |
'''Derive tissue density from lipids | |
Translated to python from R code written by Martin Biuw | |
''' | |
p_comps = perc_bc_from_lipid(p_lipid) | |
p_comps['density'] = (lipid_dens * (0.01 * p_comps['perc_lipid'])) + \ |
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
def calc_mod_density(mass_kg, dens_kgm3, n_blocks, block_type): | |
'''Calculate the modified density with attached blocks | |
Args | |
---- | |
mass_kg: float | |
mass of the seal (kg) | |
dens_kgm3: float | |
mass of the seal (kg/m^3) | |
block_type: str |
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
''' | |
A Package for retrieving Kartverket image data for specified areas. | |
Exampl URLs | |
----------- | |
GetCapabilities: | |
http://opencache.statkart.no/gatekeeper/gk/gk.open?Version=1.0.0&service=wms&request=getcapabilities | |
NOAA (not active/testable): | |
http://porter.pmel.noaa.gov:8922/wms/wms_servlet?VERSION=1.1.1&REQUEST=GetMap&LAYERS=coads_climatology_cdf:airt&STYLES=ferret_default&WIDTH=640&HEIGHT=320&FORMAT=image/png&SRS=EPSG:4326&BBOX=-180.0,-90.0,180.0,90.0&EXCEPTION=application/vnd.ogc.se_xml&DIM_COADS_CLIMATOLOGY_CDF_TIME=15-Jan |
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
def perc_bc_from_lipid(perc_lipid, perc_water=None): | |
'''Calculate body composition component percentages based on % lipid | |
Calculation of percent protein and percent ash are based on those presented | |
in Reilly and Fedak (1990). | |
Args | |
---- | |
perc_lipid: ndarray | |
1D array of percent lipid values from which to calculate body composition |
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
# Install the aws cli | |
source your-venv/bin/activate | |
pip install awscli | |
# Setup your credentials | |
aws configure | |
# Check out what is going to get transfered first | |
aws s3 sync ./path/to/data s3://bucket-name --exclude "*" --include "*.nc" --dryrun |
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
""" | |
Load test MLFlow logging to AzureML Workspace (as a tracking backend) | |
Warning: Azure charges apply! | |
The following environment variables must be set: | |
* SUBSCRIPTION_ID - The Azure Subscription ID the Workspace is created under | |
* RESOURCE_GROUP - The Azure ResourceGroup ID the Workspace is created under | |
* WORKSPACE_NAME - The name of the AzureML Worskpace to log to | |
""" |
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
# Functions that push and pull to a singleton working directory...a bare-bones pushd/popd. | |
# For namespace clartiy, Norwegian words were use: skyv (push) and trekk (pull). | |
# Adapted from here https://stackoverflow.com/a/9916812 | |
directory_stack=$HOME/.directory_singleton | |
function skyv() { | |
# Save only one skyv path, overwriting the last | |
echo $(pwd) > $directory_stack | |
} |
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
[build-system] | |
requires = ["setuptools", "setuptools-scm"] | |
build-backend = "setuptools.build_meta" | |
[project] | |
name = "pytest-myplugin" | |
description = "My pytest plugin" | |
readme = "README.rst" | |
requires-python = ">=3.5" | |
license = {text = "MIT"} |
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
#!/bin/bash | |
usage () { | |
cat <<HELP_USAGE | |
$0 <area> <outputs-path> | |
outputs-path: directory weather grib and radar gif should be saved | |
area: weather area to collect for, try "n-northsea" or "west_norway". For | |
more options see https://api.met.no/weatherapi/gribfiles/1.1/available |
OlderNewer