Skip to content

Instantly share code, notes, and snippets.

View lbesnard's full-sized avatar

lbesnard (Loz) lbesnard

View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Laurent Besnard
# Institute: IMOS / eMII
# email address: laurent.besnard@utas.edu.au
# Website: http://imos.org.au/ https://github.com/aodn/imos_user_code_library
# Aug 2014; Last revision: 26-August-2013
#
# Copyright 2014 IMOS
#/bin/bash !
# script to highlight an waht seems to be a bug in the netcdf library
# The script uses the ncdump program to hightlight this, however
# similar behaviour is seen with the netCDF4 python package
# author: laurent besnard,eMII/IMOS laurent.besnard@utas.edu.au 17/12/2015
main() {
local netcdf_path=imos-srs-prep/sst-test/modified-20121101032000-ABOM-L3S_GHRSST-SSTskin-AVHRR_D-1d_day-v02.0-fv02.0.nc
local opendap_url=http://rs-data1-mel.csiro.au/thredds/dodsC/$netcdf_path
@lbesnard
lbesnard / ramssa.py
Created February 3, 2016 00:43
for Chris Ackland - sst ramssa plot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Laurent Besnard
# Institute: IMOS / eMII
# email address: laurent.besnard@utas.edu.au
from netCDF4 import Dataset, num2date
from datetime import date
from numpy import meshgrid
@lbesnard
lbesnard / reconvert_thumb.py
Created March 9, 2017 01:19
auv thumbnail reconvertion (due to bad colors)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gzip
import os
import re
from urllib2 import urlopen
from functools import partial
from wand.image import Image
@lbesnard
lbesnard / A - ERDDAP docker - wave data.md
Last active November 26, 2018 23:57
Some quick doco on how to setup erddap container with waverider data for the AODN

Setup ERDDAP on docker

1) create the docker ERDDAP container

We create the docker container on the 8080 port using the config files setup.xml and datasets.xml (available for download in this gist to be copying in ~$HOME/tmp/erddap/directory)

Our docker container is called flamboyant_bassi

erddap_dir_docker=$HOME/tmp/erddap/directory
mkdir -p -v $erddap_dir_docker
sudo docker run -v $erddap_dir_docker:/usr/local/tomcat/content/erddap -d -p 8080:8080 --name=flamboyant_bassi axiom/docker-erddap
@lbesnard
lbesnard / aodn_s3_query_doi.py
Last active December 19, 2018 01:39
DOI user story: creating a list of files with specific VersionId to download a matching DOI dataset
import subprocess
import json
import tempfile
bucket_name = 'imos-data'
s3_prefix_url = 'http://imos-data.s3-website-ap-southeast-2.amazonaws.com/'
prefix = 'IMOS/SRS/Surface-Waves/Wave-Wind-Altimetry-DM00/'
cmd = 'aws s3api list-object-versions --no-sign --bucket {bucket_name} --prefix {prefix}'.format(bucket_name=bucket_name,
prefix=prefix)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lbesnard
lbesnard / AODN_WFS_Ex_XBT_Argo_Glider_data_access.ipynb
Last active April 27, 2021 07:12
760fe390f6697bc9bc058bf3f4d501e7
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lbesnard
lbesnard / AODN_WFS_Ex_SOOP_TRV_data_access.ipynb
Last active April 8, 2019 02:41
Access of SOOP TRV Near Realtime data using WMS/WFS capabilities from Geoserver
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lbesnard
lbesnard / Example_xarray_dask_mfdataset_FAIMMS.ipynb
Last active May 15, 2019 01:49
Accessing FAIMMS netcdf files from S3 via s3fs, using xarray and dask
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.