gpm.io package#
Submodules#
gpm.io.checks module#
This module contains functions to check the GPM-API arguments.
- gpm.io.checks.check_base_dir(base_dir)[source][source]#
Check base directory path.
If base_dir ends with “GPM” directory, it removes it from the base_dir path. If base_dir does not end with “GPM”, the GPM directory will be created.
- gpm.io.checks.check_date(date)[source][source]#
Check is a
datetime.dateobject.
- gpm.io.checks.check_full_product_level(full_product_level)[source][source]#
Check full_product_level validity.
- gpm.io.checks.check_full_product_levels(full_product_levels)[source][source]#
Check full product levels list validity.
- gpm.io.checks.check_product_categories(product_categories)[source][source]#
Check product category list validity.
- gpm.io.checks.check_product_category(product_category)[source][source]#
Check product_category validity.
- gpm.io.checks.check_product_levels(product_levels)[source][source]#
Check product levels list validity.
- gpm.io.checks.check_product_types(product_types)[source][source]#
Check product types list validity.
- gpm.io.checks.check_product_validity(product, product_type=None)[source][source]#
Check product validity for the specified product_type.
- gpm.io.checks.check_product_version(version, product)[source][source]#
Check valid version for the specified product.
- gpm.io.checks.check_scan_mode(scan_mode, product, version)[source][source]#
Checks scan_mode validity.
- gpm.io.checks.check_scan_modes(scan_modes, product, version)[source][source]#
Checks scan_modes (for DataTree loading).
- gpm.io.checks.check_start_end_time(start_time, end_time)[source][source]#
Check start_time and end_time value validity.
- gpm.io.checks.check_time(time)[source][source]#
Check time validity.
It returns a
datetime.datetimeobject to seconds precision.- Parameters:
time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Time object. Accepted types:
datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.- Returns:
time
- Return type:
- gpm.io.checks.check_transfer_tool_availability(transfer_tool)[source][source]#
Check availability of a transfer_tool. Return True if available.
- gpm.io.checks.check_valid_time_request(start_time, end_time, product)[source][source]#
Check validity of the time request.
gpm.io.data_integrity module#
This module contains functions that check the GPM files integrity.
- gpm.io.data_integrity.check_archive_integrity(product, start_time, end_time, version=None, product_type='RS', remove_corrupted=True, verbose=True)[source][source]#
Check GPM granule file integrity over a given period.
If remove_corrupted=True, it removes the corrupted files.
- Parameters:
product (str) – GPM product acronym.
start_time (datetime.datetime) – Start time.
end_time (datetime.datetime) – End time.
product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).version (int, optional) – GPM version of the data to retrieve if
product_type = "RS". GPM data readers currently support version 4, 5, 6 and 7.remove_corrupted (bool, optional) – Whether to remove the corrupted files. The default is
True.
- Returns:
List of file paths which are corrupted.
- Return type:
- gpm.io.data_integrity.check_filepaths_integrity(filepaths, remove_corrupted=True, verbose=True)[source][source]#
Check the integrity of GPM files.
- Parameters:
- Returns:
l_corrupted – List of corrupted file paths.
- Return type:
gpm.io.download module#
This module contains the routines required to download data from the NASA PPS and GES DISC servers.
- gpm.io.download.check_pps_ports_are_open()[source][source]#
Check 64000-65000 ports are open for PPS.
- gpm.io.download.check_valid_pps_credentials(verbose=True)[source][source]#
Check validity of PPS credentials.
- gpm.io.download.curl_ges_disc_cmd(remote_filepath, local_filepath, username='dummy', password='dummy')[source][source]#
CURL command to download data from GES DISC.
- gpm.io.download.curl_pps_cmd(remote_filepath, local_filepath, username, password)[source][source]#
CURL command to download data from PPS through ftps.
- gpm.io.download.download_archive(product, start_time, end_time, product_type='RS', version=None, storage='PPS', n_threads=4, transfer_tool='CURL', progress_bar=True, force_download=False, check_integrity=True, remove_corrupted=True, retry=1, verbose=True)[source][source]#
Download GPM data from NASA servers (day by day).
- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().start_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Start time. Accepted types:
datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.end_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – End time. Accepted types:
datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).version (int, optional) – GPM version of the data to retrieve if
product_type = "RS".storage (str, optional) – The remote repository from where to download. Either
ppsorges_disc. The default ispps.n_threads (int, optional) – Number of parallel downloads. The default is set to 10.
progress_bar (bool, optional) – Whether to display progress. The default is
True.transfer_tool (str, optional) – Whether to use
curlorwgetfor data download. The default iscurl.force_download (bool, optional) – Whether to redownload data if already existing on disk. The default is
False.verbose (bool, optional) – Whether to print processing details. The default is
False.check_integrity (bool, optional) – Check integrity of the downloaded files. By default is
True.remove_corrupted (bool, optional) – Whether to remove the corrupted files. By default is
True.retry (int, optional,) – The number of attempts to redownload the corrupted files. The default is 1. Only applies if
check_integrity=True!
- gpm.io.download.download_files(filepaths, product_type='RS', storage='PPS', n_threads=4, transfer_tool='CURL', force_download=False, remove_corrupted=True, progress_bar=False, verbose=True, retry=1)[source][source]#
Download specific GPM files from NASA servers.
- Parameters:
filepaths (str or list) – List of GPM file names to download.
product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time). The default is “RS”.storage (str, optional) – The remote repository from where to download. Either
ppsorges_disc. The default is “PPS”.n_threads (int, optional) – Number of parallel downloads. The default is set to 10.
progress_bar (bool, optional) – Whether to display progress. The default is
True.transfer_tool (str, optional) – Whether to use
curlorwgetfor data download. The default iscurl.verbose (bool, optional) – Whether to print processing details. The default is
False.force_download (bool, optional) – Whether to redownload data if already existing on disk. The default is
False.remove_corrupted (bool, optional) – Whether to remove the corrupted files. By default is
True.retry (int, optional,) – The number of attempts to redownload the corrupted files. The default is 1.
- Returns:
l_corrupted – List of corrupted file paths. If no corrupted files, returns an empty list.
- Return type:
- gpm.io.download.filter_download_list(remote_filepaths, local_filepaths, force_download=False)[source][source]#
Removes filepaths of GPM file already existing on disk.
- Parameters:
- Returns:
remote_filepaths (list) – List of filepaths on the NASA PPS server.
local_filepaths (list) – List of filepaths on the local disk.
- gpm.io.download.get_filepath_from_filename(filename, storage, product_type)[source][source]#
Convert GPM file names to the <storage> file path.
- gpm.io.download.get_filepaths_from_filenames(filepaths, storage, product_type)[source][source]#
Convert GPM file names or file paths to <storage> file paths.
- gpm.io.download.run(commands, n_threads=10, progress_bar=True, verbose=True)[source][source]#
Run bash commands in parallel using multithreading.
gpm.io.filter module#
This module contains functions to filter files according to user specifics.
- gpm.io.filter.filter_by_product(filepaths, product, product_type='RS')[source][source]#
Filter filepaths by product.
- Parameters:
- Returns:
filepaths – List of valid filepaths. If no valid filepaths, returns an empty list !
- Return type:
- gpm.io.filter.filter_by_time(filepaths, start_time=None, end_time=None)[source][source]#
Filter filepaths by start_time and end_time.
- Parameters:
filepaths (list) – List of filepaths.
start_time (datetime.datetime) – Start time. If
None, will be set to GPM start mission time (1998-01-01).end_time (datetime.datetime) – End time. If
Nonewill be set to current UTC time.
- Returns:
filepaths – List of valid filepaths. If no valid filepaths, returns an empty list !
- Return type:
- gpm.io.filter.filter_by_version(filepaths, version)[source][source]#
Filter filepaths by GPM product version.
- gpm.io.filter.filter_filepaths(filepaths, product=None, product_type=None, version=None, start_time=None, end_time=None)[source][source]#
Filter the GPM filepaths based on specific parameters.
- Parameters:
filepaths (list) – List of filepaths.
product (str) – GPM product name. See
gpm.available_products(). The default isNone.product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).start_time (datetime.datetime) – Start time The default is
None.end_time (datetime.datetime) – End time. The default is
None.version (int) – GPM product version. The default is
None.
- Returns:
filepaths – Returns the filepaths subset. If no valid filepaths, return an empty list.
- Return type:
gpm.io.find module#
This module contains functions to find data on local and NASA servers.
- gpm.io.find.find_associated_filepath(filepath, product, storage='LOCAL', product_type='RS', version=7)[source][source]#
Return filepath of another product associated to the input filepath.
Please specify a product derived from the same sensor !
- gpm.io.find.find_daily_filepaths(storage, date, product, product_type, version, start_time=None, end_time=None, verbose=False, base_dir=None)[source][source]#
Retrieve GPM data filepaths for a specific day and product.
- Parameters:
date (datetime.date) – Single date for which to retrieve the data.
product (str) – GPM product acronym. See
gpm.available_products().start_time (datetime.datetime) – Filtering start time.
end_time (datetime.datetime) – Filtering end time.
product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).version (int, optional) – GPM version of the data to retrieve if
product_type = "RS".verbose (bool, optional) – Default is
False.base_dir (str) – The base directory where GPM data are stored on local disk. It must be specified only if storage=”LOCAL”.
- Returns:
pps_filepaths (list) – List of file paths on the NASA PPS server.
available_version (list) – List of available versions.
- gpm.io.find.find_filepaths(storage, product, start_time, end_time, product_type='RS', version=None, groups=None, verbose=True, parallel=True, base_dir=None)[source][source]#
Retrieve GPM data filepaths on local disk for a specific time period and product.
- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().start_time (datetime.datetime) – Start time.
end_time (datetime.datetime) – End time.
product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).version (int, optional) – GPM version of the data to retrieve if
product_type = "RS".verbose (bool, optional) – Whether to print processing details. The default is
True.parallel (bool, optional) – Whether to loop over dates in parallel. The default is
True.groups (list or str, optional) – Whether to group the filepaths in a dictionary by a custom selection of keys. Valid group keys are
product_level,satellite,sensor,algorithm,start_time,end_time,granule_id,version,product_type,product,data_format,year,month,day,doy,dow,hour,minute,second,month_name,quarter,season. The time components are extracted fromstart_time! If groups isNonereturns the filepaths list. The default isNone.
- Returns:
filepaths – List of GPM filepaths.
- Return type:
gpm.io.ges_disc module#
Routines required to search data on the NASA GES DISC servers.
- gpm.io.ges_disc.define_ges_disc_filepath(product, product_type, date, version, filename)[source][source]#
Define GES DISC filepath from filename.
This function is called by
get_filepath_from_filename(filename, storage, product_type).- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().product_type (str) – GPM product type. Not used for GES DISC.
date (datetime.date) – Single date for which to retrieve the data.
version (int) – GPM version of the data to retrieve if
product_type = "RS".filename (str) – Name of the GPM file.
- gpm.io.ges_disc.get_ges_disc_daily_filepaths(product, product_type, date, version, verbose=True)[source][source]#
Retrieve the NASA GES DISC file paths available at a given date.
- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().date (datetime.date) – Single date for which to retrieve the data.
product_type (str) – GPM product type. Not used for GES DISC.
version (int) – GPM version of the data to retrieve.
verbose (bool, optional) – Whether to specify when data are not available for a specific date. The default is
True.
- gpm.io.ges_disc.get_ges_disc_product_directory(product, date, version)[source][source]#
Retrieve the NASA GES DISC server product directory path at a specific date.
The data list is retrieved using https.
- Parameters:
product (str) – GPM product name. See
gpm.available_products().date (datetime.date) – Single date for which to retrieve the data.
version (int) – GPM version of the data to retrieve.
- Returns:
url_data_list – url of the NASA GES DISC server where the data are stored.
- Return type:
- gpm.io.ges_disc.get_ges_disc_product_directory_tree(product, date, version)[source][source]#
Return the GES DISC product directory tree.
The directory tree structure is
<product directory>/YYYY/DOYfor L1 and L2 products (and IMERG half hourly)<product directory>/YYYY/MMfor L3 daily products<product directory>/YYYYor<product directory>/YYYY/MMfor L3 monthly products
- Parameters:
product (str) – GPM product name. See
gpm.available_products().date (datetime.date) – Single date for which to retrieve the data.
version (int) – GPM version of the data to retrieve.
- Returns:
directory_tree – DIrectory tree on the NASA GESC DISC server where the data are stored.
- Return type:
gpm.io.info module#
This module provide tools to extraction information from the granules’ filenames.
- gpm.io.info.get_end_time_from_filepaths(filepaths)[source][source]#
Infer granules
end_timefrom file paths.
- gpm.io.info.get_granule_from_filepaths(filepaths)[source][source]#
Infer GPM Granule IDs from file paths.
- gpm.io.info.get_info_from_filepath(filepath)[source][source]#
Retrieve file information dictionary from filepath.
- gpm.io.info.get_key_from_filepath(filepath, key)[source][source]#
Extract specific key information from a list of filepaths.
- gpm.io.info.get_key_from_filepaths(filepaths, key)[source][source]#
Extract specific key information from a list of filepaths.
- gpm.io.info.get_product_from_filepath(filepath)[source][source]#
Infer granules
productfrom file path.
- gpm.io.info.get_product_from_filepaths(filepaths)[source][source]#
Infer granules
productfrom file paths.
- gpm.io.info.get_season(time)[source][source]#
Get season from datetime.datetime or datetime.date object.
- gpm.io.info.get_start_end_time_from_filepaths(filepaths)[source][source]#
Infer granules
start_timeandend_timefrom file paths.
- gpm.io.info.get_start_time_from_filepaths(filepaths)[source][source]#
Infer granules
start_timefrom file paths.
- gpm.io.info.get_time_component(time, component)[source][source]#
Get time component from datetime.datetime object.
- gpm.io.info.get_version_from_filepath(filepath, integer=True)[source][source]#
Infer granule
versionfrom file path.
- gpm.io.info.get_version_from_filepaths(filepaths, integer=True)[source][source]#
Infer granules
versionfrom file paths.
- gpm.io.info.group_filepaths(filepaths, groups=None, sep=None)[source][source]#
Group filepaths in a dictionary if groups are specified.
- Parameters:
filepaths (list) – List of filepaths.
groups (list or str) – The group keys by which to group the filepaths. Valid group keys are
product_level,satellite,sensor,algorithm,start_time,end_time,granule_id,version,product_type,product,data_format,year,month,day,doy,dow,hour,minute,second,month_name,quarter,season. The time components are extracted fromstart_time! If groups isNonereturns the input filepaths list. The default isNone.sep (str) – Separator to use for multiple groups. The default is os.path.sep.
- Returns:
Either a dictionary of format
{<group_value>: <list_filepaths>}. or the original input filepaths (ifgroups=None)- Return type:
gpm.io.local module#
This module contains functions defining where to download GPM data on the local machine.
- gpm.io.local.define_local_filepath(product, product_type, date, version, filename, base_dir=None)[source][source]#
Define local file path.
This function is called by get_filepath_from_filename(filename, storage, product_type).
- gpm.io.local.get_local_daily_filepaths(product, product_type, date, version, base_dir)[source][source]#
Retrieve GPM data filepaths on the local disk directory of a specific day and product.
- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().product_type (str) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).date (datetime.date) – Single date for which to retrieve the data.
version (int) – GPM version of the data to retrieve if
product_type = "RS".base_dir (str) – The base directory where to store GPM data.
- gpm.io.local.get_local_dir_tree_from_filename(filepath, product_type='RS', base_dir=None)[source][source]#
Return directory tree from a GPM filename or filepath.
- gpm.io.local.get_local_filepath_from_filename(filepath, product_type='RS', base_dir=None)[source][source]#
Return the local filepath of a GPM file or filepath.
- gpm.io.local.get_local_filepaths(product, version=7, product_type='RS', start_time=None, end_time=None, base_dir=None, groups=None)[source][source]#
Retrieve all GPM filepaths on the local disk directory for a specific product.
- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().version (int) – GPM version of the data to retrieve if
product_type = "RS". The default is version7.product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).groups (list or str, optional) – Whether to group the filepaths in a dictionary by a custom selection of keys. Valid group keys are product_level, satellite, sensor, algorithm, start_time, end_time, granule_id, version, product_type, product, data_format, year, month, day, doy, dow, hour, minute, second, month_name, quarter, season. The time components are extracted from start_time ! If groups is
Nonereturns the filepaths list. The default isNone.
- gpm.io.local.get_local_product_directory(base_dir, product, product_type, version, date)[source][source]#
Provide the local repository path where the requested daily GPM data are stored/need to be saved.
- Parameters:
base_dir (str) – The base directory where to store GPM data.
product (str) – GPM product name. See
gpm.available_products().product_type (str) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).version (int) – GPM version of the data to retrieve if
product_type = "RS".date (datetime.date) – Single date for which to retrieve the data.
- Returns:
product_dir_path – Directory path where daily GPM data are located.
If
product_type == "RS":<base_dir>/GPM/RS/V0<version>/<product_category>/<product>/<YYYY>/<MM>/<DD>If
product_type == "NRT":<base_dir>/GPM/NRT/<product_category>/<product>/<YYYY>/<MM>/<DD>
Valid product_category are
RADAR,PMW,CMB,IMERG.- Return type:
gpm.io.pps module#
This module contains the routines required to search data on the NASA PPS servers.
- gpm.io.pps.define_pps_filepath(product, product_type, date, version, filename)[source][source]#
Define PPS filepath from filename.
This function is called by
get_filepath_from_filename(filename, storage, product_type).
- gpm.io.pps.find_first_pps_granule_filepath(product: str, product_type: str, version: int) str[source][source]#
Return the PPS filepath of the first available granule.
- gpm.io.pps.get_pps_daily_filepaths(product, product_type, date, version, verbose=True)[source][source]#
Retrieve the complete url to the files available on the NASA PPS server for a specific day and product.
- Parameters:
product (str) – GPM product acronym. See
gpm.available_products().date (datetime.date) – Single date for which to retrieve the data.
product_type (str, optional) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).version (int, optional) – GPM version of the data to retrieve if
product_type = "RS".verbose (bool, optional) – Whether to specify when data are not available for a specific date. The default is
True.
- gpm.io.pps.get_pps_product_directory(product, product_type, date, version, server_type)[source][source]#
Retrieve the NASA PPS server product directory path at specific date.
The data list is retrieved using https. The data stored are retrieved using ftps.
- Parameters:
product (str) – GPM product name. See
gpm.available_products().product_type (str) – GPM product type. Either
RS(Research) orNRT(Near-Real-Time).date (datetime.date) – Single date for which to retrieve the data.
version (int) – GPM version of the data to retrieve if
product_type = "RS".server_type (str) – Either
textordata
- Returns:
url_product_dir – url of the NASA PPS server where the data are listed.
- Return type:
gpm.io.products module#
This module contains functions to obtain GPM products information.
- gpm.io.products.available_product_categories(satellites=None, sensors=None, product_types=None, versions=None, product_levels=None, full_product_levels=None)[source][source]#
Provide a list of available GPM product categories.
- Parameters:
product_types (str or list, optional) – If
None(default), provide all products (RSandNRT). IfRS, provide a list of all GPM RS products available for download. IfNRT, provide a list of all GPM NRT products available for download.product_levels (str or list, optional) – If
None(default), provide products from all product levels. Ifstr, must be a valid product level. Valid product levels are:1A,1B,1C,2A,2B,3B. The list of available sensors also be retrieved usingavailable_product_levels().versions (int or list, optional) – If
None(default), provide products from all versions. Ifint, must be a valid version. Valid product levels are:4,5,6,7. The list of available sensors can also be retrieved usingavailable_versions().satellites (str or list, optional) – If
None(default), provide products from all satellites. Ifstr, must be a valid satellites. The list of available satellites can be retrieved usingavailable_satellites().sensors (str or list, optional) – If
None(default), provide products from all sensors. Ifstr, must be a valid sensor. The list of available sensors can be retrieved usingavailable_sensors().
- Returns:
List of available GPM product categories.
- Return type:
List
- gpm.io.products.available_product_levels(satellites=None, sensors=None, product_categories=None, product_types=None, versions=None, full=False)[source][source]#
Provide a list of available GPM product levels.
- Parameters:
product_types (str or list, optional) – If
None(default), provide all products (RSandNRT). IfRS, provide a list of all GPM RS products available for download. IfNRT, provide a list of all GPM NRT products available for download.product_categories (str or list, optional) – If
None(default), provide products from all product categories. Ifstr, must be a valid product category. Valid product categories are:PMW,RADAR,IMERG,CMB. The list of available sensors can also be retrieved usingavailable_product_categories().versions (int or list, optional) – If
None(default), provide products from all versions. Ifint, must be a valid version. Valid product levels are:4,5,6,7. The list of available sensors can also be retrieved usingavailable_versions().satellites (str or list, optional) – If
None(default), provide products from all satellites. Ifstr, must be a valid satellites. The list of available satellites can be retrieved usingavailable_satellites().sensors (str or list, optional) – If
None(default), provide products from all sensors. Ifstr, must be a valid sensor. The list of available sensors can be retrieved usingavailable_sensors().
- Returns:
List of available GPM product levels.
- Return type:
List
- gpm.io.products.available_product_versions(product)[source][source]#
Provides a list with the available product versions.
- gpm.io.products.available_products(satellites=None, sensors=None, product_categories=None, product_types=None, versions=None, product_levels=None, full_product_levels=None, start_time=None, end_time=None)[source][source]#
Provide a list of available GPM products for download.
- Parameters:
product_types (str or list, optional) – If
None(default), provide all products (RSandNRT). IfRS, provide a list of all GPM RS products available for download. IfNRT, provide a list of all GPM NRT products available for download.product_categories (str or list, optional) – If
None(default), provide products from all product categories. Ifstr, must be a valid product category. Valid product categories are:PMW,RADAR,IMERG,CMB. The list of available sensors can also be retrieved usingavailable_product_categories().product_levels (str or list, optional) – If
None(default), provide products from all product levels. Ifstr, must be a valid product level. Valid product levels are:1A,1B,1C,2A,2B,3B. The list of available sensors also be retrieved usingavailable_product_levels().versions (int or list, optional) – If
None(default), provide products from all versions. Ifint, must be a valid version. Valid product levels are:4,5,6,7. The list of available sensors can also be retrieved usingavailable_versions().satellites (str or list, optional) – If
None(default), provide products from all satellites. Ifstr, must be a valid satellites. The list of available satellites can be retrieved usingavailable_satellites().sensors (str or list, optional) – If
None(default), provide products from all sensors. Ifstr, must be a valid sensor. The list of available sensors can be retrieved usingavailable_sensors().start_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Start time period over which to search for available products. The default is
None(start of the GPM mission). Accepted types:datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.end_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – End time period over which to search for available products. The default is
None(current time). Accepted types:datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.
- Returns:
List of available GPM products.
- Return type:
List
- gpm.io.products.available_satellites(sensors=None, product_categories=None, product_types=None, versions=None, product_levels=None, full_product_levels=None, start_time=None, end_time=None, prefix_with_sensor=False)[source][source]#
Provide a list of available GPM satellites.
If
prefix_with_sensor=True, it prefixes the satellite name with the satellite name:{sensor}-{satellite}.- Parameters:
product_types (str or list, optional) – If
None(default), provide all products (RSandNRT). IfRS, provide a list of all GPM RS products available for download. IfNRT, provide a list of all GPM NRT products available for download.product_categories (str or list, optional) – If
None(default), provide products from all product categories. Ifstr, must be a valid product category. Valid product categories are:PMW,RADAR,IMERG,CMB. The list of available sensors can also be retrieved usingavailable_product_categories().product_levels (str or list, optional) – If
None(default), provide products from all product levels. Ifstr, must be a valid product level. Valid product levels are:1A,1B,1C,2A,2B,3B. The list of available sensors also be retrieved usingavailable_product_levels().versions (int or list, optional) – If
None(default), provide products from all versions. Ifint, must be a valid version. Valid product levels are:4,5,6,7. The list of available sensors can also be retrieved usingavailable_versions().sensors (str or list, optional) – If
None(default), provide products from all sensors. Ifstr, must be a valid sensor. The list of available sensors can be retrieved usingavailable_sensors().start_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Start time period over which to search for available products. The default is
None(start of the GPM mission). Accepted types:datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.end_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – End time period over which to search for available products. The default is
None(current time). Accepted types:datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.prefix_with_sensor (bool, optional) – If
True, it prefixes the satellite name with the satellite name:{sensor}-{satellite}. IfFalse(the default), it just return the name of the satellite.
- Returns:
List of available GPM satellites.
- Return type:
List
- gpm.io.products.available_scan_modes(product, version)[source][source]#
Return the available
scan_modesfor a given product (and specific version).
- gpm.io.products.available_sensors(satellites=None, product_categories=None, product_types=None, versions=None, product_levels=None, full_product_levels=None, start_time=None, end_time=None, suffix_with_satellite=False)[source][source]#
Provide a list of available GPM sensors.
If
suffix_with_satellite=True, it suffixes the sensor name with the satellite name:{sensor}-{satellite}.- Parameters:
product_types (str or list, optional) – If
None(default), provide all products (RSandNRT). IfRS, provide a list of all GPM RS products available for download. IfNRT, provide a list of all GPM NRT products available for download.product_categories (str or list, optional) – If
None(default), provide products from all product categories. Ifstr, must be a valid product category. Valid product categories are:PMW,RADAR,IMERG,CMB. The list of available sensors can also be retrieved usingavailable_product_categories().product_levels (str or list, optional) – If
None(default), provide products from all product levels. Ifstr, must be a valid product level. Valid product levels are:1A,1B,1C,2A,2B,3B. The list of available sensors also be retrieved usingavailable_product_levels().versions (int or list, optional) – If
None(default), provide products from all versions. Ifint, must be a valid version. Valid product levels are:4,5,6,7. The list of available sensors can also be retrieved usingavailable_versions().satellites (str or list, optional) – If
None(default), provide products from all satellites. Ifstr, must be a valid satellites. The list of available satellites can be retrieved usingavailable_satellites().start_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Start time period over which to search for available products. The default is
None(start of the GPM mission). Accepted types:datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.end_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – End time period over which to search for available products. The default is
None(current time). Accepted types:datetime.datetime,datetime.date,numpy.datetime64orstr. If string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.suffix_with_satellite (bool, optional) – If
True, it suffixes the sensor name with the satellite name:{sensor}-{satellite}. IfFalse(the default), it just return the name of the sensor.
- Returns:
List of available GPM sensors.
- Return type:
List
- gpm.io.products.available_versions(satellites=None, sensors=None, product_types=None, product_categories=None, product_levels=None, full_product_levels=None)[source][source]#
Provide a list of available GPM versions.
- Parameters:
product_types (str or list, optional) – If
None(default), provide all products (RSandNRT). IfRS, provide a list of all GPM RS products available for download. IfNRT, provide a list of all GPM NRT products available for download.product_categories (str or list, optional) – If
None(default), provide products from all product categories. Ifstr, must be a valid product category. Valid product categories are:PMW,RADAR,IMERG,CMB. The list of available sensors can also be retrieved usingavailable_product_categories().product_levels (str or list, optional) – If
None(default), provide products from all product levels. Ifstr, must be a valid product level. Valid product levels are:1A,1B,1C,2A,2B,3B. The list of available sensors also be retrieved usingavailable_product_levels().satellites (str or list, optional) – If
None(default), provide products from all satellites. Ifstr, must be a valid satellites. The list of available satellites can be retrieved usingavailable_satellites().sensors (str or list, optional) – If
None(default), provide products from all sensors. Ifstr, must be a valid sensor. The list of available sensors can be retrieved usingavailable_sensors().
- Returns:
List of available GPM versions.
- Return type:
List
- gpm.io.products.filter_info_dict_by_time(info_dict, start_time, end_time)[source][source]#
Filter
info_dictbystart_timeandend_time.Assume that either
start_timeorend_timeare notNone.- Parameters:
start_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Start time. Accepted types:
datetime.datetime,datetime.date,numpy.datetime64orstrIf string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.end_time (datetime.datetime, datetime.date, numpy.datetime64 or str) – Start time. Accepted types:
datetime.datetime,datetime.date,numpy.datetime64orstrIf string type, it expects the isoformatYYYY-MM-DD hh:mm:ss.
- gpm.io.products.get_available_product_categories()[source][source]#
Get the list of all available product categories.
- gpm.io.products.get_available_product_levels(full=False)[source][source]#
Get the list of all available product levels.
- gpm.io.products.get_available_product_types()[source][source]#
Get the list of available product types.
- gpm.io.products.get_available_satellites(prefix_with_sensor=False)[source][source]#
Get the list of all available satellites.
- gpm.io.products.get_available_sensors(suffix_with_satellite=False)[source][source]#
Get the list of all available sensors.
- gpm.io.products.get_info_dict_subset(sensors=None, satellites=None, product_categories=None, product_types=None, versions=None, full_product_levels=None, product_levels=None)[source][source]#
Retrieve info dictionary filtered by keys.
- gpm.io.products.get_last_product_version(product)[source][source]#
Provide the most recent product version.
- gpm.io.products.get_product_category(product)[source][source]#
Get the
product_categoryof a GPM product.The
product_categoryis used to organize file on disk.
- gpm.io.products.get_product_level(product, full=False)[source][source]#
Get the
product_levelof a GPM product.
- gpm.io.products.get_product_pattern(product)[source][source]#
Return the filename pattern associated to GPM product.
- gpm.io.products.get_products_pattern_dict()[source][source]#
Return the filename pattern* associated to all GPM products.
Module contents#
This directory contains functions to search and download GPM products.