zapata.data module

A module to store and treat data

in griglia nativa 1986-2020 giornaliera /data/products/GLOBAL_REANALYSES/C-GLORSv7/DAILY_MONTHLY

in griglia nativa 1986-2020 mensile /data/products/GLOBAL_REANALYSES/C-GLORSv7/MONTHLY

zapata.data.date_param()[source]

Data Bank to resolve Month and Season averaging information

Examples

>>> index = data_param()
>>> mon=index['DJF']['month_index']
zapata.data.DataGrid(option=None)[source]

Routine that returns a Dictionary with information on the requested Data Set.

Currently these data sets are supported

  • ERA5 -- Subset of monthly data of ERA5

  • GPCP -- Monthly data of precipitation data set

  • OCRD'-- cGLORS renalaysis V7 daily 1986-2020

  • OCRM'-- cGLORS renalaysis V7 monthly 1986-2020

Info can be retrieved as grid[dataset][var]['start'] for the starting years. See source for full explanation of the content.

Parameters:

Option --

  • 'Verbose' Tons of Output

  • 'Info' Info on data sets

Examples

>>> DataGrid('info')
>>> dat = DataGrid('verbose')
zapata.data.read_era5(var, lev, period='JAN', epoch='AFT', loc=' ', averaging=True, verbose=False)[source]

This routine reads monthly data files from monthly ERA5, optionally combining the backward (1950-1979) and current analysis (1979-2019)

Parameters:
  • var --

    Variable selected:
    • u: U-velocity

    • v: V-velocity

    • t: Temperature

    • w: Vertical Velocity

    • q: Specific Humidity

    • sst: Sea Surface Temperature

    • msl: Mean Sea Level Pressure

    • mtnlwrf: mean_top_net_long_wave_radiation_flux

    • mtnswrf: mean_top_net_short_wave_radiation_flux

    • mslhf: mean_surface_latent_heat_flux

    • msshf: mean_surface_sensible_heat_flux

    • msnswrf: mean_surface_net_short_wave_radiation_flux

    • msnlwrf: mean_surface_net_long_wave_radiation_flux

    • tcw: total_column_water

    • t2m: 2m_Temperature

  • lev -- pressure level, [10,50,100,150, 200,250,300,400, 500,600, 700,850,925, 1000]

  • period -- Month or season to be selected. For periods across years, i.e. 'DJF' the first and last years are dropped. Values are month or season labels 'JFM','AMJ','JAS','OND','DJF','JJA' 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC' 'ANN' -- Entire time series

  • epoch --

    • 'BCK' -- Only backward period 1950-1978

    • 'AFT' -- Current period 1979 - 2019

    • 'ALL' -- Combine the two

    • 'V5' -- ERA5 V5 1940-2022

  • loc -- Location of the root directory for the data set

  • averaging -- True/False If averaged output is desired

Returns:

data in xarray format

Return type:

data

zapata.data.decode_period(period)[source]

Decode Season or month to index

zapata.data.in_data(var, lev, dataset='ERA5', period='JAN', epoch='AFT', loc=' ', averaging=True, verbose=False, use_cache=True)[source]

This is a wrapper around read_era5. Using a file cache to avoid slow readings. Optionally combining the backward and current analysis

Parameters:
  • dataset -- Data set to be read: * 'ERA5' -- Monthly mean Reanalysis * 'CERES' -- CERES Satellite Tadiance Product

  • var --

    Variable selected:
    • u: U-velocity

    • v: V-velocity

    • t: Temperature

    • w: Vertical Velocity

    • q: Specific Humidity

    • sst: Sea Surface Temperature

    • msl: Mean Sea Level Pressure

    • mtnlwrf: mean_top_net_long_wave_radiation_flux

    • mtnswrf: mean_top_net_short_wave_radiation_flux

    • mslhf: mean_surface_latent_heat_flux

    • msshf: mean_surface_sensible_heat_flux

    • msnswrf: mean_surface_net_short_wave_radiation_flux

    • msnlwrf: mean_surface_net_long_wave_radiation_flux

    • tcw: total_column_water

    • t2m: 2m_Temperature

  • lev -- pressure level, [10,50,100,150, 200,250,300,400, 500,600, 700,850,925, 1000]

  • period -- Month or season to be selected. For periods across years, i.e. 'DJF' the first and last years are dropped. Values are month or season labels 'JFM','AMJ','JAS','OND','DJF','JJA' 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC' 'ANN' -- Entire time series

  • epoch --

    • 'BCK' -- Only backward period 1950-1978

    • 'AFT' -- Current period 1979 - 2019

    • 'ALL' -- Combine the two

    • 'V5' -- ERA5 V5 1940-2022

  • loc -- Location of the root directory for the data set

  • averaging -- True/False If averaged output is desired

Returns:

data in xarray format

Return type:

data

zapata.data.read_ceres(var, lev, period='JAN', epoch='AFT', loc=' ', averaging=True, verbose=False)[source]

This routine reads monthly data files from monthly ERA5, optionally combining the backward (1950-1979) and current analysis (1979-2019)

Parameters:
  • var --

    Variable selected:
    • toa_sw_all_mon W/m2 TOA Shortwave Flux - All-Sky

    • toa_lw_all_mon W/m2 TOA Longwave Flux - All-Sky

    • toa_net_all_mon W/m2 TOA Net Flux - All-Sky

    • toa_sw_clr_c_mon W/m2 TOA Shortwave Flux - Clear-Sky (for cloud-free areas of region)

    • toa_lw_clr_c_mon W/m2 TOA Longwave Flux - Clear-Sky (for cloud-free areas of region)

    • toa_net_clr_c_mon W/m2 TOA Net Flux - Clear-Sky (for cloud-free areas of region)

    • solar_mon W/m2 Incoming Solar Flux

    • cldarea_total_daynight_mon % Cloud Area Fraction - Daytime-and-Nighttime

    • cldpress_total_daynight_mon hPa Cloud Effective Pressure - Daytime-and-Nighttime

    • cldtemp_total_daynight_mon K Cloud Effective Temperature - Daytime-and-Nighttime

    • cldtau_total_day_mon 1 Cloud Visible Optical Depth - Daytime

  • lev -- TOA

  • period -- Month or season to be selected. For periods across years, i.e. 'DJF' the first and last years are dropped. Values are month or season labels 'JFM','AMJ','JAS','OND','DJF','JJA' 'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC' 'ANN' -- Entire time series

  • epoch --

    • 'ALL' -- Entire data series

  • loc -- Location of the root directory for the data set

  • averaging -- True/False If averaged output is desired

Returns:

data in xarray format

Return type:

data

zapata.data.select_time(dataset_dates, select=None, period=None)[source]

Function to create the time range for the data selection. A subperiod can be selected within the data set using select and period, select is the data set interval , period is the calendar choice within the data set. If both are 'none' the entire data set is selected from dataset_dates is chosen.

Parameters:
  • dataset_dates (list) -- List with the starting and ending dates of the data set

  • select (str) --

    Selection of the period within the data set given by dataset_dates
    • ERA5 -- 1940-2022

    • COBE -- 1891-2020

    • XXSEC -- 1900-2020

  • period (str) --

    Period to be selected
    • JAN -- January

    • JUL -- July

    • ANN -- Annual