:mod:`metreload.merra2` ======================= .. py:module:: metreload.merra2 .. autoapi-nested-parse:: Module for retrieving MERRA-2 data Module Contents --------------- .. data:: DODS_URL :annotation: = https://goldsmr4.gesdisc.eosdis.nasa.gov/dods .. data:: TIME_CHUNKS .. function:: get_merra2_collection_dataframe(collection, username, password, start_time, end_time, variables, location) Get a MERRA-2 data collection as a pandas DataFrame :param collection: Earth Science Data Types Name of the collection (9 characters) :type collection: str :param username: :type username: str :param password: :type password: str :param start_time: Timestamp in the form YYYY-MM-DD :type start_time: str :param end_time: Timestamp in the form YYYY-MM-DD :type end_time: str :param variables [: List of variables to include, or None to include all :type variables [: str :param location: Location in the form of tuple (lat, lon) or (north, west, south, east) :type location: tuple :param coordinates in WGS84 system.: .. function:: get_merra2_data(collection, username, password, savedir, start_time, end_time, variables, location) Convenience function for downloading MERRA-2 data as netCDF files :param collection: Name of data collection :type collection: str :param savedir: Directory to save files to :type savedir: str :param start_time: Timestamp in the form YYYY-MM-DDTHH :type start_time: str :param end_time: See above. :type end_time: str :param variables: List of variables to include, or None to include all :type variables: list :param location: Location in the form of tuple (lat, lon) or (north, west, south, east) coordinates in WGS84 system. :type location: tuple .. py:class:: MERRA2Dataset(ds) Bases: :class:`object` Class for MERRA-2 datasets .. method:: __del__(self) .. method:: __enter__(self) .. method:: __exit__(self, exc_type, exc_value, traceback) .. method:: close(self) Close the dataset .. staticmethod:: open(collection, username, password, base_url=DODS_URL) Open a MERRA-2 data collection :param collection: Earth Science Data Types Name of the collection (9 characters) :type collection: str :param username: :type username: str :param password: :type password: str :param base_url: Base url for requests, default https://goldsmr4.gesdisc.eosdis.nasa.gov/dods :type base_url: str, optional .. method:: to_netcdf(self, savedir) Save to netCDF4 files :param savedir: Path to save files to :type savedir: str .. method:: to_xarray(self) Convert to xarray Dataset .. method:: to_dataframe(self) Convert to pandas DataFrame .. method:: subset(self, location=None, start_time=None, end_time=None, variables=None) Subset the data accordingly :param location: Location in the form of tuple (lat, lon) or (north, west, south, east) :type location: tuple :param coordinates in WGS84 system.: :param start_time: Timestamp in the form YYYY-MM-DDTHH :type start_time: str :param end_time: See above. :type end_time: str :param variables: List of variables to include, or None to include all :type variables: list