Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
d813fc9
debugging custom table
mcenerney1 Sep 28, 2016
6a387f2
debugging custom table
mcenerney1 Sep 28, 2016
e1ff8dc
debugging custom table
mcenerney1 Sep 28, 2016
9775a91
debugging custom table
mcenerney1 Sep 28, 2016
60ec5ce
debug custom table
mcenerney1 Oct 3, 2016
3db8d49
debug custom table
mcenerney1 Oct 3, 2016
0c6e23e
debug custom table
mcenerney1 Oct 4, 2016
64fe3f3
debug custom table
mcenerney1 Oct 4, 2016
791096c
debug custom table
mcenerney1 Oct 4, 2016
00ab380
debug custom table
mcenerney1 Oct 4, 2016
5766508
debug custom table
mcenerney1 Oct 4, 2016
58ab14a
debug custom table
mcenerney1 Oct 4, 2016
b920024
debug custom table
mcenerney1 Oct 4, 2016
f3ca55c
debug custom table
mcenerney1 Oct 4, 2016
94f0d23
debug custom table
mcenerney1 Oct 4, 2016
792a654
still debugging the custom table
mcenerney1 Oct 7, 2016
6c7aca4
new test for the table
mcenerney1 Oct 10, 2016
7ff3d47
added test for tables
mcenerney1 Oct 11, 2016
7756e7e
debugging
mcenerney1 Oct 11, 2016
cd5a1ee
create a table test
mcenerney1 Oct 12, 2016
c956d1e
intermediate upgrade to table test; added user to option
mcenerney1 Oct 14, 2016
b7c3fe6
update mds5s.txt and table_test--.text;last change before merge with …
mcenerney1 Oct 17, 2016
b264daa
fixed a bug with commvar2vat
mcenerney1 Oct 18, 2016
3922b11
resolve conflicts with table_test
mcenerney1 Oct 19, 2016
723bf20
intermediate copy, debug
mcenerney1 Oct 25, 2016
185ef70
intermediate version
mcenerney1 Oct 27, 2016
268d38b
intermediate version
mcenerney1 Oct 27, 2016
9f24c92
intermediate version
mcenerney1 Oct 27, 2016
d99a606
intermediate version
mcenerney1 Oct 27, 2016
164e375
intermediate version
mcenerney1 Oct 27, 2016
c1467b0
intermediate version
mcenerney1 Oct 27, 2016
6198895
intermediate version
mcenerney1 Oct 27, 2016
dacd47f
intermediate version
mcenerney1 Oct 27, 2016
d86c1aa
intermediate version
mcenerney1 Oct 27, 2016
6612d85
intermediate version
mcenerney1 Oct 27, 2016
c603222
intermediate version
mcenerney1 Oct 27, 2016
9f5d5ac
intermediate version
mcenerney1 Oct 27, 2016
c00f358
intermediate version
mcenerney1 Oct 27, 2016
8c170dc
intermediate version
mcenerney1 Oct 27, 2016
c17bf55
intermediate version
mcenerney1 Oct 27, 2016
a4a9b99
intermediate version
mcenerney1 Oct 28, 2016
472d8fe
intermediate version
mcenerney1 Oct 28, 2016
444794b
intermediate version
mcenerney1 Oct 28, 2016
65f26ed
intermediate version
mcenerney1 Oct 28, 2016
aa4ba21
intermediate version
mcenerney1 Oct 28, 2016
13fa827
intermediate version
mcenerney1 Oct 28, 2016
7b15ac9
debugging
mcenerney1 Oct 31, 2016
3a00335
debugging
mcenerney1 Oct 31, 2016
df2945e
debugging
mcenerney1 Oct 31, 2016
986881e
debugging
mcenerney1 Oct 31, 2016
987fd51
debugging
mcenerney1 Oct 31, 2016
cc45013
debugging
mcenerney1 Oct 31, 2016
09285d9
debugging
mcenerney1 Nov 1, 2016
25643cc
debugging
mcenerney1 Nov 1, 2016
bcb3197
debugging
mcenerney1 Nov 1, 2016
a08ad2d
debugging
mcenerney1 Nov 1, 2016
e266f7e
debugging
mcenerney1 Nov 1, 2016
fcba072
debugging
mcenerney1 Nov 2, 2016
00bc0fb
debugging
mcenerney1 Nov 2, 2016
5058ef4
debugging
mcenerney1 Nov 2, 2016
78b0a96
debugging
mcenerney1 Nov 2, 2016
15415a8
debugging
mcenerney1 Nov 2, 2016
7f5a991
debugging
mcenerney1 Nov 2, 2016
3790679
debugging
mcenerney1 Nov 2, 2016
ea467b2
debugging
mcenerney1 Nov 2, 2016
c5e4df8
debugging
mcenerney1 Nov 2, 2016
0d83691
debugging
mcenerney1 Nov 2, 2016
5f4425a
debugging
mcenerney1 Nov 2, 2016
4f5d5fc
debugging
mcenerney1 Nov 2, 2016
b8fd186
debugging
mcenerney1 Nov 2, 2016
4f54f27
debugging
mcenerney1 Nov 2, 2016
4f2aa3b
debugging
mcenerney1 Nov 2, 2016
23a9eff
debugging
mcenerney1 Nov 3, 2016
2db8474
debugging
mcenerney1 Nov 3, 2016
5ee1807
debugging
mcenerney1 Nov 3, 2016
9afe7d9
debugging
mcenerney1 Nov 3, 2016
7f29162
debugging
mcenerney1 Nov 3, 2016
79a897f
final version
mcenerney1 Nov 3, 2016
b2b6745
add new obs data and changed md5s.txt
mcenerney1 Nov 4, 2016
d5a2b13
modified tabletest with the smaller obs data
mcenerney1 Nov 4, 2016
df92285
update paths md5s.txt
mcenerney1 Nov 4, 2016
33b8279
debug adding data
mcenerney1 Nov 4, 2016
a78ac66
debug adding data
mcenerney1 Nov 4, 2016
a8f4ecb
cleanup Golaz table
mcenerney1 Nov 15, 2016
dfffc3e
update the mds for table_reference with the fraction variables
mcenerney1 Nov 16, 2016
958e1e6
mrege master and correct conflicts
mcenerney1 Jan 10, 2017
211b157
correct the table reference data
mcenerney1 Jan 10, 2017
369312d
change the name of the table test
mcenerney1 Jan 11, 2017
2a13ff4
debug custom_table
mcenerney1 Jan 12, 2017
2c8beb2
debug complete;pilot error
mcenerney1 Jan 12, 2017
349dcbc
added MERRA for metadiags
mcenerney1 Jan 13, 2017
a7ee61e
remove TS_LAND for Golaz
mcenerney1 Jan 17, 2017
4e78204
debug levels
mcenerney1 Jan 20, 2017
f301669
debug rmse and correlation
mcenerney1 Jan 20, 2017
260c5c0
Merge branch 'master' into custom_table
mcenerney1 Jan 27, 2017
9b4b07d
debug levels in table
mcenerney1 Jan 30, 2017
c89ffa8
looks like the level table is repaired
mcenerney1 Feb 2, 2017
81830d9
added conversion directory
mcenerney1 Feb 6, 2017
955686b
convert table to cdp
mcenerney1 Feb 13, 2017
87e440c
add regrid script
mcenerney1 Feb 13, 2017
5d0f5ba
add init to conversion
mcenerney1 Feb 13, 2017
19f4b7c
changed setup to add directory conversion
mcenerney1 Feb 13, 2017
84beb48
changed setup to add directory conversion
mcenerney1 Feb 13, 2017
0a92fa3
debugging issues with mask
mcenerney1 Feb 14, 2017
08c13dc
debugging issues with mask
mcenerney1 Feb 15, 2017
dd15344
fixed the masking issue for SST
mcenerney1 Feb 17, 2017
aac073b
create the Taylor diagram
mcenerney1 Feb 27, 2017
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
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .idea/vcs.xml
100644 → 100755
Empty file.
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified CMakeLists.txt
100644 → 100755
Empty file.
Empty file modified CTestConfig.cmake
100644 → 100755
Empty file.
Empty file modified doc/example_custom_specs_metadiags.py
100644 → 100755
Empty file.
Empty file modified media/images/tf-plot1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/images/tf-plot2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/images/tf-plot3.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/images/tf-plot4.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/images/tf-plot5.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/images/tf-plot6.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'metrics.frontend': 'src/python/frontend',
'metrics.exploratory': 'src/python/exploratory',
'metrics.computation': 'src/python/computation',
'metrics.conversion': 'src/python/conversion',
'metrics.packages': 'src/python/packages',
'metrics.common': 'src/python/common',
'metrics.packages.amwg': 'src/python/packages/amwg',
Expand Down Expand Up @@ -64,6 +65,7 @@
'metrics.graphics',
'metrics.frontend',
'metrics.computation',
'metrics.conversion',
'metrics.viewer'
],
package_dir = packages,
Expand Down
Empty file modified share/plot_set_5.json
100644 → 100755
Empty file.
Empty file modified share/uvcmetrics.bad.json
100644 → 100755
Empty file.
Empty file modified share/uvcmetrics.json
100644 → 100755
Empty file.
Empty file modified share/viewer/imgs/SET1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET10.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET11.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET12.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET13.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET14.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET15.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET3.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET4.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET4A.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET5.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET6.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET7.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET8.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified share/viewer/imgs/SET9.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/C/packages/acme_regridder/_regridmodule.c
100644 → 100755
Empty file.
Empty file added src/__init__.py
Empty file.
Empty file modified src/python/commandLineDiag
100644 → 100755
Empty file.
Empty file modified src/python/common/debug.py
100644 → 100755
Empty file.
Empty file modified src/python/common/utilities.py
100644 → 100755
Empty file.
Empty file modified src/python/computation/compute_rmse.py
100644 → 100755
Empty file.
Empty file modified src/python/computation/dateeaster.py
100644 → 100755
Empty file.
Empty file modified src/python/computation/daterrule.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion src/python/computation/plotspec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/uvcdat/1.3.1/bin/python
#/usr/local/uvcdat/1.3.1/bin/python

# general-purpose classes (i.e., not specific to any GUI or diagnostic group) used in computing data for plots
from metrics.common import *
Expand Down
10 changes: 7 additions & 3 deletions src/python/computation/reductions.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,6 @@ def reduce_time_space_seasonal_regional( mv, season=seasonsyr, region=None, vid=
# Brian Smith
# 2/25/15
def reduce2latlon_seasonal_level( mv, season, level, vid=None):

if vid is None:
vid = 'reduced_'+mv.id
levax = levAxis(mv)
Expand Down Expand Up @@ -2972,7 +2971,7 @@ def correlateData(mv1, mv2, aux):

from genutil.statistics import correlation
#print mv1.shape, mv2.shape

#pdb.set_trace()
sliced_mvs = []
if isinstance(aux,Number):
for mv in [mv1, mv2]:
Expand All @@ -2988,8 +2987,13 @@ def correlateData(mv1, mv2, aux):
sliced_mvs = [mv1, mv2]
mv1_new, mv2_new = sliced_mvs

mv2_new = mv2_new.regrid(mv1_new.getGrid(), regridTool='esmf', regridMethod='linear')
#mv2_new = mv2_new.regrid(mv1_new.getGrid(), regridTool='esmf', regridMethod='linear')
mv1_new = reduce2latlon_seasonal(mv1)
mv2_new = reduce2latlon_seasonal(mv2)
mv1_new = mv1_new.regrid(mv2_new.getGrid(), regridTool='esmf', regridMethod='linear')
pdb.set_trace()
corr = correlation(mv1_new.flatten(), mv2_new.flatten())

#print corr

return corr
Expand Down
Empty file modified src/python/computation/region.py
100644 → 100755
Empty file.
Empty file modified src/python/computation/region_functions.py
100644 → 100755
Empty file.
Empty file modified src/python/computation/units.py
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions src/python/conversion/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from src.python.conversion.table import git
Empty file.
92 changes: 92 additions & 0 deletions src/python/conversion/table/defines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# A set of global variables (more or less) defining things that lots of
# pieces of diags use/can use.

# Coordinates from maps generated for lnd diags, obs set 3 from NCAR -
# http://www.cgd.ucar.edu/tss/clm/diagnostics/clm4cn/i1860-2009cnGCPs3-obs/set3/set3.html

all_regions = {}
all_regions['Alaskan_Arctic'] = [66, 72, -170, -140]
all_regions['Antarctica'] = [-90, -65, -180, 180]
all_regions['Canadian_Arctic'] = [66, 90, -120, -60]
all_regions['Greenland'] = [60, 90, -60, -20]
all_regions['Polar'] = [60, 90, -180, 180]
all_regions['Russian_Arctic'] = [66, 90, 70, 170]
all_regions['Alaska'] = [59, 67, -170, -140]
all_regions['Central_Canada'] = [50, 62, -100, -80]
all_regions['Eastern_Canada'] = [50, 60, -80, -55]
all_regions['Eastern_Siberia'] = [50, 67, 90, 140]
all_regions['Northern_Europe'] = [60, 70, 5, 45]
all_regions['Northwest_Canada'] = [55, 67, -125, -100]
all_regions['Western_Siberia'] = [55, 67, 60, 90]
all_regions['Central_U.S.'] = [30, 50, -105, -90]
all_regions['Eastern_U.S.'] = [30, 50, -90, -70]
all_regions['Europe'] = [45, 60, -10, 30]
all_regions['Mediterranean'] = [34, 45, -10, 30]
all_regions['Western_U.S.'] = [30, 50, -130, -105]
all_regions['Amazonia'] = [-10, 0, -70, -50]
all_regions['Central_Africa'] = [-5, 5, 10, 30]
all_regions['Central_America'] = [5, 16, -95, -75]
all_regions['Indonesia'] =[-10, 10, 90, 150]
all_regions['Brazil'] = [-24, -10, -65, -30]
all_regions['India'] = [10, 24, 70, 90]
all_regions['Indochina'] = [10, 24, 90, 120]
all_regions['Sahel'] = [6,16,-5,15]
all_regions['Southern_Africa'] = [-25, -5, 10, 40]
all_regions['Arabian_Peninsula'] = [16, 30, 35, 60]
all_regions['Australia'] = [-30, -20, 110, 145]
all_regions['Central_Asia'] = [35, 50, 55, 70]
all_regions['Mongolia'] = [40, 50, 85, 120]
all_regions['Sahara_Desert'] = [16, 30, -20, 30]
all_regions['Tigris_Euphrates'] = [30, 40, 37, 50]
all_regions['Tibetan_Plateau'] = [30, 40, 80, 100]
all_regions['Central_Asia'] = [40, 50, 40, 100]
all_regions['Eastern_China'] = [30, 40, 100, 120]
all_regions['Mediterranean_and_Western_Asia'] = [30, 45, -10, 60]
all_regions['Central_and_Eastern_Mongolia_and_NE_China'] = [40, 50, 100, 130]
all_regions['Sahara_Desert_and_Arabian_Peninsula'] = [15, 30, -15, 60]
all_regions['Southern_Asia'] = [20, 30, 60, 120]
all_regions['Tibetan_Plaeau'] = [30, 40, 80, 100]
all_regions['N_Hemisphere_Land'] = [0, 90, -180, 180]
all_regions['S_Hemisphere_Land'] = [-90, 0, -180, 180]
all_regions['Global'] = [-90, 90, -180, 180]
all_regions['Tropics'] = [-40,40, -180, 180]
all_regions['Southern_Extratropics'] = [-90,-40, -180, 180]
all_regions['Northern_Extratropics'] = [40,90, -180, 180]
all_regions['Southern_Ocean'] = [-90, -40, -180, 180]


# Right now, this is just used for web page generation.
#I don't know if it has utility in the currenty diags
region_categories = {
'Polar': ['Alaskan Arctic', 'Antarctica', 'Canadian Arctic', 'Greenland', 'Polar', 'Russian Arctic'],
'Boreal': ['Alaska', 'Central Canada', 'Eastern Canada', 'Eastern Siberian', 'Northern Europe', 'Northwest Canada', 'Western Siberia'],
'Middle Latitudes': ['Central U.S.', 'Eastern U.S.', 'Europe', 'Mediterranean', 'Western U.S.'],
'Tropical Rainforest': ['Amazonia', 'Central Africa', 'Central America', 'Indonesia'],
'Tropical Savanna': ['Brazil', 'India', 'Indochina', 'Sahel', 'Southern Africa'],
'Arid': ['Arabian Peninsula', 'Australia', 'Central Asia', 'Mongolia', 'Sahara Desert', 'Tigris Euphrates'],
'Highland': ['Tibetan Plateau'],
'Asia': ['Central Asia', 'Eastern China', 'Mediterranean and Western Asia', 'Central and Eastern Mongolia and NE China', 'Sahara Desert and Arabian Peninsula', 'Southern Asia', 'Tibetan Plateau'],
'Hemispheric and Global': ['Global Land', 'Northern Hemisphere Land', 'Southern Hemisphere Land']
}

#station ids used in plot set 12
station_names = ["Ascension_Island","Diego_Garcia","Truk_Island",
"Western_Europe","Ethiopia","Resolute_Canada","Western_Desert_Australia",
"Great_Plains_USA","Central_India","Marshall_Islands","Easter_Island",
"McMurdo_Antarctica","SouthPole_Antarctica","Panama","Western_North_Atlantic",
"Singapore","Manila","Gilbert_Islands","Hawaii","San_Paulo","Heard_Island",
"Kagoshima_Japan","Port_Moresby","San_Juan_PR","Western_Alaska",
"Thule_Greenland","SanFrancisco_CA","Denver_CO","London_UK","Crete",
"Tokyo","Sydney_Australia","Christchurch_NZ","Lima_Peru","Miami_FL","Samoa",
"ShipP_GulfofAlaska","ShipC_North_Atlantic","Azores","NewYork_USA",
"Darwin_Australia","Christmas_Island","Cocos_Islands","Midway_Island",
"Raoui_Island","Whitehorse_Canada","OklahomaCity_OK","Gibraltor",
"Mexico_City","Recife_Brazil","Nairobi_Kenya","New_Delhi_India",
"Madras_India","DaNang_Vietnam","Yap_Island","Falkland_Islands" ]

all_months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
just_seasons = ['DJF', 'MAM', 'JJA', 'SON', 'ASO', 'FMA'] # The last 2 were in some obs sets
all_seasons = all_months+just_seasons+['ANN']
all_packages = ['lmwg', 'amwg']


125 changes: 125 additions & 0 deletions src/python/conversion/table/derived_variables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
from metrics.packages.amwg.derivations import *
from metrics.computation.reductions import aminusb_2ax, aminusb, aplusb, convert_units

#this indicates a variable is simply renamed
rename = True

# These are the derived variables for Chris Golaz
#each one is a pair of inputes and a function
#the output is the dictionary key
user_derived_variables = {

# water cycle, Chris Terai:
'QFLX_LND':[ (['QFLX','OCNFRAC'], WC_diag_amwg.surface_maskvariable ),
(['QFLX'], rename ) ], # assumes that QFLX is from a land-only dataset
'QFLX_OCN':[ (['QFLX','LANDFRAC'], WC_diag_amwg.surface_maskvariable ),
(['QFLX'], rename ) ], # assumes that QFLX is from an ocean-only dataset
'LHFLX_OCN':[( ['LHFLX','LANDFRAC'], WC_diag_amwg.surface_maskvariable ),
( ['LHFLX'], rename ) ], # assumes that QFLX is from an ocean-only dataset
'EminusP':[ (['QFLX','PRECT'], aminusb_2ax )], # assumes that QFLX,PRECT are time-reduced
'TMQ':[ (['PREH2O'], rename )],
'WV_LIFETIME':[ ( ['TMQ','PRECT'], (lambda tmq,prect: wv_lifetime(tmq,prect)[0]) )],

# Variables computed by NCAR AMWG, requested by Chris Golaz, our issue 222:
'ALBEDO':[ (['SOLIN','FSNTOA'], albedo )],
'ALBEDOC':[ (['SOLIN','FSNTOAC'], albedo )],
'EP':[ (['QFLX','PRECT'], aminusb )],
'TTRP':[ (['T'], tropopause_temperature, {'T':'dontreduce'} )], #special_orders
'LWCFSRF':[ (['FLNSC','FLNS'], aminusb )],
'PRECT_LAND':[ (['PRECC','PRECL','LANDFRAC'], land_precipitation )],
'PRECIP':[ (['PRECT','seasonid'], prect2precip )],# cumulative precipitation (over the season)
'PRECIP_LAND':[ (['PRECT_LAND','seasonid'], prect2precip )], # cumulative precipitation (over the season; restricted to land)
# sea surface temperature. Usually it's in the data file, but not always.
'SST':[ ( ['TS','OCNFRAC'], (lambda ts,of: mask_by(ts,of,lo=.9)) ) ],
'SWCFSRF':[ (['FSNS', 'FSNSC'], aminusb )],
'SWCF':[ (['FSNTOA', 'FSNTOAC'], aminusb )],
# miscellaneous:
'PRECT':[ ( ['pr'], rename ),
( ['PRECC','PRECL'], (lambda a,b,units="mm/day": aplusb(a,b,units)) ) ],
'AODVIS':[ (['AOD_550'], (lambda x: setunits(x,'')) )],
# AOD normally has no units, but sometimes the units attribute is set anyway.
# The next one returns TREFHT over land because that's what the obs files contain
'TREFHT':[ (['TREFHT_LAND'], rename )],
#The next one returns the fraction of TREFHT over land
'TREFHT_LAND':[ (['TREFHT', 'LANDFRAC'], land_only )],
#The next one returns the fraction of TREFHT over ocean
'TREFHT_OCN':[ (['TREFHT', 'OCNFRAC'], ocean_only ),
(['TREFHT_LAND'], rename )],
'RESTOM':[ (['FSNT','FLNT'], aminusb )], # RESTOM = net radiative flux

# clouds, Yuying Zhang:
# old style vid='CLISCCP', inputs=['FISCCP1_COSP','cosp_prs','cosp_tau'], outputs=['CLISCCP'],
# old style func=uncompress_fisccp1 )
'CLISCCP': [ (['FISCCP1_COSP'], rename ) ],
'CLDMED_VISIR':[ (['CLDMED'], rename) ],
'CLDTOT_VISIR':[ (['CLDTOT'], rename) ],
'CLDHGH_VISIR':[ (['CLDHGH'], rename) ],
'CLDLOW_VISIR':[ (['CLDLOW'], rename) ],

'CLDTOT_ISCCP':[ (['CLDTOT_ISCCPCOSP'], rename ) ],
'CLDHGH_ISCCP':[ (['CLDHGH_ISCCPCOSP'], rename ) ],
'CLDMED_ISCCP':[ (['CLDMED_ISCCPCOSP'], rename ) ],
'CLDLOW_ISCCP':[ (['CLDLOW_ISCCPCOSP'], rename ) ],
'CLMISR':[ (['CLD_MISR'], rename ) ],
# Note: CLDTOT is different from CLDTOT_CAL, CLDTOT_ISCCPCOSP, etc. But translating
# from one to the other might be better than returning nothing. Also, I'm not so sure that
# reduce_prs_tau is producing the right answers, but that's a problem for later.
#1-ISCCP
'CLDTOT_TAU1.3_ISCCP':[ (['CLISCCP'], (lambda clisccp: reduce_height_thickness( clisccp, None,None, 1.3,379) ) ) ],
#2-ISCCP
'CLDTOT_TAU1.3-9.4_ISCCP':[ (['CLISCCP'], (lambda clisccp: reduce_height_thickness( clisccp, None,None, 1.3,9.4) ) ) ],
#3-ISCCP
'CLDTOT_TAU9.4_ISCCP':[ (['CLISCCP'], (lambda clisccp: reduce_height_thickness( clisccp, None,None, 9.4,379) ) ) ],
#1-MODIS
'CLDTOT_TAU1.3_MODIS':[ (['CLMODIS'], (lambda clmodis: reduce_height_thickness( clmodis, None,None, 1.3,379 ) ) ) ],
#2-MODIS
'CLDTOT_TAU1.3-9.4_MODIS':[ (['CLMODIS'], (lambda clmodis: reduce_height_thickness( clmodis, None,None, 1.3,9.4 ) ) ) ],
#3-MODIS
'CLDTOT_TAU9.4_MODIS':[ (['CLMODIS'], (lambda clmodis: reduce_height_thickness( clmodis, None,None, 9.4,379 ) ) )],
#4-MODIS
'CLDHGH_TAU1.3_MODIS':[ (['CLMODIS'], (lambda clmodis: reduce_height_thickness( clmodis, 0,440, 1.3,379 ) ) ) ],
#5-MODIS
'CLDHGH_TAU1.3-9.4_MODIS':[ (['CLMODIS'], (lambda clmodis: reduce_height_thickness(clmodis, 0,440, 1.3,9.4) ) ) ],
#6-MODIS
'CLDHGH_TAU9.4_MODIS':[ (['CLMODIS'], (lambda clmodis: reduce_height_thickness( clmodis, 0,440, 9.4,379) ) ) ],
#1-MISR
'CLDTOT_TAU1.3_MISR':[ (['CLMISR'], (lambda clmisr: reduce_height_thickness( clmisr, None,None, 1.3,379) ) ) ],
#2-MISR
'CLDTOT_TAU1.3-9.4_MISR':[ (['CLMISR'], (lambda clmisr: reduce_height_thickness( clmisr, None,None, 1.3,9.4) ) ) ],
#3-MISR
'CLDTOT_TAU9.4_MISR':[ (['CLMISR'], (lambda clmisr: reduce_height_thickness( clmisr, None,None, 9.4,379) ) ) ],
#4-MISR
'CLDLOW_TAU1.3_MISR':[ (['CLMISR'], (lambda clmisr, h0=0,h1=3,t0=1.3,t1=379: reduce_height_thickness(clmisr, h0,h1, t0,t1) ) )],
#5-MISR
#func=(lambda clmisr, h0=0,h1=6, t0=2,t1=4: reduce_height_thickness( clmisr, h0,h1, t0,t1) ) )
'CLDLOW_TAU1.3-9.4_MISR':[ (['CLMISR'], (lambda clmisr, h0=0,h1=3, t0=1.3,t1=9.4: reduce_height_thickness( clmisr, h0,h1, t0,t1) ) )],
#6-MISR
'CLDLOW_TAU9.4_MISR':[ (['CLMISR'], (lambda clmisr, h0=0,h1=3, t0=9.4,t1=379: reduce_height_thickness(clmisr, h0,h1, t0,t1) ) ) ],
#TGCLDLWP_OCEAN
'TGCLDLWP_OCN':[ (['TGCLDLWP_OCEAN'], (lambda x: convert_units(x, 'g/m^2')) ),
(['TGCLDLWP', 'OCNFRAC'], (lambda x, y, units='g/m^2': simple_vars.ocean_only(x,y, units)) )],
#...end of clouds, Yuying Zhang

# To compare LHFLX and QFLX, need to unify these to a common variable
# e.g. LHFLX (latent heat flux in W/m^2) vs. QFLX (evaporation in mm/day).
# The conversion functions are defined in qflx_lhflx_conversions.py.
# [SMB: 25 Feb 2015]
#'LHFLX':[derived_var(
# vid='LHFLX', inputs=['QFLX'], outputs=['LHFLX'],
# func=(lambda x: x) ) ],
#'QFLX':[derived_var(
# vid='QFLX', inputs=['LHFLX'], outputs=['QFLX'],
# func=(lambda x: x) ) ],

#added for Chris Golaz
'SHFLX_OCN':[ (['SHFLX', 'OCNFRAC'], (lambda x, y: ocean_only(x,y)) ),
(['SHFLX'], rename )],
'FSNS_OCN':[ (['FSNS', 'OCNFRAC'], (lambda x, y: ocean_only(x,y)) ),
(['FSNS'], rename )],
'FLNS_OCN':[ (['FLNS', 'OCNFRAC'], (lambda x, y: ocean_only(x,y)) ),
(['FLNS'], rename )],
'LHFLX_COMPUTED':[ (['QFLX', 'PRECC', 'PRECL', 'PRECSC', 'PRECSL' ], heat.qflx_prec_2lhflx ),
(['QFLX'], heat.qflx_2lhflx ),
(['LHFLX'], rename) ],
'LHFLX':[ (['LHFLX_COMPUTED'], rename ) ]
}
7 changes: 7 additions & 0 deletions src/python/conversion/table/findfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def findfile(directory, prefix, season):
import os
DIRECTORY = os.listdir(directory)
for file in DIRECTORY:
if file.startswith(prefix) and season in file:
return file
return None
24 changes: 24 additions & 0 deletions src/python/conversion/table/process_derived_variable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from derived_variables import user_derived_variables
import pdb
rename = True
def process_derived_variable( file, varid ):
#pdb.set_trace()
if varid in user_derived_variables.keys():
dvs = user_derived_variables[varid]
#each one is a pair of an input list and function
for [inputs, func] in dvs:
try:
args = []
#get inputs if in file
for varid_input in inputs:
if varid_input in file.variables.keys():
args += [ file(varid_input)(squeeze=1) ]
if args != []:
if func == rename:
return args[0]
else:
return func( *args )
except:
pass
return None

15 changes: 15 additions & 0 deletions src/python/conversion/table/regions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
regions = {
'Global': (-90, 90),
# 'Tropics (20S-20N)':(-20,20),
'Tropics': (-20, 20),
# 'Southern_Extratropics (90S-20S)':(-90,-20),
'Southern_Extratropics': (-90, -20),
# 'Northern_Extratropics (20N-90N)':(20,90),
'Northern_Extratropics': (20, 90)
}
regions_reversed = {
(-90, 90): 'Global',
(-20, 20): 'Tropics',
(-90, -20): 'Southern_Extratropics',
(20, 90): 'Northern_Extratropics'
}
Loading