Skip to content

Commit

Permalink
Docstanya (#318)
Browse files Browse the repository at this point in the history
* Some changes to Regrid 2, Lib, esmf, gsRegrid and horizontal

* Changes made to Chapters 1-7 and sample data

* fix API documentation

* rename regrid2 directory and delete print message

* add module API files

* add future and mock requirements

* get cwd for readthedocs

* Changes made to API

* Changes made to API

* Changes made to API

* Changes to API

* test rtd with mock

* add future for readthedocs

* create git.py in ../..

* add esmf

* add print statements for regrid2

* add print for libregrid2

* restore regrid2.Lib for readthedocs

* add mock modules

* add git.py

* try with new mock list

* force git.py

* force git.py

* try readthedocs.yml file

* fix readthedocs maping file

* change type pdb to pdf

* typo requirements.yml

* add dependencies

* add dependencies and change conf.yml

* change API.rst and other rst files

* Changes to API

* UVCDAT_ANONYMOUS_LOG set to false

* check if git.py is there

* add gcc to environment.yml

* try docker environment.yml

* remove git.py

* chage Libregrid to regrid2

* revert

* revert

* add cdms2 class

* delet cdms2 class

* delet cdms2 class

* change conf.py os.path

* Changes to API

* Changes made to API

* Changes to API

* Changes made to API

* Changes to API

* Changes made to API

* Changes made to API

* Changes to API

* Changes to API

* Changes made to API

* Changes made to API

* Changes made to API

* push latest rst files

* Changes made to API

* Made some changes to API

* update documentations

* Changes made to API

* Changes made to API

* Changes made to API

* Changes made to Section 2 and API

* Changes made to Section 2

* Changes made to Chapter 2

* Changes made to Section 2

* Changes made to Chapters 2, 3, 4,5 and 6

* Changes made to Sections 2, 4, 7 and Appendix

* Changes made to Chapter 6 and Appendix

* Changes made to Section 2

* update summary table for API

* add generated files

* Changes made to al sections

* Changes made to Section 2 and API

* Changes made to 2 and API

* Made changes to sections 1 and 2

* Issue#231 (#232)

* fix #225 passing transiant variable as axis

* Fix macOSX

* fix ESMF and NPY_STRING

* fix data._mask comparison for numpy 1.14

* failing test from vcs added here (#234)

* failing test from vcs added here

* ok test passes again

* reverted for now

* commented out test for @durack1

* Cdmsdocsmerge (#223)

* First cdms2 documentation revamp

* latest changes

* add new files and work on avariable documentations

* fix index order

* revamp documentation

* Fixing cdms documentation (docstrings)

* update documentation

* continue to work on docs

* sphinx doctest in manual.rst

* chapter 1 continu

* add requirments.txt for read-the-doc

* move requirements.txt into docs dir

* add requirements

* Chapter 2

* add chapter 3

* finish chapter 3 started chapter 4

* flake8 python files

* chapter 4 regridding

* cdms_4 doctest

* add other chapters

* finish chapter 4

* add chapter 5

* add chapter 6

* cdms chapter 6

* fix TOC

* add chapter 7 and appendix

* merge docs

* add requirements.txt

* remove cdat_info

* remote cdat_info

* fix latex_logo png

* pin pyopenssl to 17.2.0 due to myproxyclient failure in py3

* update TOC

* work on tables and setup

* try to force jquery 3.1

* just copy js script in _static

* add highlight python

* add sample dataset page

* add sample dataset page

* work on tables for cdms_2.rst

* continue cdms2 documentations

* update cdms2 tables

* update sections

* update table

* finish chapter 2

* fix litteral error

* unlink .dodsrc for cdscan

* First changes from Tanya

* some change in chapter 1 and 2

* some changes in Chapter 2

* fix tables

* Some changes to Chapter 2

* Some Changes to Chapter 2

* Some changes made to Chapters 1, 2 and 4

* Some changes to Chapter 2

* Some Changes made to Chapter 2

* Some changes to Chapters 2, 3 and 4

* Some changes made to 1 through Appendix

* Some Changes made to Chapter 2

* Some Changes to Chapters 1, 2, 3, 6 and Appendix

* Some changes made to Chapters 1 thru 7 and appendix

* Some changes to Chpaters 1, 2 and 3

* Changes made to Chapters 1, 4, 5 and Appendix

* Some changes to Chapter 2 and 4

* Some Changes to Images, Chapter 3 and Appendix

* update logo

* add my logo

* fix chapter 1 test

* Fix python3 slice issue(setitem) and flake8 (#243)

* fix python 3 aggregation issue and flake8 (#244)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* Netcdf46 (#249)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* try circleci unstable label

* try version 2 circleci

* try version 2 circleci

* change workflow name

* change cdtime to cdms

* add certificate to circleci

* add fix conda-upload in circleci 2.0

* update prep_for_build version

* fix curl command

* fix cicleci for cdms

* use unstable channel change uvcdat for cdat

* build cdms on circleci 2.0

* fix circleci config.yml

* change Users/distiler to /Users/denisnadeau

* add gcc_linux

* add LDSHARED for linux

* disable cert and py results

* add gcc_linux-64

* change cdscan link

* fix myproxy

* add esmf and esmpy to py3 env

* Revert "Netcdf46 (#249)" (#250)

This reverts commit a9e29ea.

* Netcdf46 (#251)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* try circleci unstable label

* try version 2 circleci

* try version 2 circleci

* change workflow name

* change cdtime to cdms

* add certificate to circleci

* add fix conda-upload in circleci 2.0

* update prep_for_build version

* fix curl command

* fix cicleci for cdms

* use unstable channel change uvcdat for cdat

* build cdms on circleci 2.0

* fix circleci config.yml

* change Users/distiler to /Users/denisnadeau

* add gcc_linux

* add LDSHARED for linux

* disable cert and py results

* add gcc_linux-64

* change cdscan link

* fix myproxy

* add esmf and esmpy to py3 env

* inverse dodsrc and curl commands

* move unlink above cdscan test

* fix ESGF test

* add new dodsrc files

* create dodsrc on-demand

* put back tests for unstable

* Netcdf46 (#252)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* try circleci unstable label

* try version 2 circleci

* try version 2 circleci

* change workflow name

* change cdtime to cdms

* add certificate to circleci

* add fix conda-upload in circleci 2.0

* update prep_for_build version

* fix curl command

* fix cicleci for cdms

* use unstable channel change uvcdat for cdat

* build cdms on circleci 2.0

* fix circleci config.yml

* change Users/distiler to /Users/denisnadeau

* add gcc_linux

* add LDSHARED for linux

* disable cert and py results

* add gcc_linux-64

* change cdscan link

* fix myproxy

* add esmf and esmpy to py3 env

* inverse dodsrc and curl commands

* move unlink above cdscan test

* fix ESGF test

* add new dodsrc files

* create dodsrc on-demand

* put back tests for unstable

* instal anaconda-client before calling conda-upload

* Changes made to API

* Made some changes to API

* Changes made to API

* Changes made to API

* Changes made to API

* Changes made to Section 2 and API

* Changes made to Section 2

* Changes made to Chapter 2

* Changes made to Section 2

* Changes made to Chapters 2, 3, 4,5 and 6

* Changes made to Sections 2, 4, 7 and Appendix

* Changes made to Chapter 6 and Appendix

* Changes made to Section 2

* Changes made to al sections

* Changes made to Section 2 and API

* Changes made to 2 and API

* Made changes to sections 1 and 2

* Issue#231 (#232)

* fix #225 passing transiant variable as axis

* Fix macOSX

* fix ESMF and NPY_STRING

* fix data._mask comparison for numpy 1.14

* Fix python3 slice issue(setitem) and flake8 (#243)

* fix python 3 aggregation issue and flake8 (#244)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* Netcdf46 (#249)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* try circleci unstable label

* try version 2 circleci

* try version 2 circleci

* change workflow name

* change cdtime to cdms

* add certificate to circleci

* add fix conda-upload in circleci 2.0

* update prep_for_build version

* fix curl command

* fix cicleci for cdms

* use unstable channel change uvcdat for cdat

* build cdms on circleci 2.0

* fix circleci config.yml

* change Users/distiler to /Users/denisnadeau

* add gcc_linux

* add LDSHARED for linux

* disable cert and py results

* add gcc_linux-64

* change cdscan link

* fix myproxy

* add esmf and esmpy to py3 env

* Revert "Netcdf46 (#249)" (#250)

This reverts commit a9e29ea.

* Netcdf46 (#251)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* try circleci unstable label

* try version 2 circleci

* try version 2 circleci

* change workflow name

* change cdtime to cdms

* add certificate to circleci

* add fix conda-upload in circleci 2.0

* update prep_for_build version

* fix curl command

* fix cicleci for cdms

* use unstable channel change uvcdat for cdat

* build cdms on circleci 2.0

* fix circleci config.yml

* change Users/distiler to /Users/denisnadeau

* add gcc_linux

* add LDSHARED for linux

* disable cert and py results

* add gcc_linux-64

* change cdscan link

* fix myproxy

* add esmf and esmpy to py3 env

* inverse dodsrc and curl commands

* move unlink above cdscan test

* fix ESGF test

* add new dodsrc files

* create dodsrc on-demand

* put back tests for unstable

* Netcdf46 (#252)

* Fix python3 slice issue(setitem) and flake8

* update to libnetcdf 4.6

* try circleci unstable label

* try version 2 circleci

* try version 2 circleci

* change workflow name

* change cdtime to cdms

* add certificate to circleci

* add fix conda-upload in circleci 2.0

* update prep_for_build version

* fix curl command

* fix cicleci for cdms

* use unstable channel change uvcdat for cdat

* build cdms on circleci 2.0

* fix circleci config.yml

* change Users/distiler to /Users/denisnadeau

* add gcc_linux

* add LDSHARED for linux

* disable cert and py results

* add gcc_linux-64

* change cdscan link

* fix myproxy

* add esmf and esmpy to py3 env

* inverse dodsrc and curl commands

* move unlink above cdscan test

* fix ESGF test

* add new dodsrc files

* create dodsrc on-demand

* put back tests for unstable

* instal anaconda-client before calling conda-upload

* Fix table titles

* Change made to Section 4

* fix bindex issue in hgrid

* Changes to all

* Corrections made to API Lib

* Changes to API

* fix ascii art

* Changes to Sections 2, 4 and 5

* Changes made to all

* Changes made to Sections 2, 6 and Appendix

* Changes made to Section 2

* Changes made to Section 2

* Changes made to Section 2 and 5

* Changes to Sections 2, 6 and 7

* Changes to API

* Changes made to API

* Made Changes to API

* Changes made to API

* Changes made to Section 4 and 7

* Changes made to API

* Changes made to API

* Revisit run tests (#262)

* migrate run_tests.py to use TestRunnerBase

* remove accidentally added tests/coverage.json

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* revisit run_tests.py

* add cacert.pem in run_tests.py when running cdms test within the lab

* add cacert.pem in run_tests.py when running cdms test within the lab

* add cacert.pem in run_tests.py when running cdms test within the lab

* add cacert.pem in run_tests.py when running cdms test within the lab - rerun tests

* add cacert.pem in run_tests.py when running cdms test within the lab - remove install from -c cdat/label/unstable

* put back -c cdat/label/unstable

* fix Axis.py

* update documentation

* fix environment dependencies

* add/remote generated files

* try to fix API.rst

* add regrid2 to docs

* Changes made to API

* fix space with parameters

* fix readthedocs using numpydoc

* update environment

* fix some autodocs

* add hgrid

* Changes made to API

* Changes made to API

* fix avariable bad location methods

* Changes to Appendix and API

* Changes to Chapter 1 and 2

* Changes made to Section 2

* Changes made to Section 2

* Changes made to Section 2

* Changes to sections 1, 2, 3 and 4

* Changes to section 2

* Changes made to entire docuemnt

* Changes to Section 1 and 2

* Changes made to Section 2

* Changes made to Sections 2 thru 6

* Changes made to Chapters 3 and 6

* add jupyter notebook

* Changes to all

* Changes to Jupyter Notebooks

* Changes to all

* update documentation for version 3.1.0

* merge documentations

* change banner and sidebar colors

* Changes to API

* fix style sheet

* Changes to API

* Changes to API

* Changes to API and Sections

* Changes to all

* will this fix master? (#292)

* Changes to Sections 1 and 2

* fix cdtime and scripts

* trigger read-the-docs

* fix more cdtime doc issues

* fix typo Default-Calendar

* fix conflicts

* pass flake8

* udpate chapter1

* Changes

* add jupyter notebook

* jupyter chapter1 fixed

* cleanup chapter 1 jupyter

* add tmp_T42_to_POP43_conserv file

* chapter 2 and chapter 3

* Changes to Jupyter Notebooks 1 and 2

* clean up

* update chapter4

* chapter 4 regridder opendap

* chapter 2 using OpenDAP

* chapter 2 using OpenDAP

* update all chapters

* add chapter4

* Changes to Jupiter Notebooks 1 and 2

* Changes to Jupyter Notebooks 1a and 2a

* Changes to Jupyter Notebooks 1a, 2a, 3a, 4a

* Changes to Jupyter Notebooks 1a, 2a, 3a,4a, 5a

* Changes to Jupyter Notebooks 1a thru 4a

* Changes to Section 1, 2

* Changes to Sections 1 and 2

* Changes to Sections 1-3

* Changes to Jupyter Notebooks

* Changes to Chapters 2, 5 and 6

* Changes to Sections 1 and 2

* Changes to API

* fix double Notes section

* Changes to API

* Changes made to API

* Change to API

* Changes to API

* Changes to API

* Changes to Sections

* Changes to Sections

* Changes to Section 1

* Changes to all

* Changes to Sections 2 and 4

* flake8 files

* Changes to sections

* update readthedocs to py3

* update environment.yml to 3.1.2

* fix environment.yml for readthedocs

* add easydev to readthedocs env yaml

* change sys.prefix to 3.7

* try to add lazy-object and change env

* enable javascript button
  • Loading branch information
dnadeau4 committed Apr 10, 2019
1 parent 58bd609 commit 2305c62
Show file tree
Hide file tree
Showing 9 changed files with 733 additions and 1,181 deletions.
244 changes: 102 additions & 142 deletions docs/source/manual/cdms_1.rst

Large diffs are not rendered by default.

1,106 changes: 346 additions & 760 deletions docs/source/manual/cdms_2.rst

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions docs/source/manual/cdms_3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Time Types
The ``cdtime`` module implements the CDMS time types, methods, and
calendars. These are made available with the command:

.. doctest::
::

>>> import cdtime

Expand Down Expand Up @@ -77,11 +77,11 @@ Time Constructors
^^^^^^^^^^^^^^^^^

The following table describes the methods for creating time types.

Time Constructors
~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Type", "Constructor", "Defintion"
:widths: 10, 40, 80
:align: left
Expand All @@ -103,7 +103,7 @@ A component time type has six members, all of which are settable.

Component Time
~~~~~~~~~~~~~~
.. csv-table::
.. csv-table::
:header: "Type", "Name", "Summary"
:widths: 15, 15, 50

Expand All @@ -121,113 +121,113 @@ The following methods apply both to relative and component times.

Time Methods
~~~~~~~~~~~~
.. csv-table::
.. csv-table::
:header: "Type", "Method", "Definition"
:widths: 35, 42, 80
:align: left

"Comptime or Reltime", "``t.add(value,intervalUnits, cdtime.DefaultCalendar)``", "Add an interval of time to a time type t.
"Comptime or Reltime", "``t.add(value,intervalUnits, cdtime.DefaultCalendar)``", "Add an interval of time to a time type t.
Returns the same type of time.
* ``value`` is the Float number of interval units.
* ``intervalUnits`` is ``cdtime.
* [Second (s) | Minute(s) Hour(s) | Day(s) | Week(s) | Month(s) | Season(s) | Year(s) ]``
* ``calendar`` is the calendar type."
"Integer", "``t.cmp(t2, cdtime.DefaultCalendar)``", "Compare time values t and t2.
"Integer", "``t.cmp(t2, cdtime.DefaultCalendar)``", "Compare time values t and t2.
Returns -1, 0, 1 as t is less than, equal to,
or greater than t2 respectively.
* ``t2`` is the time to compare.
* ``calendar`` is the calendar type."
"Comptime or Reltime", "``t.sub(value,intervalUnits, cdtime.DefaultCalendar)``", "Subtract an interval of time from a time type t.
"Comptime or Reltime", "``t.sub(value,intervalUnits, cdtime.DefaultCalendar)``", "Subtract an interval of time from a time type t.
Returns the same type of time.
* ``value`` is the Float number of interval units.
* ``intervalUnits`` is cdtime.[Second (s) | Minute(s) | Hour(s) | Day(s) | Week(s) | Month(s) | Season(s) | Year(s)]
* ``calendar`` is the calendar type. "
"Comptime", "``t.tocomp(cdtime.DefaultCalendar)``", "Convert to component time.
"Comptime", "``t.tocomp(cdtime.DefaultCalendar)``", "Convert to component time.
Returns the equivalent component time.
* ``calendar`` is the calendar type."
"Reltime", "``t.torel(units, cdtime.DefaultCalendar)``", "Convert to relative time.
"Reltime", "``t.torel(units, cdtime.DefaultCalendar)``", "Convert to relative time.
Returns the equivalent relative time."


Examples
^^^^^^^^
::

::

>>> import cdtime
>>> c = cdtime.comptime(1996,2,28)
>>> r = cdtime.reltime(28,"days since 1996-1-1")
>>> r = cdtime.reltime(28,"days since 1996-1-1")
>>> print r.add(1, cdtime.Day)
29.000000 days since 1996-1-1
>>> print c.add(36, cdtime.Hours)
1996-2-29 12:0:0.0
1996-2-29 12:0:0.0


**Note:** When adding or subtracting intervals of months or years, only the month and year of the result are significant. The reason is that intervals in months/years are not commensurate with intervals in days or fractional days. This leads to results that may be surprising.

..
::

>>> c = comptime(1979,8,31)
>>> c.add(1, cdtime.Month)
1979-9-1 0:0:0.0


>>> c = comptime(1979,8,31)
>>> c.add(1, cdtime.Month)
1979-9-1 0:0:0.0

In other words, the day component of c was ignored in the addition, and the day/hour/minute components of the results are just the defaults. If the interval is in years, the interval is converted internally to months:

In other words, the day component of c was ignored in the addition, and the day/hour/minute components of the results are just the defaults. If the interval is in years, the interval is converted internally to months:

..
::

>>> c = comptime(1979,8,31)
>>> c.add(2, cdtime.Years)
1981-8-1 0:0:0.0
>>> c = comptime(1979,8,31)
>>> c.add(2, cdtime.Years)
1981-8-1 0:0:0.0

Compare time values.

..

>>> import cdtime
>>> r = cdtime.reltime(28,"days since 1996-1-1")
>>> c = cdtime.comptime(1996,2,28)
>>> print c.cmp(r)
::

>>> import cdtime
>>> r = cdtime.reltime(28,"days since 1996-1-1")
>>> c = cdtime.comptime(1996,2,28)
>>> print c.cmp(r)
1
>>> print r.cmp(c)
-1
>>> print r.cmp(r)
1

.. >>> print r.cmp(c)
.. -1
.. >>> print r.cmp(r)
.. 1
Subtract an interval of time.

..
::

>>> import cdtime
>>> r = cdtime.reltime(28, "days since 1996-1-1")
>>> c = cdtime.comptime(1996, 2, 28)
>>> print r.sub(10, cdtime.Days)
18.000000 days since 1996-1-1
>>> print c.sub(30, cditme.Days)
1996-1-29 0:0:0.0

>>> r = cdtime.reltime(28, "days since 1996-1-1")
>>> c = cdtime.comptime(1996, 2, 28)
>>> print r.sub(10, cdtime.Days)
18.000000 days since 1996-1-1
>>> print c.sub(30, cditme.Days)
1996-1-29 0:0:0.0


For intervals of years or months, see the **note** under add() in the example above.

Convert to component time.

..
::

>>> r = cdtime.reltime(28,"days since 1996-1-1")
>>> r = cdtime.reltime(28,"days since 1996-1-1")
>>> r.tocomp()
1996-1-29 0:0:0.0
1996-1-29 0:0:0.0


Convert to relative time.

..
>>> c = comptime(1996,2,28)
>>> print c.torel("days since 1996-1-1")
58.000000 days since 1996-1-1
>>> r = reltime(28,"days since 1996-1-1")
>>> print r.torel("days since 1995")
393.000000 days since 1995
>>> print r.torel("days since 1995").value
393.0
::

>>> c = comptime(1996,2,28)
>>> print c.torel("days since 1996-1-1")
58.000000 days since 1996-1-1
>>> r = reltime(28,"days since 1996-1-1")
>>> print r.torel("days since 1995")
393.000000 days since 1995
>>> print r.torel("days since 1995").value
393.0

58 changes: 29 additions & 29 deletions docs/source/manual/cdms_4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ SCRIP Horizontal Regridder

To interpolate between grids where one or both grids is non-rectangular,
CDMS provides an interface to the SCRIP regridder package developed at
Los Alamos National Laboratory (https://oceans11.lanl.gov/trac/SCRIP).
Los Alamos National Laboratory (https://oceans11.lanl.gov/trac/SCRIP).

Figure 3 illustrates the process:

Expand Down Expand Up @@ -159,12 +159,12 @@ In this example:

>>> &remap_inputs
>>> num_maps = 1
>>>
>>>
>>> grid1_file = 'remap_grid_T42.nc'
>>> grid2_file = 'remap_grid_POP43.nc'
>>> interp_file1 = 'rmp_T42_to_POP43_conserv.nc'
>>> interp_file2 = 'rmp_POP43_to_T42_conserv.nc'
>>> map1_name = 'T42 to POP43 Conservative Mapping'
>>> map1_name = 'T42 to POP43 Conservative Mapping'
>>> map2_name = 'POP43 to T42 Conservative Mapping'
>>> map_method = 'conservative'
>>> normalize_opt = 'frac'
Expand Down Expand Up @@ -303,14 +303,14 @@ input to output grids.
CDMS Regridder Constructor
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Constructor", "Description"
:widths: 50, 90
:align: left

"``regridFunction = Regridder(inputGrid, outputGrid)``", "Create a regridder function which interpolates a data array from
input to output grid.
* `CDMS regridder functions`_ describes the calling sequence of this function.
* `CDMS regridder functions`_ describes the calling sequence of this function.
* ``inputGrid`` and ``outputGrid`` are CDMS grid objects.
**Note:** To set the mask associated with inputGrid or outputGrid, use the grid setMask function."

Expand All @@ -323,7 +323,7 @@ function:
SCRIP Regridder Constructor
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Constructor", "Description"
:widths: 80, 90
:align: left
Expand All @@ -337,7 +337,7 @@ SCRIP Regridder Constructor
* ``'distwgt'``: distance-weighted interpolation.
* It is only necessary to specify the map method if it is not defined in the file.
* If ``checkGrid`` is 1 (default), the grid cells are checked for convexity, and 'repaired' if necessary.
* Grid cells may appear to be nonconvex if they cross a ``0 / 2pi`` boundary.
* Grid cells may appear to be nonconvex if they cross a ``0 / 2pi`` boundary.
* The repair consists of shifting the cell vertices to the same side modulo 360 degrees."

Regridder Functions
Expand All @@ -358,7 +358,7 @@ A CDMS regridder function is an instance of the CDMS ``Regridder``
class. The function is associated with rectangular input and output
grids. Typically its use is straightforward:
* The function is passed an input array and returns the regridded array.
However, when the array has missing data, or the input and/or output
However, when the array has missing data, or the input and/or output
grids are masked, the logic becomes more complicated.

Step 1
Expand Down Expand Up @@ -407,7 +407,7 @@ grid cells which completely overlap input grid cells with missing values
CDMS Regridder Function
~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Type", "Function", "Description"
:widths: 40, 40, 80
:align: left
Expand All @@ -425,13 +425,13 @@ CDMS Regridder Function
* ``order`` is a string indicating the order of dimensions of the array. It has the form returned from ``variable.getOrder().``
* ``mask`` is a Numpy array, of datatype Integer or Float, consisting of a fractional number between 0 and 1.
* A value of 1 or 1.0 indicates that the corresponding data value is to be ignored for purposes of regridding.
* A value of 0 or 0.0 indicates that the corresponding data value is valid. This is consistent with the convention for masks used by the MV2 module.
* A value of 0 or 0.0 indicates that the corresponding data value is valid. This is consistent with the convention for masks used by the MV2 module.
* A fractional value between 0.0 and 1.0 indicates the fraction of the data value (e.g., the corresponding cell) to be ignored when regridding. This is useful if a variable is regridded first to grid A and then to another grid B; the mask when regridding from A to B would be (1.0 - f) where f is the maskArray returned from the initial grid operation using the ``returnTuple`` argument."

DMS Regridder Function(cont'd)
~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Type", "Function", "Description"
:widths: 40, 40, 80
:align: left
Expand All @@ -442,10 +442,10 @@ DMS Regridder Function(cont'd)
Variable, a TransientVariable of the same
rank as the input array is returned, otherwise
a masked array is returned.
* If ``mask`` is two-dimensional of the same shape as the input grid, it overrides the mask of the input grid.
* If the ``mask`` has more than two dimensions, it must have the same shape as ``array``. In this case, the ``missing`` data value is also ignored. Such an ndimensional mask is useful if the pattern of missing data varies with level (e.g., ocean data) or time.
* If ``mask`` is two-dimensional of the same shape as the input grid, it overrides the mask of the input grid.
* If the ``mask`` has more than two dimensions, it must have the same shape as ``array``. In this case, the ``missing`` data value is also ignored. Such an ndimensional mask is useful if the pattern of missing data varies with level (e.g., ocean data) or time.
**Note:** If neither ``missing`` or ``mask`` is set, the default mask is obtained from the mask of the array if any."
"Array, Array", "``regridFunction (ar, missing=None, order=None, mask=None, returnTuple=1)``", "If called with the optional ``returnTuple``
"Array, Array", "``regridFunction (ar, missing=None, order=None, mask=None, returnTuple=1)``", "If called with the optional ``returnTuple``
argument equal to 1, the function returns a tuple ``dataArray``, ``maskArray``).
* ``dataArray`` is the result data array.
* ``maskArray`` is a Float32 array of the same shape as ``dataArray``, such that ``maskArray[i,j]`` is fraction of the output grid cell [i,j] overlapping a non-missing cell of the grid."
Expand Down Expand Up @@ -494,23 +494,23 @@ for source and target grids.
SCRIP Regridder Functions
~~~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Return Type", "Method", "Description"
:widths: 30, 45, 80
:align: left

"Array or Transient-Variable", "[conservative, bilinear, and distance-weighted regridders] ``regridFunction(array)``", "Interpolate a gridded data array to a new grid.
The return value is the regridded data variable.
"Array or Transient-Variable", "[conservative, bilinear, and distance-weighted regridders] ``regridFunction(array)``", "Interpolate a gridded data array to a new grid.
The return value is the regridded data variable.
* ``array`` is a Variable, MaskedArray, or Numpy array.
* The rank of the array may be greater than the rank of the input grid, in which case the input grid shape must match a trailing portion of the array shape.
* For example, if the input grid is curvilinear with shape (64,128), the last two dimensions of the array must match.
* The rank of the array may be greater than the rank of the input grid, in which case the input grid shape must match a trailing portion of the array shape.
* For example, if the input grid is curvilinear with shape (64,128), the last two dimensions of the array must match.
* Similarly, if the input grid is generic with shape (2560,), the last dimension of the array must have that length."
"Array or Transient-Variable", "[bicubic regridders] ``regridFunction(array, gradientLat, gradientLon, gradientLatLon)``", "Interpolate a gridded data array to a new grid,
using a bicubic regridder.
using a bicubic regridder.
The return value is the regridded data variable.
* ``array`` is a Variable, MaskedArray, or Numpy array.
* The rank of the array may be greater than the rank of the input grid, in which case the input grid shape must match a trailing portion of the array shape.
* For example, if the input grid is curvilinear with shape (64,128), the last two dimensions of the array must match.
* ``array`` is a Variable, MaskedArray, or Numpy array.
* The rank of the array may be greater than the rank of the input grid, in which case the input grid shape must match a trailing portion of the array shape.
* For example, if the input grid is curvilinear with shape (64,128), the last two dimensions of the array must match.
* Simiarly, if the input grid is generic with shape (2560,), the last dimension of the array must have that length.
* ``gradientLat``: df/di (see the SCRIP documentation). Same shape as ``array``.
* ``gradientLon``: df/dj. Same shape as ``array``.
Expand All @@ -519,21 +519,21 @@ SCRIP Regridder Functions
SCRIP Regridder Functions(con'td)
~~~~~~~~~~~~~~~~~~~~~~~~~

.. csv-table::
.. csv-table::
:header: "Return Type", "Method", "Description"
:widths: 30, 45, 80
:align: left


"Numpy array", "``getDestinationArea()`` [conservative regridders only]", "Return the area of the destination (output) grid cell.
"Numpy array", "``getDestinationArea()`` [conservative regridders only]", "Return the area of the destination (output) grid cell.
* The array is 1-D, with length equal to the number of cells in the output grid."
"Numpy array", "``getDestination Fraction()``", "Return the area fraction of the destination (output)
grid cell that participates in the regridding.
grid cell that participates in the regridding.
* The array is 1-D, with length equal to the number of cells in the output grid."
"CurveGrid or Generic-Grid", "``getInputGrid()``", "Return the input grid, or None if no input grid is associated with the regridder."
"CurveGrid or Generic-Grid", "``getOutputGrid()``", "Return the output grid."
"Numpy array", "``getSourceFraction()``", "Return the area fraction of the source (input)
grid cell that participates in the regridding.
grid cell that participates in the regridding.
* The array is 1-D, with length equal to the number of cells in the input grid"

Examples
Expand All @@ -548,7 +548,7 @@ Regrid data to a uniform output grid.

::


>>> import cdms2
>>> from regrid2 import Regridder
>>> f = cdms2.open('clt.nc')
Expand Down Expand Up @@ -645,7 +645,7 @@ Generate an array of zonal mean values.
Regrid an array with missing data, and calculate the area-weighted mean
of the result.

::
::

>>> import cdms2
>>> from cdms2.MV2 import *
Expand Down
Loading

0 comments on commit 2305c62

Please sign in to comment.