Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Output_IWBay — Post-Processing for Internal Waves in a Rectangular Bay

Post-processing, analysis, and visualization scripts for a Master's thesis studying internal waves generated by a seiche in a rectangular bay, simulated with MITgcm. Three stratification scenarios are compared: realistic (February climatological T/S), linear, and two-layer.

Each scenario runs two model configurations — with bay (run_expand/) and without bay (run_expand_nobay/, control) — and the bay–nobay difference isolates the internal wave signature generated by the seiche.


Directory Structure

Output_IWBay/
├── Python scripts (core modules and utilities)
├── Jupyter notebooks (analysis and figures)
├── npz_out/              # Processed time series, spectra, zoom fields, Hovmöller diagrams
├── npz_baro_full/        # Full-column barotropic/baroclinic decompositions
├── npz_baroclinico/      # Baroclinic component extractions
├── npz_theta/            # Temperature anomaly (θ') vertical profiles
├── npz_isoterma/         # Isotherm tracking data
├── npz_ke_rho/           # Kinetic energy and density fields
├── modes_npz/            # Vertical mode decomposition outputs
├── figs/                 # Output figures and PDFs
├── Imagenes_Tesis/       # Thesis-ready figures
└── rho_nc/               # Density field NetCDF processing outputs

Core Python Modules

MIT_DatProcesW.py — Primary data processing engine

  • Loads and concatenates multi-stage MNC/NetCDF output (cargar_datos_mitgcm_etapas())
  • Creates observation station geometry (make_stations_from_grid()): 7 stations (Seiche, Seiche2, A, B, C, Gamma, Omega) around the bay center
  • Extracts station time series and computes power spectral density via FFT (guardar_series_y_espectros())
  • Extracts 2D spatial zoom regions for animations (guardar_zoom_2d_npz())
  • Generates MP4 animations from zoom bundles (animar_zoom_desde_npz())

baro_tools.py — Barotropic/baroclinic decomposition

  • Collocates staggered-grid velocities (U, V, W) to cell centers
  • Computes depth-weighted vertical averages for the barotropic component
  • Outputs per-station NPZ files with barotropic and baroclinic time series

MIT_2DProcessing.py — 2D surface field processing

  • Spectral and spatial analysis for surface elevation (Eta) and other 2D variables

MIT_TempAnomaly.py — Temperature anomaly extraction

  • Computes θ' = T − T_ref(z) using scenario-specific reference profiles
  • Extracts full-column vertical profiles at stations and along transects

MITgcm_Hovmuller.py — Hovmöller diagrams

  • Builds time × depth cross-sections at all stations (guardar_hovmoller_npz_escenario_unico())
  • Stores depth-reference indices (~100 m, ~400 m) for isopycnal context

plotStats.py — MITgcm monitor statistics

  • Parses statsMIT.txt monitor output and plots Eta, u, v, w, θ, S, and CFL numbers
  • Computes bay–nobay differences with combined standard deviations
  • CLI: python plotStats.py <bay_stats.txt> [nobay_stats.txt]

export_pdf_escenario.py — PDF report generation

  • Exports multi-page PDFs with barotropic and baroclinic panels per scenario
  • Output: figs/{scenario}_comparativo_baro_v2.pdf

make_global_and_deflate.py — NetCDF tile stitching and compression

  • Merges per-rank MNC tiles using gluemncbig
  • Compresses output to NetCDF4 with zlib deflation (variable-by-variable, memory efficient)
  • CLI flags: --state-glob, --out-state, --float32, --complevel, --delete-tiles

Jupyter Notebooks

Notebook Purpose
Transectos.ipynb Primary thesis analysis: Y–Z transects of density, velocity, and vorticity (bay–nobay differences)
modos_verticales_IW.ipynb Vertical mode decomposition: eigenvalues, eigenvectors, phase speeds c_n
radios_deformacion.ipynb Rossby deformation radii L_n for all three scenarios
check_output_scenarios_func.ipynb Validation: reads all NPZ outputs and plots scenario comparisons
Energy_calcs.ipynb Kinetic and potential energy budgets
compute_wind_energy.ipynb Wind forcing power input analysis
Bt_Bc_components.ipynb Barotropic/baroclinic component visualization
plotStatsMIT.ipynb Monitor statistics visualization interface
test_KE.ipynb Kinetic energy testing and visualization
test_isotherma.ipynb Isotherm tracking test
perfil_rho_nc.ipynb Density profile extraction from NetCDF
make_global_and_deflate.ipynb NetCDF stitching/compression interface

Typical Post-Processing Pipeline

  1. Load data — cargar_datos_mitgcm_etapas() concatenates stages 1 (forced, 0–216 000 s) and 2 (free, 216 000–432 000 s) for bay and no-bay runs
  2. Station time series & spectra — guardar_series_y_espectros_escenario() → npz_out/{scenario}_series.npz, _espectros.npz
  3. 2D zoom fields — guardar_zoom_2d_npz() for W, U, V, Temp at selected depths → npz_out/{scenario}_{var}_zoom_*.npz
  4. Barotropic decomposition — guardar_baro_fullcol_por_estacion() → npz_baro_full/{scenario}/
  5. Hovmöller diagrams — guardar_hovmoller_npz_escenario_unico() → npz_out/{scenario}_hov_ALL_{var}.npz
  6. Temperature anomalies — run_theta_anomaly_pipeline() → npz_theta/{scenario}/
  7. Vertical mode analysis — modos_verticales_IW.ipynb → modes_npz/
  8. Figures & PDFs — export_pdf_escenario.py, plotStats.py, and analysis notebooks → figs/

NPZ Output Conventions

All NPZ files include a meta_json field with JSON-encoded metadata (scenario name, paths, station info, processing parameters).

File pattern Content
{scenario}_series.npz Station η time series (bay–nobay difference)
{scenario}_espectros.npz Power spectral density (freq in cph)
{scenario}_{var}_zoom_{z###m|sfc}.npz 3D spatial zoom cube (nt, y, x) with land mask
{scenario}_hov_ALL_{var}.npz Hovmöller array (nt, nz, n_stations)
{scenario}_{var}_{label}_baroFULL.npz Barotropic (nt,) + baroclinic (nt, nz) decomposition

Scenarios and Data Paths

Scenario Path Stratification
Realistic /Volumes/ESTEBAN_MIT/MITgcm/verification/BayIW_Rectan February climatological T/S
Linear /Volumes/Esteban_SSD/Maestría/MITgcm/verification/BayIW_Rectan_linear Linearly varying density
Two-layer /Volumes/ESTEBAN_MIT/MITgcm/verification/BayIW_Rectan_2layer Idealized step profile

Each scenario path contains run_expand/mnc_00*/ (bay) and run_expand_nobay/mnc_00*/ (control), with NetCDF tile files per MPI rank.


Dependencies

numpy, scipy, matplotlib, netCDF4, cmocean, pandas
MITgcmutils (for gluemncbig tile stitching)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages