earthdiagnostics.general

earthdiagnostics.general.attribute

Set attributtes in netCDF files

class earthdiagnostics.general.attribute.Attribute(data_manager, startdate, member, chunk, domain, variable, grid, attributte_name, attributte_value)[source]

Bases: earthdiagnostics.general.fix_file.FixFile

Set the value of an attribute

Can be useful to correct wrong metadata

Original author:
 

Javier Vegas-Regidor<javier.vegas@bsc.es>

Created:

July 2016

Parameters:
  • data_manager (DataManager) – data management object
  • startdate (str) – startdate
  • member (int) – member number
  • chunk (int) – chunk’s number
  • variable (str) – variable’s name
  • domain (ModelingRealm) – variable’s domain
alias = 'att'

Diagnostic alias for the configuration file

compute()[source]

Run the diagnostic

classmethod generate_jobs(diags, options)[source]

Create a job for each chunk to compute the diagnostic

Parameters:
  • diags (Diags) – Diagnostics manager class
  • options (list[str]) – variable, domain, grid
Returns:

earthdiagnostics.general.dailymean

earthdiagnostics.general.module

Compute module of two variables

class earthdiagnostics.general.module.Module(data_manager, startdate, member, chunk, domain, componentu, componentv, module_var, grid)[source]

Bases: earthdiagnostics.diagnostic.Diagnostic

Compute the module of the vector given by two scalar variables

Original author:
 

Javier Vegas-Regidor<javier.vegas@bsc.es>

Created:

July 2016

Parameters:
  • data_manager (DataManager) – data management object
  • startdate (str) – startdate
  • member (int) – member number
  • chunk (int :) – chunk’s number
  • domain (ModelingRealm) – variable’s domain
alias = 'module'

Diagnostic alias for the configuration file

compute()[source]

Run the diagnostic

declare_data_generated()[source]

Declare data to be generated by the diagnostic

classmethod generate_jobs(diags, options)[source]

Create a job for each chunk to compute the diagnostic

Parameters:
  • diags (Diags) – Diagnostics manager class
  • options (list[str]) – variable, domain, grid
Returns:

request_data()[source]

Request data required by the diagnostic

earthdiagnostics.general.monthlymean

earthdiagnostics.general.relinkall

Create links for all variables in a startdate

class earthdiagnostics.general.relinkall.RelinkAll(data_manager, startdate)[source]

Bases: earthdiagnostics.diagnostic.Diagnostic

Recreates the links for the variable specified

Original author:
 

Javier Vegas-Regidor<javier.vegas@bsc.es>

Created:

September 2016

Parameters:
  • data_manager (DataManager) – data management object
  • startdate (str) – startdate
alias = 'relinkall'

Diagnostic alias for the configuration file

compute()[source]

Run the diagnostic

declare_data_generated()[source]

Declare data to be generated by the diagnostic

classmethod generate_jobs(diags, options)[source]

Create a job for each chunk to compute the diagnostic

Parameters:
  • diags (Diags) – Diagnostics manager class
  • options (list[str]) – variable, domain, move_old=False
Returns:

request_data()[source]

Request data required by the diagnostic

earthdiagnostics.general.rewrite

Rewrite netCDF file

class earthdiagnostics.general.rewrite.Rewrite(data_manager, startdate, member, chunk, domain, variable, grid)[source]

Bases: earthdiagnostics.general.fix_file.FixFile

Rewrites files without doing any calculations.

Can be useful to convert units or to correct wrong metadata

Original author:
 

Javier Vegas-Regidor<javier.vegas@bsc.es>

Created:

July 2016

Parameters:
  • data_manager (DataManager) – data management object
  • startdate (str) – startdate
  • member (int) – member number
  • chunk (int) – chunk’s number
  • variable (str) – variable’s name
  • domain (ModelingRealm) – variable’s domain
alias = 'rewrite'

Diagnostic alias for the configuration file

compute()[source]

Run the diagnostic

earthdiagnostics.general.scale

Scales a variable by with value and offset

class earthdiagnostics.general.scale.Scale(data_manager, startdate, member, chunk, value, offset, domain, variable, grid, min_limit, max_limit, frequency, apply_mask)[source]

Bases: earthdiagnostics.general.fix_file.FixFile

Scales a variable by the given value also adding at offset

Can be useful to correct units or other known errors (think of a tas file declaring K as units but with the data stored as Celsius)

Original author:
 

Javier Vegas-Regidor<javier.vegas@bsc.es>

Created:

July 2016

Parameters:
  • data_manager (DataManager) – data management object
  • startdate (str) – startdate
  • member (int) – member number
  • chunk (int :) – chunk’s number
  • variable (str) – variable’s name
  • domain (ModelingRealm) – variable’s domain
alias = 'scale'

Diagnostic alias for the configuration file

compute()[source]

Run the diagnostic

classmethod generate_jobs(diags, options)[source]

Create a job for each chunk to compute the diagnostic

Parameters:
  • diags (Diags) – Diagnostics manager class
  • options (list[str]) – variable, domain, grid
Returns:

earthdiagnostics.general.simplify_dimensions

Convert i j files to lon lat when there is no interpolation required

class earthdiagnostics.general.simplify_dimensions.SimplifyDimensions(data_manager, startdate, member, chunk, domain, variable, grid, data_convention)[source]

Bases: earthdiagnostics.general.fix_file.FixFile

Convert i j files to lon lat when there is no interpolation required

i.e. lon is constant over i and lat is constat over j

Parameters:
  • data_manager (DataManager) –
  • startdate (str) –
  • member (int) –
  • chunk (init) –
  • domain (ModellingRealm) –
  • variable (str) –
  • grid (str or None) –
  • data_convention (str) –
alias = 'simdim'

Diagnostic alias for the configuration file

compute()[source]

Run the diagnostic

classmethod generate_jobs(diags, options)[source]

Create a job for each chunk to compute the diagnostic

Parameters:
  • diags (Diags) – Diagnostics manager class
  • options (list[str]) – domain,variables,grid
Returns:

earthdiagnostics.general.yearlymean