pypago.data

Module for the reading of data

Functions

loaddata_area_T(model_areas, filename, …) Extracts the model output from model T-grid points and interpolates them on section west and north faces.
loaddata_sec_T(model_sections, filename, …) Extracts the model output from model T-grid points and interpolates them on section west and north faces.
loaddata_sec_T_space(model_sections, …) Extracts the model output from model T-grid points and interpolates them on section west and north faces.
loaddata_sec_UV(model_sections, filename_u, …) Extracts the model output, interpolates if needed on west and north faces, and saves only the data along preselected sections and areas in structfile.
loaddata_sec_UV_ROMS(model_sections, …) Extracts the model output, interpolates if needed on west and north faces, and saves only the data along preselected sections and areas in structfile.
loadtime(model_sections, filename) Load the time variable (using the pypago.pyio.read_time() function) and add it to the model sections attributes (time attribute)
_extract_areas(model_areas, tempc, outname)[source]

Extracts grid T variable on all the areas contained in the MODEL_areas list, which is then updated.

_extract_sections(model_sections, tempn, tempw, outname, use_orient)[source]

Extracts T, S, U and V along all the sections contained in the model_sections list, which is then updated.

_extract_sections_space(model_sections, tempn, tempw, outname, use_orient)[source]

Extracts T, S, U and V along all the sections contained in the model_sections list, which is then updated.

_trans_to_vel(model_sections)[source]

Converts the transport arrays (in kg/s) into velocity arrays by diving the transport across each cell by the surface of the grid cell

loaddata_area_T(model_areas, filename, dictvarname)[source]

Extracts the model output from model T-grid points and interpolates them on section west and north faces. The extracted data are added to the input file:

import pypago.data

filenameT = 'g88_2000_00_gridT.nc'
dictvarname = {'vect':'votemper, 'vecs':vosaline'}
pypago.data.loaddata_sec_T('data.pygo', filenameT, dictvarname)
Parameters:structfile (str) – The name of the .pygo file where the list of pypago.sections.Gridsection objects are stored.

Changed in version 20120515: JD PAGO WHOI

loaddata_sec_T(model_sections, filename, dictvarname)[source]

Extracts the model output from model T-grid points and interpolates them on section west and north faces. The extracted data are added to the input file:

import pypago.data

filenameT = 'g88_2000_00_gridT.nc'
dictvarname = {'vect':'votemper, 'vecs':vosaline'}
pypago.data.loaddata_sec_T('data.pygo', filenameT, dictvarname)
Parameters:structfile (str) – The name of the .pygo file where the list of pypago.sections.Gridsection objects are stored.

Changed in version 20120515.

JD PAGO WHOI

loaddata_sec_T_space(model_sections, filename, dictvarname)[source]

Extracts the model output from model T-grid points and interpolates them on section west and north faces. The extracted data are added to the input file:

import pypago.data

filenameT = 'g88_2000_00_gridT.nc'
dictvarname = {'vect':'votemper, 'vecs':vosaline'}
pypago.data.loaddata_sec_T('data.pygo', filenameT, dictvarname)
Parameters:structfile (str) – The name of the .pygo file where the list of pypago.sections.Gridsection objects are stored.

Changed in version 20120515.

JD PAGO WHOI

loaddata_sec_UV(model_sections, filename_u, filename_v, dictvarname)[source]

Extracts the model output, interpolates if needed on west and north faces, and saves only the data along preselected sections and areas in structfile.

Warning

FOR NEMO MODEL ONLY

Parameters:
  • file_location (str) – is where the model output can be found (full path), which name is file_prefixSALT|TEMP|UVEL|VVEL.file_suffix.nc
  • loadarea (bool) – the loadarea option determines whether to load the temperature and salinity on the volumes computed using the pypago.grid.areas_MODEL() function

Changed in version 20120515: JD PAGO WHOI

loaddata_sec_UV_ROMS(model_sections, filename_u, filename_v, dictvarname)[source]

Extracts the model output, interpolates if needed on west and north faces, and saves only the data along preselected sections and areas in structfile.

Warning

FOR ROMS MODEL ONLY

Parameters:
  • file_location (str) – is where the model output can be found (full path), which name is file_prefixSALT|TEMP|UVEL|VVEL.file_suffix.nc
  • loadarea (bool) – the loadarea option determines whether to load the temperature and salinity on the volumes computed using the pypago.grid.areas_MODEL() function

Changed in version 20120515: JD PAGO WHOI

loadtime(model_sections, filename)[source]

Load the time variable (using the pypago.pyio.read_time() function) and add it to the model sections attributes (time attribute)

Parameters:
  • model_sections (list) – List of model sections
  • filename (str) – NetCDF filename
Returns:

List of model sections with the time attribute added

Return type:

list