.. _quick_start: Quick Start =========== .. image:: https://dev.azure.com/MPAS-Dev/pyremap%20testing/_apis/build/status/MPAS-Dev.pyremap?branchName=main :target: https://dev.azure.com/MPAS-Dev/pyremap%20testing/_build/latest?definitionId=1&branchName=main :alt: Build Status Python remapping tools for climate and earth system models. Installation ------------ To use the latest version for developers, get the code from: `https://github.com/MPAS-Dev/pyremap `_ Then, you will need to set up a conda environment and install the package in a way that points to the repo (so changes you make are available in the conda environment): .. code-block:: conda config --add channels conda-forge conda config --set channel_priority strict conda create -y -n pyremap --file dev-spec.txt conda activate pyremap python -m pip install -e . Examples -------- .. code-block:: cd examples 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