.. _quick_start: Quick Start =========== .. image:: https://dev.azure.com/MPAS-Dev/pyremap%20testing/_apis/build/status/MPAS-Dev.pyremap?branchName=master :target: https://dev.azure.com/MPAS-Dev/pyremap%20testing/_build/latest?definitionId=1&branchName=master :alt: Build Status Python remapping tools for climate and earth system models. Installation ------------ To use the latest version for developers, you will need to set up a conda environment with the following packages: * python >= 3.6 * numpy * scipy * netcdf4 * xarray >= 0.10.0 * dask * nco >= 4.8.1 * pyproj These can be installed via the conda command: .. code-block:: conda config --add channels conda-forge conda config --set channel_priority strict conda create -n pyremap python=3.7 numpy scipy netcdf4 "xarray>=0.10.0" dask \ "nco>=4.8.1" pyproj conda activate pyremap Then, get the code from: `https://github.com/MPAS-Dev/pyremap `_ Examples -------- .. code-block:: cd examples The simplest way to make pyremap available is: .. code-block:: ln -s ../pyremap First, make mapping files for a lat-lon grid, and test it out by remapping temperature from the example file: .. code-block:: wget https://web.lcrc.anl.gov/public/e3sm/inputdata/ocn/mpas-o/oQU240/ocean.QU.240km.151209.nc ./make_mpas_to_lat_lon_mapping.py You should now see the mapping file: .. code-block:: map_oQU240_to_0.5x0.5degree.nc as well as the input file (an initial condition for the MPAS-Ocean model) and an example of temperature from the initial condition remapped to the new grid. .. code-block:: ocean.QU.240km.151209.nc temp_0.5x0.5degree.nc Second, let's try the same but to an Antarctic stereographic grid: .. code-block:: ./make_mpas_to_Antarctic_stereo_mapping.py Now, there's a new mapping file and example output file: .. code-block:: map_oQU240_to_6000.0x6000.0km_10.0km_Antarctic_stereo.nc temp_6000.0x6000.0km_10.0km_Antarctic_stereo.nc Finally, let's remap the temperature on the Antarctic grid to a lower resolution Antarctic grid: .. code-block:: ./remap_stereographic.py -i temp_6000.0x6000.0km_10.0km_Antarctic_stereo.nc \ -o temp_6000.0x6000.0km_20.0km_Antarctic_stereo.nc -r 20 This created another mapping file and an output file: .. code-block:: map_6000x6000km_10km_Antarctic_stereo_to_6000x6000km_20.0km_Antarctic_stereo.nc temp_6000.0x6000.0km_20.0km_Antarctic_stereo.nc