Skip to contents

This function is a wrapper for system calls to NCO functions. A single SINMOD netcdf file contains a large grid covering the Arctic with extra variables we don't need. This function crops the spatial extent, performs a weighted average across depth layers, and limits to variables `u_east` and `v_north`.

Usage

reshape_SINMOD(path, file, out_dir, window)

Arguments

path

a character string directing to the source file location.

file

the name of a netcdf file to process.

out_dir

a character string directing to the folder the new files should be written to.

window

a named list containing `xmin`, `xmax`, `ymin`, `ymax`, the indices of the window to crop to.

Value

A netcdf file containing depth averaged UV water velocities cropped to the target window.

Details

Performing the reshaping directly on the netcdf files means I can host a small subset locally on my machine. This avoids costly queries to the idrive later on. These files can also then be concatenated into a single netcdf file, allowing data to be read into R pixel by pixel, unlike saving a clipped dataframe as a .rds object.

See also