using DimensionalData
using GeoData# Functions to be extended
"""
    gridcoordinates(::Gridtype,x)| using NetCDF, YAXArrays | |
| import DiskArrayEngine as DAE | |
| ds = open_dataset("/Net/Groups/BGI/data/DataStructureMDI/DATA/Incoming/ESACCI/LC/v2_1_1/orgdata/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1.nc") | |
| lc = ds.lccs_class | |
| c = YAXArrays.counter(lc) | |
| using Distributed | |
| addprocs(16) | 
| import DiskArrays: AbstractDiskArray, DiskArrays, Unchunked, Chunked, GridChunks | |
| struct SimpleFileDiskArray{C<:Union{Int,Nothing}} <: AbstractDiskArray{UInt8,1} | |
| file::String | |
| s::Int | |
| chunksize::C | |
| end | |
| Base.size(s::SimpleFileDiskArray) = (s.s,) | |
| function SimpleFileDiskArray(filename;chunksize=nothing) | |
| isfile(filename) || throw(ArgumentError("File $filename does not exist")) | 
| using Dagger | |
| struct PartialShard | |
| chunks::Dict{Dagger.Processor,Tuple{Dagger.Chunk,Dagger.Chunk}} | |
| end | |
| function partialshard(@nospecialize(f); procs=nothing, workers=nothing, per_thread=false) | |
| if procs === nothing | 
| import Interpolations | |
| import Dierckx | |
| function interpolate_data(tsteps_old, tsteps_new, y, options) | |
| # Apply interpolation according to the options | |
| y_interp = if options.interpolation_method == "Dierckx" | |
| if options.boundary_condition == "flat" | |
| s = Dierckx.Spline1D(tsteps_old,y,bc="nearest") | |
| s(tsteps_new) | 
| module SphericalHarmonics | |
| using FastTransforms | |
| import Geodesy: LLA,distance | |
| immutable PLM{T} | |
| coefs::Matrix{T} | |
| end | |
| function lm2ij(l,m) | |
| l<0 && throw(BoundsError("l must be positive")) | 
using DimensionalData
using GeoData# Functions to be extended
"""
    gridcoordinates(::Gridtype,x)| import Tokenize.Tokens: IDENTIFIER, LSQUARE, COMMA, RSQUARE, STRING, ENDMARKER | |
| function parsetokens(t,ar) | |
| if t[1].kind==Tokenize.Tokens.IDENTIFIER | |
| @assert t[2].kind==LSQUARE | |
| brackcount=1 | |
| i=3 | |
| while true | |
| t[i].kind==LSQUARE && (brackcount=brackcount+1) | |
| t[i].kind==RSQUARE && (brackcount=brackcount-1) | |
| brackcount==0 && break | 
| FROM jupyter/datascience-notebook:eb149a8c333a | |
| MAINTAINER [email protected] | |
| LABEL version='0.6.1' | |
| USER root | |
| RUN sudo apt-get update && sudo apt-get upgrade -y | |
| RUN sudo apt-get install -y git unzip apt-utils vim | |
| ADD start.sh /usr/local/bin/start.sh | 
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "import numpy as np\n", | |
| "import numpy.fft as fft\n", |