pypago.nc¶
Module that contains various functions dedicated to the conversion of PyPAGO outputs into NetCDF files` to .nc
files
Functions
gridsec_tonc (finname, varname[, …]) |
Conversion of tracer and velocities along the sections into NetCDF. |
gridvol_tonc (finname, varname[, …]) |
Conversion of tracer fields within a domain into NetCDF. |
secind_tonc (finname[, section_names]) |
Conversion of section indices (issued from pypago.pypago.indices_MODEL() function) in NetCDF. |
sections_tonc (finname[, section_names]) |
Extraction of sections’ endpoints into NetCDF files |
-
_volind_tonc
(finname, domain_names=None)[source]¶ Conversion of volume indices (issued from
pypago.pypago.volumes_MODEL()
function) in NetCDF.Parameters:
-
_write_gridsec_netcdf
(finname, secint, varname, units, calendar)[source]¶ Function that handles the writing of individual NetCDF section files (called by
pypago.tonc.gridsec_tonc()
function)Parameters: - finname (str) – output of the
pypago.pypago.sections_MODEL()
function - modeltime (float) – time vector contained on the file
- secint (pypago.sections.GridSection) – PyPAGO object that contains the index elements
- varname (str) – variable name to save in the file (‘vecv’, ‘vect’ or ‘vecv’. If None, all are saved)
- finname (str) – output of the
-
_write_gridvol_netcdf
(finname, domint, varname, units, calendar)[source]¶ Function that handles the writing of individual NetCDF volume files (called by
pypago.tonc.gridvol_tonc()
function)Parameters: - finname (str) – output of the
pypago.pypago.sections_MODEL()
function - modeltime (float) – time vector contained on the file
- domint (pypago.areas.Areas) – PyPAGO object that contains the index elements
- varname (str) – variable to save in the file (‘salinity’ or ‘temperature’). If None, both are saved
- finname (str) – output of the
-
_write_secind_netcdf
(finname, modeltime, secint)[source]¶ Function that handles the writing of individual NetCDF index files (called by
pypago.tonc.secind_tonc()
function)Parameters: - finname (str) – output of the
pypago.pypago.indices_MODEL()
function - modeltime (float) – time vector contained on the file
- secint (pypago.sections.GridSection) – PyPAGO object that contains the volume elements
- finname (str) – output of the
-
_write_sections_netcdf
(finname, secint)[source]¶ Function that handles the writing of individual section endpoints files (called by
pypago.tonc.sections_tonc()
function)Parameters: - finname (str) – output of the
pypago.guis.ihm_editions_sections
module - secint (pypago.sections.Section) – PyPAGO object that contains the section element
- finname (str) – output of the
-
_write_volind_netcdf
(finname, modeltime, domint)[source]¶ Function that handles the writing of individual NetCDF volume files (called by
pypago.tonc.volind_tonc()
function)Parameters: - finname (str) – output of the
pypago.pypago.volumes_MODEL()
function - modeltime (float) – time vector contained on the file
- domint (pypago.areas.Areas) – PyPAGO object that contains the volume index elements
- finname (str) – output of the
-
gridsec_tonc
(finname, varname, section_names=None, units='days since 1900-01-01 00:00:00', calendar='gregorian')[source]¶ Conversion of tracer and velocities along the sections into NetCDF. There will be one file per section, in which the variables will be saved. The absolute path of the output files will be the same as for the input file name, except that the
.pygo
will be replaced by_sec_SECTIONNAME.nc
Parameters: - finname (str) – output of the
pypago.loaddata.loaddata()
function (must contain a dictionary with the MODEL_sections and MODEL_time keys) - section_names (list) – Default is None. If set, the list of the sections’ names from which to extract the data
- varname (list) – Default is None. If None, all the variables (vect, vecs and vecv are extracted. If set, the list of the variables names to extract
- finname (str) – output of the
-
gridvol_tonc
(finname, varname, domain_names=None, units='days since 1900-01-01 00:00:00', calendar='gregorian')[source]¶ Conversion of tracer fields within a domain into NetCDF. There will be one file per domain, in which the variables will be saved. The absolute path of the output files will be the same as for the input file name, except that the
.pygo
will be replaced by_dom_DOMAINNAME.nc
Parameters: - finname (str) – output of the
pypago.loaddata.loaddata()
function (must contain a dictionary with the MODEL_areas and MODEL_time keys) - domain_names (list) – Default is None. If set, the list of the domains’ names from which to extract the data
- varname (list) – Default is None. If None, all the variables (temperature, salinity) are extracted. If set, the list of the variables names to extract
- finname (str) – output of the
-
secind_tonc
(finname, section_names=None)[source]¶ Conversion of section indices (issued from
pypago.pypago.indices_MODEL()
function) in NetCDF.Parameters:
-
sections_tonc
(finname, section_names=None)[source]¶ Extraction of sections’ endpoints into NetCDF files
Parameters: - finname (str) – filename containing the list of sections’ endpoints
(output of the
pypago.guis.gui_sections_edition
) - section_names (list) – Default is None. If set, the list of sections’ names from which to extract the endpoints
Convert all sections of
sections_NA_Nico.pygo
to individual NetCDF files: >>> _sections_tonc(‘sections_NA_Nico.pygo’)Convert only
ar7
section >>> _sections_tonc(‘sections_NA_Nico.pygo’, section_names=[‘ar7’])What append if missing file ? >>> _sections_tonc(‘badfile’)
What append if missing section name in the file ? >>> _sections_tonc(‘sections_NA_Nico.pygo’, section_names=[‘badsection’])
- finname (str) – filename containing the list of sections’ endpoints
(output of the