Skip to content

Instantly share code, notes, and snippets.

View monkeybutter's full-sized avatar

Pablo Rozas-Larraondo monkeybutter

  • National Computational Infrastructure
  • Canberra
View GitHub Profile
package main
import (
"bufio"
"fmt"
"os"
"strings"
"sync"
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"net/http"
"net/url"
package main
import (
"fmt"
"unsafe"
)
func main() {
table := [2][2]uint8{{0, 1}, {2, 3}}
fmt.Printf("%T, %d\n", table, table)
import glob
import pandas as pd
df = pd.read_csv("/g/data1/ep1_2/z00/prl900/L8_AU_WGS84_A25/original_scene_list.csv")
print(len(df.index))
total_files = 0
size = 0.0
scenes = glob.glob(df['filepath'][1] + "/*")
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"sync"
# 1.- Band datasets don't have attributes
# 2.- Timestamp is missing from GDAL conversions
import h5py
import numpy as np
import argparse
def aggregator(location):
id = location.split("/")[-1]
with h5py.File(location + ".nc", 'w') as aggfile:
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"sync"
import os
import h5py
# Returns min_lat, min_lon, max_lat, max_lon from NetCDF file
def extent_extractor(path):
with h5py.File(path, 'r') as band:
geot = [float(x) for x in band["crs"].attrs["GeoTransform"].decode('UTF-8').split(", ")]
shape = band["Band2"].shape
import pandas as pd
#Scene list from AWS
df_aws = pd.read_csv("/Users/pablo/Desktop/scene_list (1)")
#Scene list from NCI
df_nci = pd.read_csv("/Users/pablo/Desktop/out.csv")
print(len(df_aws.index))
df_aws = df_aws.drop_duplicates()
print(len(df_aws.index))