File: testferdset.py

package info (click to toggle)
pyferret 7.6.5-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 138,136 kB
  • sloc: fortran: 240,609; ansic: 25,235; python: 24,026; sh: 1,618; makefile: 1,123; pascal: 569; csh: 307; awk: 18
file content (68 lines) | stat: -rw-r--r-- 1,838 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# To be run in python after importing and starting pyferret
# such as from running "pyferret -python"

from __future__ import print_function

import sys ; sys.ps1 = '' ; sys.ps2 = ''
print()

print(">>> coads = pyferret.FerDSet('coads_climatology.cdf')")
coads = pyferret.FerDSet('coads_climatology.cdf')
print(">>> str(coads)")
str(coads)
print(">>> dir(coads)")
dir(coads)
print(">>> coads.show()")
coads.show()

print(">>> coads_uw  = pyferret.FerDSet('coads_uw.nc')")
coads_uw  = pyferret.FerDSet('coads_uw.nc')
print(">>> str(coads_uw)")
str(coads_uw)
print(">>> dir(coads_uw)")
dir(coads_uw)
print(">>> coads_uw.show(brief=False)")
coads_uw.show(brief=False)

print(">>> try:")
print("...     pyferret.FerDSet(None)")
print("...     print 'No error found'")
print("... except ValueError as ex:")
print("...     print 'ValueError caught with message ' + str(ex)")
try:
    pyferret.FerDSet(None)
    print('No error found')
except ValueError as ex:
    print('ValueError caught with message: ' + str(ex))

print(">>> pyferret.anondset.sstcopy = coads.sst")
pyferret.anondset.sstcopy = coads.sst
print(">>> pyferret.anondset.show()")
pyferret.anondset.show()

print(">>> pyferret.showdata(brief=False)")
pyferret.showdata(brief=False)
print(">>> coads_uw.close()")
coads_uw.close()
print(">>> pyferret.showdata()")
pyferret.showdata()
print(">>> coads.close()")
coads.close()
print(">>> pyferret.showdata()")
pyferret.showdata()
print(">>> coads.close()")
coads.close()
print(">>> pyferret.showdata()")
pyferret.showdata()

print(">>> dir(pyferret.anondset)")
dir(pyferret.anondset)
print(">>> pyferret.anondset.show()")
pyferret.anondset.show()
print(">>> pyferret.anondset.close()")
pyferret.anondset.close()
print(">>> dir(pyferret.anondset)")
dir(pyferret.anondset)
print(">>> pyferret.anondset.show()")
pyferret.anondset.show()