Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstanya #318

Merged
merged 337 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
337 commits
Select commit Hold shift + click to select a range
3583767
Some changes to Regrid 2, Lib, esmf, gsRegrid and horizontal
reshel3 Apr 16, 2018
89bd18b
Changes made to Chapters 1-7 and sample data
reshel3 Apr 16, 2018
66d4289
fix API documentation
reshel3 Apr 17, 2018
2e9414a
rename regrid2 directory and delete print message
reshel3 Apr 17, 2018
02b9195
add module API files
reshel3 Apr 17, 2018
d12d82f
add future and mock requirements
reshel3 Apr 17, 2018
adf2dcb
get cwd for readthedocs
reshel3 Apr 17, 2018
3724fb7
Changes made to API
reshel3 Apr 18, 2018
e252f48
Changes made to API
reshel3 Apr 20, 2018
ffce80d
Changes made to API
reshel3 Apr 20, 2018
1760785
Changes to API
reshel3 Apr 23, 2018
1b4d412
test rtd with mock
dnadeau4 Apr 24, 2018
34973dd
add future for readthedocs
dnadeau4 Apr 24, 2018
79f5c12
create git.py in ../..
dnadeau4 Apr 24, 2018
6c2f9b9
fix conflicts
dnadeau4 Apr 24, 2018
bdb5db6
add esmf
dnadeau4 Apr 24, 2018
62c24f7
add print statements for regrid2
dnadeau4 Apr 24, 2018
2846cfc
add print for libregrid2
dnadeau4 Apr 24, 2018
43e42eb
restore regrid2.Lib for readthedocs
dnadeau4 Apr 24, 2018
463c721
add mock modules
dnadeau4 Apr 24, 2018
62e160f
add git.py
dnadeau4 Apr 24, 2018
1b12f72
try with new mock list
dnadeau4 Apr 24, 2018
932d66f
force git.py
dnadeau4 Apr 24, 2018
9275ecd
force git.py
dnadeau4 Apr 24, 2018
c2baa86
try readthedocs.yml file
dnadeau4 Apr 24, 2018
970bb4e
fix readthedocs maping file
dnadeau4 Apr 24, 2018
92b39e6
change type pdb to pdf
dnadeau4 Apr 24, 2018
b0df74f
typo requirements.yml
dnadeau4 Apr 24, 2018
26661a8
add dependencies
dnadeau4 Apr 24, 2018
721da2d
add dependencies and change conf.yml
dnadeau4 Apr 24, 2018
2dc4acc
change API.rst and other rst files
dnadeau4 Apr 24, 2018
9d1487a
Changes to API
reshel3 Apr 24, 2018
3cf5491
UVCDAT_ANONYMOUS_LOG set to false
dnadeau4 Apr 24, 2018
443d7f5
check if git.py is there
dnadeau4 Apr 25, 2018
92fa468
add gcc to environment.yml
dnadeau4 Apr 25, 2018
eeb7777
try docker environment.yml
dnadeau4 Apr 25, 2018
3cac37b
remove git.py
dnadeau4 Apr 25, 2018
7c7b5c9
fix conflicts
dnadeau4 Apr 25, 2018
8952fb1
chage Libregrid to regrid2
dnadeau4 Apr 25, 2018
8ae28f7
revert
dnadeau4 Apr 25, 2018
0c6e809
revert
dnadeau4 Apr 25, 2018
2d12952
add cdms2 class
Apr 25, 2018
ad98288
delet cdms2 class
Apr 25, 2018
7c311f2
delet cdms2 class
Apr 25, 2018
0b340e5
change conf.py os.path
Apr 25, 2018
67cf584
Changes to API
reshel3 Apr 26, 2018
401b6cb
Changes made to API
reshel3 Apr 30, 2018
49c6890
Changes to API
reshel3 Apr 30, 2018
297d386
Changes made to API
reshel3 May 1, 2018
72414f2
Changes to API
reshel3 May 2, 2018
735a306
Changes made to API
reshel3 May 3, 2018
8ad34b5
Changes made to API
reshel3 May 9, 2018
10ddc5b
Changes to API
reshel3 May 16, 2018
12c2f0e
Changes to API
reshel3 May 16, 2018
3074964
Changes made to API
reshel3 May 17, 2018
b9e04a6
Changes made to API
reshel3 May 18, 2018
651ae1c
Changes made to API
reshel3 May 21, 2018
222ab4d
Merge branch 'docstanya' into readthedocstest
dnadeau4 May 22, 2018
1c91ea5
push latest rst files
reshel3 May 22, 2018
e13b988
Merge branch 'readthedocstest' of github.com:UV-CDAT/cdms into readth…
dnadeau4 May 22, 2018
8cd77b9
Merge branch 'docstanya' into readthedocstest
dnadeau4 May 22, 2018
6155ef0
Changes made to API
reshel3 May 23, 2018
521fb97
Made some changes to API
reshel3 May 24, 2018
7302fd9
update documentations
dnadeau4 May 29, 2018
ca61e5d
Changes made to API
reshel3 May 29, 2018
e737c89
Changes made to API
reshel3 May 30, 2018
a7063e2
Changes made to API
reshel3 May 31, 2018
3cb0aad
Changes made to Section 2 and API
reshel3 Jun 1, 2018
7878e53
Changes made to Section 2
reshel3 Jun 4, 2018
e8077bb
Changes made to Chapter 2
reshel3 Jun 5, 2018
a27487c
Changes made to Section 2
reshel3 Jun 6, 2018
7d0bd02
Changes made to Chapters 2, 3, 4,5 and 6
reshel3 Jun 7, 2018
4523dc2
Changes made to Sections 2, 4, 7 and Appendix
reshel3 Jun 11, 2018
e550c14
Changes made to Chapter 6 and Appendix
reshel3 Jun 12, 2018
554bd4c
Changes made to Section 2
reshel3 Jun 13, 2018
506ccb8
update summary table for API
dnadeau4 Jun 14, 2018
16f6fdd
add generated files
dnadeau4 Jun 14, 2018
5a7ebdc
Merge branch 'master' into docstanya
reshel3 Jun 14, 2018
6ae47a2
Changes made to al sections
reshel3 Jun 14, 2018
ba79685
Changes made to Section 2 and API
reshel3 Jun 15, 2018
765dd6f
Changes made to 2 and API
reshel3 Jun 18, 2018
a016201
Made changes to sections 1 and 2
reshel3 Jun 19, 2018
1b51879
Issue#231 (#232)
dnadeau4 Mar 7, 2018
3d614dd
failing test from vcs added here (#234)
doutriaux1 Mar 13, 2018
e2a12a8
Cdmsdocsmerge (#223)
dnadeau4 Mar 29, 2018
f32c86b
Fix python3 slice issue(setitem) and flake8 (#243)
dnadeau4 May 1, 2018
7ced34c
fix python 3 aggregation issue and flake8 (#244)
dnadeau4 May 2, 2018
9d5b7d2
Netcdf46 (#249)
dnadeau4 Jun 6, 2018
f18e8aa
Revert "Netcdf46 (#249)" (#250)
dnadeau4 Jun 6, 2018
074b412
Netcdf46 (#251)
dnadeau4 Jun 12, 2018
c9dd25e
Netcdf46 (#252)
dnadeau4 Jun 12, 2018
a378f31
Changes made to API
reshel3 May 23, 2018
5ffe9de
Made some changes to API
reshel3 May 24, 2018
6442448
Changes made to API
reshel3 May 29, 2018
93b206e
Changes made to API
reshel3 May 30, 2018
c390ee6
Changes made to API
reshel3 May 31, 2018
1b5ad8a
Changes made to Section 2 and API
reshel3 Jun 1, 2018
e9792fb
Changes made to Section 2
reshel3 Jun 4, 2018
01ba90a
Changes made to Chapter 2
reshel3 Jun 5, 2018
691b110
Changes made to Section 2
reshel3 Jun 6, 2018
519add2
Changes made to Chapters 2, 3, 4,5 and 6
reshel3 Jun 7, 2018
b4f6628
Changes made to Sections 2, 4, 7 and Appendix
reshel3 Jun 11, 2018
a294133
Changes made to Chapter 6 and Appendix
reshel3 Jun 12, 2018
08f62a5
Changes made to Section 2
reshel3 Jun 13, 2018
5158373
Changes made to al sections
reshel3 Jun 14, 2018
46e564f
Changes made to Section 2 and API
reshel3 Jun 15, 2018
134054c
Changes made to 2 and API
reshel3 Jun 18, 2018
a473fe3
Made changes to sections 1 and 2
reshel3 Jun 19, 2018
c2d8bd3
Issue#231 (#232)
dnadeau4 Mar 7, 2018
44add33
Fix python3 slice issue(setitem) and flake8 (#243)
dnadeau4 May 1, 2018
405fe24
fix python 3 aggregation issue and flake8 (#244)
dnadeau4 May 2, 2018
e1b587f
Netcdf46 (#249)
dnadeau4 Jun 6, 2018
97279be
Revert "Netcdf46 (#249)" (#250)
dnadeau4 Jun 6, 2018
f6ca669
Netcdf46 (#251)
dnadeau4 Jun 12, 2018
180f9e1
Netcdf46 (#252)
dnadeau4 Jun 12, 2018
7bf205a
fix conflict with master
dnadeau4 Jun 20, 2018
09d70ec
Fix table titles
reshel3 Jun 20, 2018
f6d99e3
Change made to Section 4
reshel3 Jun 21, 2018
ced9db6
fix bindex issue in hgrid
dnadeau4 Jun 25, 2018
8d2c194
Changes to all
reshel3 Jun 25, 2018
9dca0db
Corrections made to API Lib
reshel3 Jun 25, 2018
89b22f9
Changes to API
reshel3 Jun 25, 2018
0827d3b
fix ascii art
dnadeau4 Jun 26, 2018
f2b2e65
Changes to Sections 2, 4 and 5
reshel3 Jun 26, 2018
cdff139
Changes made to all
reshel3 Jun 27, 2018
529535e
Fix Conflict
reshel3 Jun 27, 2018
7dfb910
Changes made to Sections 2, 6 and Appendix
reshel3 Jun 28, 2018
3e67e57
Changes made to Section 2
reshel3 Jul 2, 2018
01fb416
Changes made to Section 2
reshel3 Jul 9, 2018
bac2fa4
Changes made to Section 2 and 5
reshel3 Jul 11, 2018
66eaa55
Changes to Sections 2, 6 and 7
reshel3 Jul 12, 2018
46ea27d
Changes to API
reshel3 Jul 25, 2018
28dbb4f
Changes made to API
reshel3 Jul 25, 2018
5819332
Made Changes to API
reshel3 Jul 25, 2018
99dd8f5
Changes made to API
reshel3 Jul 30, 2018
2d71dd9
Changes made to Section 4 and 7
reshel3 Jul 31, 2018
bdd5968
Changes made to API
reshel3 Aug 7, 2018
7c10798
Changes made to API
reshel3 Aug 8, 2018
556d92f
Revisit run tests (#262)
muryanto1 Aug 8, 2018
82142bd
merge master
dnadeau4 Aug 20, 2018
d474e9c
fix Axis.py
dnadeau4 Aug 20, 2018
6e40d4c
update documentation
reshel3 Aug 20, 2018
cbb943e
fix environment dependencies
reshel3 Aug 21, 2018
794a5e5
add/remote generated files
reshel3 Aug 21, 2018
4bddf04
try to fix API.rst
reshel3 Aug 21, 2018
ff931a7
add regrid2 to docs
reshel3 Aug 21, 2018
b049359
Changes made to API
reshel3 Aug 21, 2018
f300870
fix space with parameters
reshel3 Aug 21, 2018
3ca9877
fix readthedocs using numpydoc
reshel3 Aug 21, 2018
493d2c1
update environment
reshel3 Aug 21, 2018
304b3f1
fix some autodocs
reshel3 Aug 22, 2018
ffc6f2e
add hgrid
reshel3 Aug 22, 2018
58cadd7
Changes made to API
reshel3 Aug 22, 2018
86caf86
Changes made to API
reshel3 Aug 23, 2018
21d5e47
Merge branch 'master' into docstanya
dnadeau4 Aug 28, 2018
4def393
fix avariable bad location methods
dnadeau4 Aug 28, 2018
f3c72ff
Changes to Appendix and API
reshel3 Aug 29, 2018
7ee9c2e
Changes to Chapter 1 and 2
reshel3 Aug 30, 2018
eb38903
Changes made to Section 2
reshel3 Sep 4, 2018
75c3f41
Changes made to Section 2
reshel3 Sep 5, 2018
16c2397
Changes made to Section 2
reshel3 Sep 6, 2018
8753cc2
Changes to sections 1, 2, 3 and 4
reshel3 Sep 10, 2018
eb9ee84
Changes to section 2
reshel3 Sep 11, 2018
b39bb62
Changes made to entire docuemnt
reshel3 Sep 17, 2018
96cd85d
Changes to Section 1 and 2
reshel3 Sep 18, 2018
6de4bf7
Changes made to Section 2
reshel3 Sep 20, 2018
241ff9f
Changes made to Sections 2 thru 6
reshel3 Sep 27, 2018
085b28c
Changes made to Chapters 3 and 6
reshel3 Oct 4, 2018
451a012
add jupyter notebook
reshel3 Oct 18, 2018
0fbeaba
Changes to all
reshel3 Oct 24, 2018
dd65dfd
Changes to Jupyter Notebooks
reshel3 Nov 6, 2018
06f672c
Changes to all
reshel3 Nov 7, 2018
0e1e668
fix conflict merge master
dnadeau4 Nov 8, 2018
193e42a
update documentation for version 3.1.0
dnadeau4 Nov 9, 2018
5216d3b
Merge branch 'master' into docstanya
dnadeau4 Nov 9, 2018
b7a23ec
merge documentations
dnadeau4 Nov 9, 2018
e1a9e29
Merge branch 'master' into docstanya
dnadeau4 Nov 13, 2018
46a8b5f
change banner and sidebar colors
dnadeau4 Nov 13, 2018
866a225
Changes to API
reshel3 Nov 13, 2018
c1f98a9
fix style sheet
dnadeau4 Nov 14, 2018
f444406
Changes to API
reshel3 Nov 14, 2018
aea7a3e
Changes to API
reshel3 Nov 15, 2018
69de7c1
Changes to API and Sections
reshel3 Nov 19, 2018
64cc035
Changes to all
reshel3 Nov 28, 2018
8006c3c
will this fix master? (#292)
doutriaux1 Nov 14, 2018
24130a4
Merge branch 'master' into docstanya
Nov 29, 2018
9297ece
Changes to Sections 1 and 2
reshel3 Dec 10, 2018
e3da499
fix cdtime and scripts
reshel3 Jan 4, 2019
8cf4121
Merge branch 'docstanya' of github.com:CDAT/cdms into docstanya
reshel3 Jan 4, 2019
743d60e
fix conflicts
reshel3 Jan 4, 2019
a87283c
trigger read-the-docs
reshel3 Jan 4, 2019
df6905e
fix more cdtime doc issues
reshel3 Jan 5, 2019
da1e5eb
fix typo Default-Calendar
reshel3 Jan 5, 2019
86b4c45
fix conflicts
reshel3 Jan 5, 2019
c6b2a6c
pass flake8
reshel3 Jan 5, 2019
480448f
udpate chapter1
dnadeau4 Jan 17, 2019
b56141c
Changes
reshel3 Jan 17, 2019
f90018e
add jupyter notebook
reshel3 Jan 17, 2019
fadf374
jupyter chapter1 fixed
dnadeau4 Jan 19, 2019
1f823a4
Merge branch 'docstanya2' of github.com:cdat/cdms into docstanya2
dnadeau4 Jan 19, 2019
b79e956
cleanup chapter 1 jupyter
dnadeau4 Jan 19, 2019
bbac945
add tmp_T42_to_POP43_conserv file
dnadeau4 Jan 19, 2019
39d275c
chapter 2 and chapter 3
dnadeau4 Jan 23, 2019
6c608db
Changes to Jupyter Notebooks 1 and 2
reshel3 Jan 23, 2019
1af4834
clean up
dnadeau4 Jan 24, 2019
914a58d
revert changes
reshel3 Jan 24, 2019
b921e80
update chapter4
dnadeau4 Jan 25, 2019
d0666ba
chapter 4 regridder opendap
dnadeau4 Jan 26, 2019
d87632c
chapter 2 using OpenDAP
dnadeau4 Jan 26, 2019
262ee53
chapter 2 using OpenDAP
dnadeau4 Jan 26, 2019
68eefd6
update all chapters
dnadeau4 Jan 29, 2019
2c071e5
Merge branch 'docsdenis' into docstanya
dnadeau4 Jan 29, 2019
ab5f9fb
add chapter4
reshel3 Feb 6, 2019
d160c21
fix conflicts
reshel3 Feb 6, 2019
e5c7a1c
fix conflicts
reshel3 Feb 6, 2019
59a86ef
Changes to Jupiter Notebooks 1 and 2
reshel3 Feb 7, 2019
3064267
Changes to Jupyter Notebooks 1a and 2a
reshel3 Feb 12, 2019
9e5922b
Changes to Jupyter Notebooks 1a, 2a, 3a, 4a
reshel3 Feb 13, 2019
4c88050
Changes to Jupyter Notebooks 1a, 2a, 3a,4a, 5a
reshel3 Feb 14, 2019
2c5b11b
Changes to Jupyter Notebooks 1a thru 4a
reshel3 Feb 21, 2019
dd3d15d
Changes to Section 1, 2
reshel3 Feb 21, 2019
3822bf7
Changes to Sections 1 and 2
reshel3 Feb 22, 2019
659e2f1
Changes to Sections 1-3
reshel3 Feb 25, 2019
17eae0b
Changes to Jupyter Notebooks
reshel3 Feb 27, 2019
27d03cd
Changes to Chapters 2, 5 and 6
reshel3 Mar 4, 2019
b34233d
Changes to Sections 1 and 2
reshel3 Mar 6, 2019
c9f048a
Changes to API
reshel3 Mar 7, 2019
b8c7749
fix double Notes section
reshel3 Mar 8, 2019
9aea2a7
Changes to API
reshel3 Mar 11, 2019
0e4bb15
Changes made to API
reshel3 Mar 12, 2019
598ab3c
Change to API
reshel3 Mar 13, 2019
2305a78
Changes to API
reshel3 Mar 14, 2019
8f65143
Changes to API
reshel3 Mar 22, 2019
9ee05d0
Changes to Sections
reshel3 Mar 25, 2019
f817fc3
Changes to Sections
reshel3 Mar 26, 2019
fc86d2c
Changes to Section 1
reshel3 Mar 27, 2019
7403fd0
Changes to all
reshel3 Mar 28, 2019
0f4aed1
Changes to Sections 2 and 4
reshel3 Apr 4, 2019
c622cb2
fix conflicts
dnadeau4 Apr 4, 2019
a612165
flake8 files
dnadeau4 Apr 8, 2019
d931f2b
Changes to sections
reshel3 Apr 9, 2019
413ab55
update readthedocs to py3
dnadeau4 Apr 9, 2019
e4b83da
update environment.yml to 3.1.2
dnadeau4 Apr 9, 2019
fcf56c7
fix environment.yml for readthedocs
dnadeau4 Apr 9, 2019
332cd9c
add easydev to readthedocs env yaml
dnadeau4 Apr 9, 2019
88b6884
change sys.prefix to 3.7
dnadeau4 Apr 9, 2019
f969e7a
merge master fix conflict
dnadeau4 Apr 9, 2019
27e04a3
try to add lazy-object and change env
dnadeau4 Apr 9, 2019
1841c30
enable javascript button
dnadeau4 Apr 10, 2019
002881e
Merge branch 'master' into docstanya
dnadeau4 Apr 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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