Skip to content

Instantly share code, notes, and snippets.

View prl900's full-sized avatar

Pablo Rozas Larraondo prl900

View GitHub Profile
@prl900
prl900 / tiling.go
Last active October 23, 2017 20:58
package main
import (
"fmt"
)
type Array struct {
Data []byte
Shape []int
Offset []int
import numpy as np
from osgeo import gdal
from PIL import Image
import netCDF4
import json
import os
import sys
import datetime
import argparse
import time
@prl900
prl900 / S3_cloud_free.go
Created September 14, 2017 21:03
AWS Go SDK example
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
@prl900
prl900 / stringer_pipeline.go
Created September 12, 2017 10:15
Example of a Go pipeline
package main
import (
"fmt"
)
type Stringer struct {
In chan *string
Out chan *string
Error chan error
@prl900
prl900 / geo.md
Last active September 5, 2017 21:32

G^e^o

@prl900
prl900 / go2_feature.md
Last active August 27, 2019 11:11
Go 2 proposal idea

Go 2: Model for distributed systems

Go has a very nice concurrency model which is based on light goroutines which can communicate through channels. This model provides a great abstraction which facilitates the design and synchronisation of concurrent processes. Go programs can naturally scale and fully utilise the resources on a machine.

However, there are some cases where a single machine, even the most powerful in the market, is not enough to solve certain problems. The required work in these cases, can be splitted and distributed between different nodes which can work colaboratively to compute the result. Go's concurrency model is intended to solve communication between goroutines within a single process but, as it is implemented now, it cannot be used for communicating between processes or nodes.

There have been attemps to extend the concept of channels to communicate with external goroutines, such as netchans. The Go team worked actively in the design and implementation of this concept but unfortu

package main
import (
"fmt"
"github.com/golang/geo/s2"
)
func main() {
// Definition of LatLng slice

Experiment 1

  • Output: metar_wind_spd

  • Input: [gfs_wind_spd, gfs_wind_dir, gfs_temp, time]

Airport Method 1000 500 250 100 50
EDDT Linear 0.6954 0.7079 0.7149 0.7184 0.7165
Lund 0.7000 0.7137 0.7208 0.7169 0.7065
Circular 0.7000 0.7129 0.7175 0.7193 0.7164
@prl900
prl900 / results.md
Last active July 17, 2017 01:16
Cross validation results for the circular tree paper

Experiment 1

  • Output: metar_wind_spd

  • Input: [gfs_wind_spd, gfs_wind_dir, gfs_temp, time]

Airport Method 1000 500 250 100 50
EDDT Linear 1.3006 1.2544 1.2246 1.2096 1.2230
Lund 1.2870 1.2310 1.2002 1.2172 1.2616
Circular 1.2870 1.2357 1.2155 1.2094 1.2205
import argparse
import datetime
import functools
import glob
import json
import netCDF4
import numpy as np
import os.path