-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from obriengareth/devito
adding readme for devito
- Loading branch information
Showing
12 changed files
with
4,608 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "64dd203c", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"libraries loaded \n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# loading libraries needed to run initial file generation\n", | ||
"\n", | ||
"import time\n", | ||
"import numpy as np\n", | ||
"import pandas as pd\n", | ||
"import zarr\n", | ||
"import os\n", | ||
"import sys\n", | ||
"\n", | ||
"import pylops\n", | ||
"from pylops.utils.wavelets import ricker\n", | ||
"%matplotlib notebook\n", | ||
"import matplotlib . pyplot as plt\n", | ||
"\n", | ||
"print('libraries loaded ')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"id": "fc4a1000", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"done this cell\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"##########################################################################\n", | ||
"# parameters\n", | ||
"#ZARR blob account - testing\n", | ||
"AZURE_STORAGE_ACCOUNT_NAME=\"blobtest12345\"\n", | ||
"AZURE_STORAGE_ACCESS_KEY=\"xxxxx\"\n", | ||
"container_name=\"seismic\"\n", | ||
"\n", | ||
"backend='zarr_blob'\n", | ||
"object_name1=\"ZarrVolume0\"\n", | ||
"nsamples = 200;\n", | ||
"nilines = 20;\n", | ||
"nxlines = 15;\n", | ||
"noffsets = 50;\n", | ||
"nheaders = 9\n", | ||
"dt=0.004\n", | ||
"dx=12.5\n", | ||
"dh=100\n", | ||
"nprocess=8;\n", | ||
"print('done this cell')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"id": "1b3f4218", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"###########################################################################\n", | ||
"# functions to measure time intervals\n", | ||
"def tic():\n", | ||
" global startTime_for_tictoc\n", | ||
" startTime_for_tictoc = time.time()\n", | ||
"\n", | ||
"def toc():\n", | ||
" if 'startTime_for_tictoc' in globals():\n", | ||
" print(\"Elapsed time is \" + str(time.time() - startTime_for_tictoc) + \" s\")\n", | ||
" else:\n", | ||
" print(\"Toc: start time not set\")\n", | ||
"\n", | ||
"###########################################################################" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"id": "0daa2c84", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"nil= 20 nxl= 15 noff= 50 ntasks= 20\n", | ||
"done this cell\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"###########################################################################\n", | ||
"ntasks=nilines\n", | ||
"print('nil=',nilines,' nxl=',nxlines,' noff=',noffsets,' ntasks=',ntasks)\n", | ||
" \n", | ||
"# opening zarr output file\n", | ||
"shape_v = (nilines,nxlines,noffsets,nsamples)\n", | ||
"shape_h = (nilines,nxlines,noffsets,nheaders)\n", | ||
"\n", | ||
"# parallel partition in inlines so need to chunk over this\n", | ||
"chunk_v = (1,nxlines,noffsets,nsamples)\n", | ||
"chunk_h = (1,nxlines,noffsets,nheaders)\n", | ||
"\n", | ||
"print('done this cell')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"id": "113ba53a", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"done this cell\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"\n", | ||
"#################################################################################\n", | ||
"if backend == 'zarr_blob':\n", | ||
" import azure.storage.blob\n", | ||
"\n", | ||
" container_client = azure.storage.blob.ContainerClient(\n", | ||
" account_name=AZURE_STORAGE_ACCOUNT_NAME,\n", | ||
" credential=AZURE_STORAGE_ACCESS_KEY,\n", | ||
" account_url=\"https://{}.blob.core.windows.net\".format(AZURE_STORAGE_ACCOUNT_NAME),\n", | ||
" container_name=container_name)\n", | ||
" store = zarr.ABSStore(client=container_client, prefix=object_name1)\n", | ||
" root = zarr.group(store=store, overwrite=True)\n", | ||
" vol = root.zeros('volume', chunks=chunk_v, shape=shape_v, dtype=np.float32)\n", | ||
" hea = root.zeros('header', chunks=chunk_h, shape=shape_h, dtype=np.float32)\n", | ||
"\n", | ||
"print('done this cell')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "c6058662", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernel_info": { | ||
"name": "devito" | ||
}, | ||
"kernelspec": { | ||
"display_name": "devito", | ||
"language": "python", | ||
"name": "devito" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.12" | ||
}, | ||
"microsoft": { | ||
"ms_spell_check": { | ||
"ms_spell_check_language": "en" | ||
} | ||
}, | ||
"nteract": { | ||
"version": "nteract-front-end@1.0.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.