| 1 | # PyNCplot |
|---|
| 2 | # Python to manage netCDF files. |
|---|
| 3 | # From L. Fita work in different places: CCRC (Australia), LMD (France) |
|---|
| 4 | # More information at: http://www.xn--llusfb-5va.cat/python/PyNCplot |
|---|
| 5 | # |
|---|
| 6 | # pyNCplot and its component nc_var.py comes with ABSOLUTELY NO WARRANTY. |
|---|
| 7 | # This work is licendes under a Creative Commons |
|---|
| 8 | # Attribution-ShareAlike 4.0 International License (http://creativecommons.org/licenses/by-sa/4.0) |
|---|
| 9 | # |
|---|
| 10 | ## Python script to indepdententy test different components |
|---|
| 11 | ## L. Fita, CIMA. |
|---|
| 12 | ####### ####### ##### ##### #### ### ## # |
|---|
| 13 | |
|---|
| 14 | from optparse import OptionParser |
|---|
| 15 | import numpy as np |
|---|
| 16 | from netCDF4 import Dataset as NetCDFFile |
|---|
| 17 | import os |
|---|
| 18 | import re |
|---|
| 19 | import subprocess as sub |
|---|
| 20 | import numpy.ma as ma |
|---|
| 21 | import matplotlib as mpl |
|---|
| 22 | mpl.use('Agg') |
|---|
| 23 | from matplotlib.pylab import * |
|---|
| 24 | import matplotlib.pyplot as plt |
|---|
| 25 | from mpl_toolkits.basemap import Basemap |
|---|
| 26 | |
|---|
| 27 | # Importing generic tools file 'generic_tools.py' and the others |
|---|
| 28 | import generic_tools as gen |
|---|
| 29 | import nc_var_tools as ncvar |
|---|
| 30 | import drawing_tools as drw |
|---|
| 31 | import diag_tools as diag |
|---|
| 32 | import geometry_tools as geo |
|---|
| 33 | |
|---|
| 34 | # Importing Fortran modules and the others |
|---|
| 35 | import module_ForDef as fdef |
|---|
| 36 | import module_ForDiag as fdiag |
|---|
| 37 | import module_ForGen as fgen |
|---|
| 38 | import module_ForSci as fsci |
|---|
| 39 | |
|---|
| 40 | parser = OptionParser() |
|---|
| 41 | parser.add_option("-x", "--Xx", dest="x", help="x", metavar="X") |
|---|
| 42 | (opts, args) = parser.parse_args() |
|---|
| 43 | |
|---|
| 44 | ####### ####### |
|---|
| 45 | ## MAIN |
|---|
| 46 | ####### |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | # Testing Fortran tws |
|---|
| 50 | print fdiag.module_fordiagnosticsvars.var_tws_s11.__doc__ |
|---|
| 51 | t = 20. + 273.15 |
|---|
| 52 | hur = 0.5 |
|---|
| 53 | print fdiag.module_fordiagnosticsvars.var_tws_s11(t, hur) |
|---|
| 54 | |
|---|
| 55 | quit() |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | #quit() |
|---|
| 59 | |
|---|