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
#include "Foo.hpp" | |
#include <iostream> | |
using namespace std; | |
Foo::Foo(int _a, int _b): a(_a), b(_b){ | |
cout << "C++ side, constructor" << endl; | |
} | |
Foo::~Foo(){ |
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 netCDF4 as nc | |
import ocgis as ESMF | |
import numpy as np | |
from ocgis.vmachine.mpi import rank_print | |
NTIMESTEPS = 3 | |
NELEMPERPET = 4 | |
IO_TAG = 111 |
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 ocgis | |
from ocgis.test.base import create_gridxy_global, create_exact_field | |
# Path to the input ESRI Shapefile. | |
# PATH_SHP = '/home/benkoziol/l/data/bekozi-work/i53-jh-camel-watersheds/basin_set_full_res/HCDN_nhru_final_671.shp' | |
PATH_SHP = '/gcs/camels/basin_dataset_public_v1p2/shapefiles/merge/basinset_gf_nhru.shp' | |
# Path to example exact data for testing. | |
DATA_PATH = 'camels_source.nc' |
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 | |
## | |
## Simple logging mechanism for Bash | |
## | |
## Author: Michael Wayne Goodman <goodman.m.w@gmail.com> | |
## Thanks: Jul for the idea to add a datestring. See: | |
## http://www.goodmami.org/2011/07/simple-logging-in-bash-scripts/#comment-5854 | |
## Thanks: @gffhcks for noting that inf() and debug() should be swapped, | |
## and that critical() used $2 instead of $1 |
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
from shapely.geometry import Point | |
import ocgis | |
path = '/path/to/data.nc' | |
lat_variable = 'XLAT' | |
lon_variable = 'XLONG' | |
lat_dimension = 'south_north' | |
lon_dimension = 'west_east' |
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 numpy | |
def get_masked_arr(arr, fill_val): | |
''' | |
If a masked array is passed, this function does nothing. | |
If a filled array is passed (fill_value must be passed also), it will be transformed into a masked array. | |
''' | |
if isinstance(arr, numpy.ma.MaskedArray): # numpy.ma.MaskedArray |