Created
November 30, 2017 11:33
-
-
Save prl900/62aeea4253c7c73f5182515f53ec378a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<type 'netCDF4._netCDF4.Dataset'>\n", | |
"root group (NETCDF4 data model, file format HDF5):\n", | |
" publisher_email: [email protected]\n", | |
" creator_name: Zac Hatfield-Dodds\n", | |
" license: Creative Commons with Attribution (https://creativecommons.org/licenses/by/3.0/au/deed.en)\n", | |
" title: Live Vegetation Moisture Content (LVMC), Australia Coverage.\n", | |
" keywords_vocabulary: GCMD Science Keywords, Version 8.0.0.0.0\n", | |
" standard_name_vocabulary: CF Standard Names, v28\n", | |
" acknowledgement: This dataset was made possible through funding from the Bushfire and Natural Hazards CRC through the project 'Mapping bushfire hazard and impacts'\n", | |
" summary: Live Fuel moisture content (LFMC), the mass of water contained within live vegetation in relation to the dry mass, is a critical variable affecting fire interactions with fuel. LFMC is one of the primary variables in many fire behavior prediction models and fire danger indices, as it affects ignition, combustion, the amount of available fuel, fire severity and spread, and smoke generation and composition (Text from Yebra, M., Chuvieco, E., Danson, M., Dennison, P., Hunt, E.R, Jurdao, S., Riano, D., Zylstra, P, 2013. A global review of remote sensing of live fuel moisture content for fire danger assessment: moving towards operational products. Remote sensing of environment.136, 455-468.).\n", | |
" creator_email: [email protected]\n", | |
" references: Yebra, M., van Dijk, A., Quan, X., Cary, G. Monitoring and forecasting fuel moisture content for Australia using a combination of remote sensing and modelling. Proceedings for the 5th International Fire Behaviour and Fuels Conference. April 11-15, 2016, Melbourne, Australia. Published by the International Association of Wildland Fire, Missoula, Montana, USA\n", | |
" source: The original MODIS data used to generate the Live Vegetation Moisture Content Product were supplied by the Land Processes Distributed Active Archive Center (LPDAAC), located at the U.S. Geological Survey (USGS) Earth Resources Observation and Science Center (EROS) http://lpdaac.usgs.gov.\n", | |
" publisher_url: https://researchers.anu.edu.au/researchers/yebra-m\n", | |
" keywords: EARTH SCIENCE > BIOSPHERE > VEGETATION > LEAF CHARACTERISTICS , EARTH SCIENCE > BIOSPHERE > VEGETATION > LIVE FUEL MOISTURE CONTENT\n", | |
" creator_url: http://fennerschool.anu.edu.au/about-us/people/zachary-hatfield-dodds\n", | |
" Conventions: CF-1.6, ACDD-1.3\n", | |
" publisher_name: ANU/Fenner School of Environment & Society\n", | |
" institution: Australian National University\n", | |
" history: \n", | |
" dimensions(sizes): y(2400), x(2400), time(92)\n", | |
" variables(dimensions): float64 \u001b[4my\u001b[0m(y), float64 \u001b[4mx\u001b[0m(x), float32 \u001b[4mlvmc_mean\u001b[0m(time,y,x), float32 \u001b[4mlvmc_stdv\u001b[0m(time,y,x), int32 \u001b[4mtime\u001b[0m(time), |S1 \u001b[4msinusoidal\u001b[0m()\n", | |
" groups: " | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"from netCDF4 import Dataset\n", | |
"ds = Dataset(\"/Users/pablo/Downloads/LVMC_2016_h30v12.nc\", \"r\")\n", | |
"ds" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 32, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"datetime.datetime(2016, 8, 20, 0, 0)" | |
] | |
}, | |
"execution_count": 32, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"from netCDF4 import num2date\n", | |
"import datetime\n", | |
"\n", | |
"num2date(ds[\"time\"][:],units=ds[\"time\"].units,calendar=ds[\"time\"].calendar)[58]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 34, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.image.AxesImage at 0x11ed5cf10>" | |
] | |
}, | |
"execution_count": 34, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPgAAAD8CAYAAABaQGkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAACbdJREFUeJzt3c2LXYUdxvHn6TSiqMVFpxIyaeNC\nBBGq9ZJNoNBgS3xBu1TQlTCbCpEWRJf+A+Kmm6DSFluDYAWxtjagQQK+3YnRGkdLEItDhImIaDaV\n6NPF3MBYY+6Z3HPmnPz8fmBwJl6uD+N8c+69M3OOkwhATd/rewCA7hA4UBiBA4UROFAYgQOFEThQ\nGIEDhRE4UBiBA4V9v4s7/aGdHV3cMTqzpOv7noAN+UDJx552q04C3yFp3MUdozPm/9h5ZtToVjxE\nBwojcKAwAgcKI3CgMAIHCiNwoDACBwojcKAwAgcKI3CgMAIHCiNwoDACBwprFLjtPbbfs33M9v1d\njwLQjqmB256T9HtJN0q6WtIdtq/uehiA2TU5gu+UdCzJ+0m+kLRf0m3dzgLQhiaBb5P04bqPVyZ/\n9jW2F22PbY9PtLUOwEyaBH6m08J844qFSfYlGSUZzc++C0ALmgS+Imn7uo8XJB3vZg6ANjUJ/HVJ\nV9q+wvYFkm6X9Ey3swC0YepJF5Ocsn2PpOclzUl6LMnRzpcBmFmjs6omeU7Scx1vAdAyfpINKIzA\ngcIIHCiMwIHCCBwojMCBwggcKIzAgcIIHCiMwIHCCBwojMCBwhr9sslGLel6WeMu7hodyRnP69Gj\nfOOcIv3zcD5Ho4a34wgOFEbgQGEEDhRG4EBhBA4URuBAYQQOFEbgQGEEDhRG4EBhBA4URuBAYQQO\nFEbgQGFTA7f9mO1V229vxiAA7WlyBP+DpD0d7wDQgamBJ3lJ0i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94xZ/uIpFVJB5L0ukfSw5Luk/RVzzvW2/SLeA4xcJ/hz4b1\nPGIgbF8i6SlJ9yb5rM8tSb5Mcq2kBUk7bff2VMb2LZJWkyz1teFb7EryM0k3SvrN5Klfp4YY+Iqk\n7es+XpB0vKctgzV5rvuUpD8n+Wvfe05L8qmkg5L29Dhjl6RbJ89590vabfvxHvdIanYRz7YNMfDX\nJV1p+wrbF0i6XdIzPW8alMmLWo9KWk7y0AD2zNu+bPL+RZJukPRuX3uSPJBkIckOrX39vJDkzr72\nSP1dxHNwgSc5JekeSc9r7cWjJ5Mc7XOT7SckvSzpKtsrtu/uc4/WjlB3ae3IdGTydlOPe7ZKetH2\nW1r7C/pAkkF8a2pALpd0yPabkl6T9LfNuIjn4L5NBqA9gzuCA2gPgQOFEThQGIEDhRE4UBiBA4UR\nOFAYgQOF/Q/12kqnIEUT9QAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x11a51fa90>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%matplotlib inline\n", | |
"\n", | |
"import matplotlib\n", | |
"import matplotlib.pyplot as plt\n", | |
"\n", | |
"cmap = matplotlib.colors.ListedColormap(['red', 'blue'])\n", | |
"\n", | |
"plt.imshow(ds[\"lvmc_mean\"][58,82:88,1219:1225], cmap=cmap, interpolation='nearest')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 2", | |
"language": "python", | |
"name": "python2" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython2", | |
"version": "2.7.13" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment