Commit 29193426 authored by abuddenberg's avatar abuddenberg
Browse files

Added support for a bunch of new figures

parent 1b760c2d
......@@ -7,8 +7,8 @@ from collections import OrderedDict
webform = WebformClient('http://resources.assessment.globalchange.gov', webform_token)
gcis = GcisClient('http://data.gcis-dev-front.joss.ucar.edu', *gcis_dev_auth)
# gcis = GcisClient('http://data-stage.globalchange.gov', *gcis_stage_auth)
# gcis = GcisClient('http://data.gcis-dev-front.joss.ucar.edu', *gcis_dev_auth)
gcis = GcisClient('http://data-stage.globalchange.gov', *gcis_stage_auth)
sync_metadata_tree = {
#Reports
......@@ -58,6 +58,7 @@ sync_metadata_tree = {
('/metadata/figures/3082', 'paths-of-hurricanes-katrina-and-rita-relative-to-oil-and-gas-production-facilities'), # 4.1
('/metadata/figures/3292', 'cooling-degree-days'), # 4.3
('/metadata/figures/3291', 'projected-changes-in-seasonal-precipitation'), # 4.4
('/metadata/figures/1536', 'california-power-plants-potentially-at-risk-from-sea-level-rise'), # 4.5
]),
#Chapter 5
('transportation', [
......@@ -96,6 +97,7 @@ sync_metadata_tree = {
#Chapter 9
('human-health', [
('/metadata/figures/3162', 'projected-climate-change-worsens-asthma'), # 9.1
('/metadata/figures/2959', 'katrina-diaspora'), # 9.10
('/metadata/figures/3084', 'projected-temperature-change-of-hottest-days'), # 9.4
('/metadata/figures/3085', 'projected-changes-in-tick-habitat'), # 9.5
('/metadata/figures/3586', 'health-projected-change-in-heavy-precipitation-events'), # 9.6
......@@ -108,6 +110,7 @@ sync_metadata_tree = {
('/metadata/figures/2917', 'the-columbia-river-basin-land-use-and-land-cover'), # 10.10
('/metadata/figures/2410', 'coasttocoast-100degree-days-in-2011'), # 10.2
('/metadata/figures/2596', 'texas-summer-2011-record-heat-and-drought'), # 10.3
('/metadata/figures/3635', 'water-use-for-electricity-generation-by-fuel-and-cooling-technology'), # 10.5
('/metadata/figures/3158', 'projected-landuse-intensity-in-2030'), # 10.6
('/metadata/figures/2986', 'hydraulic-fracturing-and-water-use'), # 10.7
('/metadata/figures/2916', 'renewable-energy-and-land-use'), # 10.8
......@@ -157,6 +160,7 @@ sync_metadata_tree = {
#Chapter 17
('southeast', [
('/metadata/figures/3577', 'billion-dollar-weatherclimate-disasters'), # 17.1
('/metadata/figures/2633', 'trends-in-water-availability'), # 17.11
('/metadata/figures/3108', 'shrinking-lands-for-tribal-communities'), # 17.2
('/metadata/figures/2562', 'southeast-temperature-observed-and-projected'), # 17.3
('/metadata/figures/2998', 'projected-change-in-number-of-days-over-95-f'), # 17.4
......@@ -179,6 +183,7 @@ sync_metadata_tree = {
('/metadata/figures/2990', 'projected-change-in-number-of-warm-nights'), # 19.3
('/metadata/figures/2991', 'projected-change-in-number-of-heavy-precipitation-days'), # 19.4
('/metadata/figures/3002', 'projected-change-in-number-of-consecutive-dry-days'), # 19.5
('/metadata/figures/2829', 'increases-in-irrigated-farmland-in-the-great-plains'), # 19.6
('/metadata/figures/3280', 'historical-and-current-range-of-sage-grouse-habitat') #19.7
]),
#Chapter 20
......@@ -242,47 +247,71 @@ sync_metadata_tree = {
]),
#Chapter 33: Climate Science Appendix
('appendix-climate-science-supplement', [
('/metadata/figures/3112', 'indicators-of-warming-from-multiple-data-sets'), # 33.10
('/metadata/figures/3097', 'human-influence-on-the-greenhouse-effect'), #33.1
('/metadata/figures/3112', 'indicators-of-warming-from-multiple-data-sets'), # 33.10
('/metadata/figures/3114', '1700-years-of-global-temperature-from-proxy-data'), # 33.12
('/metadata/figures/2797', 'la-nina-and-el-nino-patterns'), # 33.13
('/metadata/figures/3138', 'warming-trend-and-effects-of-el-nino-la-nina'), # 33.14
('/metadata/figures/3140', 'longterm-warming-and-shortterm-variation'), # 33.15
('/metadata/figures/2798', 'detection-and-attribution-as-forensics'), # 33.16
('/metadata/figures/3301', 'human-influences-apparent-in-many-aspects-of-the-changing-climate'), # 33.17
('/metadata/figures/3267', 'emissions-concentrations-and-temperature-projections'), # 33.19
('/metadata/figures/2813', 'earths-energy-balance'), # 33.2
('/metadata/figures/3141', 'projected-annually-averaged-temperature-change'), # 33.20
('/metadata/figures/3153', 'projected-wintertime-precipitation-changes'), #33.21
('/metadata/figures/3152', 'projected-summertime-precipitation-changes'), #33.22
('/metadata/figures/3072', 'carbon-emissions-historical-and-projected'), # 33.23
('/metadata/figures/2802', 'modeling-the-climate-system'), # 33.24
('/metadata/figures/2803', 'increasing-model-resolution'), # 33.25
('/metadata/figures/3575', 'increasing-climate-model-components'), # 33.26
('/metadata/figures/2805', 'trends-in-maximum-and-minimum-temperatures'), # 33.27
('/metadata/figures/2533', 'us-seasonal-temperatures'), # 33.28
('/metadata/figures/2806', 'ice-cover-on-lake-mendota'), # 33.29
('/metadata/figures/3137', 'carbon-emissions-in-the-industrial-age'), #33.3
('/metadata/figures/3143', 'streamflow-from-snowmelt-coming-earlier-in-the-year'), # 33.30
('/metadata/figures/2401', 'shifts-in-plant-hardiness-zones'), # 33.31
('/metadata/figures/2534', 'app-extreme-precipitation'), # 33.32
('/metadata/figures/2936', 'percent-of-west-in-summer-drought'), # 33.33
('/metadata/figures/2535', 'changing-forest-fires-in-the-us'), # 33.34
('/metadata/figures/2809', 'extreme-drought-in-the-us-and-mexico-past-and-future'), # 33.35
('/metadata/figures/3142', 'change-in-maximum-number-of-consecutive-dry-days'), # 33.36
('/metadata/figures/3148', 'arctic-sea-ice-decline'), # 33.37
('/metadata/figures/2393', 'permafrost-temperatures-rising'), # 33.38
('/metadata/figures/3144', 'melting-of-arctic-landbased-ice'), # 33.39
('/metadata/figures/3307', 'heattrapping-gas-levels'), #33.4
('/metadata/figures/3146', 'sea-level-rise-19932012'), # 33.41
('/metadata/figures/3145', 'melting-glaciers-lead-to-sea-level-rise'), # 33.40
('/metadata/figures/3147', 'ice-loss-from-greenland-and-antarctica'), # 33.42
('/metadata/figures/3109', 'atmospheric-carbon-dioxide-levels'), # 33.5
('/metadata/figures/3110', 'relative-strengths-of-warming-and-cooling-influences'), # 33.6
('/metadata/figures/2796', 'development-of-observing-capabilities'), # 33.7
('/metadata/figures/3093', 'observed-change-in-global-average-temperature'), # 33.8
]),
#Chapter 34: FAQ/CAQ
('appendix-faqs', [
('/metadata/figures/2663', 'us-annual-temperature'), # 34.1
('/metadata/figures/3096', 'caq-human-influence-on-the-greenhouse-effect'), # 34.11
('/metadata/figures/3264', 'measurements-of-surface-temperature-and-suns-energy'), # 34.12
('/metadata/figures/3136', 'caq-carbon-emissions-in-the-industrial-age'), #34.4
('/metadata/figures/3115', 'caq-1700-years-of-global-temperature-from-proxy-data'), #34.5
('/metadata/figures/3300', 'caq-human-influences-apparent-in-many-aspects-of-the-changing-climate'), # 34.13
('/metadata/figures/3077', 'caq-separating-human-and-natural-influences-on-climate'), # 34.15
('/metadata/figures/3092', 'caq-observed-change-in-global-average-temperature'), # 34.16
('/metadata/figures/3150', 'ice-loss-from-the-two-polar-ice-sheets'), #34.17
('/metadata/figures/3091', 'published-climate-change-research-papers'), # 34.18
('/metadata/figures/3095', 'observed-and-projected-us-temperature-change'), # 34.19
('/metadata/figures/3075', 'caq-ten-indicators-of-a-warming-world'), # 34.2
('/metadata/figures/2657', 'coral-bleaching'), # 34.20
('/metadata/figures/2520', 'ocean-acidification-and-the-food-web'), # 34.21
('/metadata/figures/3636', 'caq-emissions-levels-determine-temperature-rises'), # 34.23
('/metadata/figures/2790', 'potential-tipping-points'), # 34.24
('/metadata/figures/2635', 'potential-effects-of-climate-change'), # 34.25
('/metadata/figures/3266', 'multiple-pathways-for-reducing-us-emissions'), #34.26
('/metadata/figures/2791', 'two-us-emissions-reduction-pathways'), # 34.27
('/metadata/figures/2792', 'emissions-reductions-and-carbon-dioxide-concentrations'), # 34.28
('/metadata/figures/2946', 'caq-indicators-of-warming-from-multiple-data-sets'), # 34.3
('/metadata/figures/3098', 'short-term-variations-versus-long-term-trend'), # 34.6
('/metadata/figures/3265', 'global-temperature-change-decade-averages'), # 34.7
('/metadata/figures/3134', 'temperature-trends-1900-2012'), # 34.8
('/metadata/figures/3099', 'decade-scale-changes-in-average-temperature-for-us-regions') # 34.9
])
......@@ -290,30 +319,38 @@ sync_metadata_tree = {
}
images_with_multiple_figures = {
'e13cdf2e-0699-4c52-a642-56c8fc3317c4': ['human-influence-on-the-greenhouse-effect', 'caq-human-influence-on-the-greenhouse-effect'], #33.1 #34.11
'03937439-cc5a-45c7-a0fd-78b863c49979': ['human-influence-on-the-greenhouse-effect', 'caq-human-influence-on-the-greenhouse-effect'], #33.1 #34.11
'0bcb7984-50c0-4f94-9946-c3fa635125a4': ['ten-indicators-of-a-warming-world', 'caq-ten-indicators-of-a-warming-world'], #2.1 #34.2
'eb9bd7dc-3e3a-4001-9a64-f2a0763b3f64': ['shells-dissolve-in-acidified-ocean-water', 'ocean-acidification-and-the-food-web'], #2.31 #34.21
'8c679de0-4a6c-4fc9-bbd1-59251ffe3d7f': ['shells-dissolve-in-acidified-ocean-water', 'ocean-acidification-and-the-food-web'], #2.31 #34.21
'a1bd40f2-424e-4af8-8d3d-f44ba7ba36b6': ['human-influences-apparent-in-many-aspects-of-the-changing-climate', 'caq-human-influences-apparent-in-many-aspects-of-the-changing-climate'], #33.17 #34.13
'834f7624-40de-4a09-9ced-faaca30d4d6d': ['ice-cover-in-the-great-lakes', 'midwest-ice-cover-in-the-great-lakes'], #2.27 #18.7
'eab9f2d3-6ebf-40ef-9d9b-fc7f9d62e693': ['cs-trends-in-flood-magnitude', 'trends-in-flood-magnitude'],
'd6b03280-7a3e-47ab-b109-caffc4bee634': ['projected-temperature-change-of-hottest-and-coldest-days', 'projected-temperature-change-of-hottest-days'], #2.20 #9.4
'9015558c-b1ad-4eb2-afe8-c7ea2caee2cd': ['projected-temperature-change-of-hottest-and-coldest-days', 'projected-temperature-change-of-hottest-days'], #2.20 #9.4
'bdbc59c7-c91e-496f-b4bd-9f584404df97': ['projected-change-in-heavy-precipitation-events', 'health-projected-change-in-heavy-precipitation-events'], #2.19 #9.6
'add6d6e7-30f0-4f44-bc2a-5b4a2ee4ce14': ['projected-change-in-heavy-precipitation-events', 'health-projected-change-in-heavy-precipitation-events'], #2.19 #9.6
'47b50ae0-e3d1-4e29-aff7-09de2bdf6648': ['separating-human-and-natural-influences-on-climate', 'caq-separating-human-and-natural-influences-on-climate'], #2.3 #34.15
'ebc4e8fb-f987-40da-9bbf-e36802241556': ['caq-carbon-emissions-in-the-industrial-age', 'carbon-emissions-in-the-industrial-age'] #33.3 #34.4
# 'e13cdf2e-0699-4c52-a642-56c8fc3317c4': ['human-influence-on-the-greenhouse-effect', 'caq-human-influence-on-the-greenhouse-effect'], #33.1 #34.11
# '03937439-cc5a-45c7-a0fd-78b863c49979': ['human-influence-on-the-greenhouse-effect', 'caq-human-influence-on-the-greenhouse-effect'], #33.1 #34.11
# '0bcb7984-50c0-4f94-9946-c3fa635125a4': ['ten-indicators-of-a-warming-world', 'caq-ten-indicators-of-a-warming-world'], #2.1 #34.2
# 'eb9bd7dc-3e3a-4001-9a64-f2a0763b3f64': ['shells-dissolve-in-acidified-ocean-water', 'ocean-acidification-and-the-food-web'], #2.31 #34.21
# '8c679de0-4a6c-4fc9-bbd1-59251ffe3d7f': ['shells-dissolve-in-acidified-ocean-water', 'ocean-acidification-and-the-food-web'], #2.31 #34.21
# 'a1bd40f2-424e-4af8-8d3d-f44ba7ba36b6': ['human-influences-apparent-in-many-aspects-of-the-changing-climate', 'caq-human-influences-apparent-in-many-aspects-of-the-changing-climate'], #33.17 #34.13
# '834f7624-40de-4a09-9ced-faaca30d4d6d': ['ice-cover-in-the-great-lakes', 'midwest-ice-cover-in-the-great-lakes'], #2.27 #18.7
# 'eab9f2d3-6ebf-40ef-9d9b-fc7f9d62e693': ['cs-trends-in-flood-magnitude', 'trends-in-flood-magnitude'],
# 'd6b03280-7a3e-47ab-b109-caffc4bee634': ['projected-temperature-change-of-hottest-and-coldest-days', 'projected-temperature-change-of-hottest-days'], #2.20 #9.4
# '9015558c-b1ad-4eb2-afe8-c7ea2caee2cd': ['projected-temperature-change-of-hottest-and-coldest-days', 'projected-temperature-change-of-hottest-days'], #2.20 #9.4
# 'bdbc59c7-c91e-496f-b4bd-9f584404df97': ['projected-change-in-heavy-precipitation-events', 'health-projected-change-in-heavy-precipitation-events'], #2.19 #9.6
# 'add6d6e7-30f0-4f44-bc2a-5b4a2ee4ce14': ['projected-change-in-heavy-precipitation-events', 'health-projected-change-in-heavy-precipitation-events'], #2.19 #9.6
# '47b50ae0-e3d1-4e29-aff7-09de2bdf6648': ['separating-human-and-natural-influences-on-climate', 'caq-separating-human-and-natural-influences-on-climate'], #2.3 #34.15
# 'ebc4e8fb-f987-40da-9bbf-e36802241556': ['caq-carbon-emissions-in-the-industrial-age', 'carbon-emissions-in-the-industrial-age'], #33.3 #34.4
# '2d6fb90b-7d3d-4fce-8f63-36459f80d366': ['projected-annually-averaged-temperature-change', 'observed-and-projected-us-temperature-change'], #33.20 #34.19
'40d9d5ef-fe78-4d80-bdf8-024cac2c0176': ['observed-change-in-global-average-temperature', 'caq-observed-change-in-global-average-temperature'], #33.8 #34.16
# 'a405fab3-ee62-401c-8d93-347261d9eab9': ['emissions-levels-determine-temperature-rises', 'caq-emissions-levels-determine-temperature-rises'], #2.4 #34.23
# '6dafc8d5-9e40-4dd6-a63d-d456ec61a551': ['emissions-levels-determine-temperature-rises', 'caq-emissions-levels-determine-temperature-rises'], #2.4 #34.23
}
def main():
print gcis.test_login()
# sync_dataset_metadata(gcis, webform.get_aggregated_datasets().values())
sync(replace=True)
cleanup_after_replace()
# print gcis.test_login()
# sync_dataset_metadata(gcis, webform.get_webform('/metadata/figures/3264').images[0].datasets[0:1])
# sync(replace=True)
# cleanup_after_replace()
count = 0
for x in sync_metadata_tree['nca3']:
count += len(sync_metadata_tree['nca3'][x])
print float(count - 11) / 284.0
def sync(replace=False):
count = 0
......
......@@ -268,6 +268,12 @@ class Dataset(GcisObject):
'World Climate Research Program\'s (WCRP\'s) Coupled Model Intercomparison Project phase 5 (CMIP5) multi-model ensemble': 'nca3-cmip5-r1',
'Global CO2 Emissions from Fossil-Fuel Burning, Cement Manufacture, and Gas Flaring: 1751-2009': 'nca3-doe-co2-r201209',
'Proxy-based reconstructions of hemispheric and global surface temperature variations over the past two millennia': 'nca3-mann-recons-r200809',
'EPICA Dome C Ice Core 800KYr Carbon Dioxide Data': 'nca3-epica-ice-core-r20080515',
'Western U.S. Percent Area Moderately to Extremely Dry and Moderately to Extremely Wet': 'nca3-western-us-wet-dry-r2012',
'Total Wildland Fires and Acres (1960-2009)': 'nca3-wildland-fires-r1',
'HadCRUT4': 'nca3-hadcrut4-v4_1_1_0',
'GISS Surface Temperature Analysis (GISTEMP)': 'nca3-gistemp-r2010',
'Solar Constant': 'nca3-solar-constant-r20131003',
#Surely we can do better
'Proxy Data': 'nca3-proxy-data-r1',
......@@ -570,8 +576,9 @@ class Parent(Gcisbase):
'Regional Climate Trends and Scenarios for the U.S. National Climate Assessment. Part 5. Climate of the Southwest U.S.': 'noaa-techreport-nesdis-142-5',
'Regional Climate Trends and Scenarios for the U.S. National Climate Assessment. Part 7. Climate of Alaska': 'noaa-techreport-nesdis-142-7',
'Reclamation, SECURE Water Act Section 9503(c) - Reclamation Climate Change and Water, Report to Congress': 'usbr-secure-2011',
'The Physical Science Basis. Contribution of Working Group I to the Fourth AR4 of IPCC': 'ipcc-wg1-ar5-physical-science-basis'
'The Physical Science Basis. Contribution of Working Group I to the Fourth AR4 of IPCC': 'ipcc-wg1-ar5-physical-science-basis',
'2005 Louisiana Hurricane Impact Atlas': 'lgic-lahurricane-2006',
'2009 State of the Climate Highlights': 'noaa-stateofclim-2009',
},
'webpage': {
......@@ -594,7 +601,9 @@ class Parent(Gcisbase):
'2007 Census Ag Atlas Maps: Crops and Plants': 'f39c0146-137f-4668-b401-5972fe40208d',
'NRCS Photo Gallery': '13da595f-e0f0-4ad0-b87b-44ce3897cd30',
'Billion-Dollar Weather/Climate Disasters: Mapping': 'd70d7a59-45d7-4b38-baf2-86a7fcf12da3',
'Before and After: 50 Years of Rising Tides and Sinking Marshes': '6778161f-897b-4f89-942f-8ad2f01f11a0'
'Before and After: 50 Years of Rising Tides and Sinking Marshes': '6778161f-897b-4f89-942f-8ad2f01f11a0',
'Influence of El Nino and La Nina on Southwest Rainfall': '6d0a1cba-70fe-4fa3-a630-c45409115ab8',
'Map of Sea Level Trends': '2ab182cc-171d-4edd-9f9f-51e8b4cc2584'
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment