Skip to content

(2) Doing Stratigraphy with NAYS2DH Outputs

salpheus edited this page Aug 18, 2022 · 1 revision

This repository comprises the codes Safiya uses to perform analyses of NAYS2DH model runs. This is my dictatorship so I have written it to be run with data organised in a very specific way. Please see Organisation section to find out how to organise your data for use with the BarCode and its components.

There are a couple of codes in here to support different types of analyses, some of them work in series, some can work in parallel. Idk what else I should write here, so peace out for now.

-SA, 17 Aug 2022


Data Wrangling

Handling outputs from NAYS2DH

I've found that the most efficient way to output and store raw model outputs from NAYS2DH is using the programs csv output. These outputs are structured as follows:

I J X Y ...output variables...
1 1 1 * grid cell length 1 * grid cell width ...outputs...
2 1 2 * grid cell length 1 * grid cell width ...outputs...
... ... ... ... ...outputs...
m 1 m * grid cell length 1 * grid cell width ...outputs...

i.e. data is organised in the streamwise direction, cycling through each all m positions for each n position (where the grid has dimensions m x n, m is downstream or i-direction, and n is the cross-stream or j-direction. X and Y represent the true locations of the grid cells in metre space, i & j are the cellular co-ordinates. Does that make sense?

You can choose the time interval desired for your output it doesn't matter. Store all of your output csv in the same folder, and I name them all with the same standard name (Result_'number') and a numeric index, this can be 1, 2, 3, 4... or whatever, it just needs to be unique and allow python to iterate through all of the csvs in the folder.

Once you have your outputs in this form you should be ready to do the first routine in the BarCode ConvertFiles.ipynb


Converting Files with ConvertFiles.ipynb

As the name suggests, ConvertFiles will convert all of your csv outputs to one numpy array with the same structure as the csvs, with time on the 3rd dimension (axis = 2).

After having converted your files you can move on to building the stratigraphy and using the MegaStratBuilder. For details on how the MegaStratBuilder works go here

Clone this wiki locally