You have been given an HDF5 data file containing a raster dataset (dataset path: /data/assignment) and a colleague has asked for it in ASCII raster format. Your mission—should you choose to accept it—is to:
extract the data from the HDF5 file along with any and all relevant attributes;
save the data in a valid ASCII raster format; and
create a visualization that shows where in the world the raster is located.
Add and commit your Python script (sandbox/sb5_dt-woods.py) to the repository. Create a PNG file of your raster data and copy it as a comment it to this issue along with your answer to "where in the world is this raster located?"
Script Requirements
Your Python script should execute in the sandbox folder and:
produce an ASC raster file in the sandbox directory; name your output username.asc (e.g., dt-woods.asc)
read the HDF5 file (data/sandbox5.hdf); it is your choice whether to hardcode the path, take a directory path or file path as an argument or input (it should be clear what you choose to do)
use the h5py Python package for reading the HDF file
have any and all package import statements at the top of your script
Output ASCII File Requirements
Your ascii file should:
have all the correct headings in the correct order (remember Sandbox Challenge 4)
have the correct data organized in the correct number of rows and columns in integer format
(optional) include the accompanying .prj file with the spatial reference information
You may use any tools to create your visualization, but it should be in PNG file format and be less than 1 MB file size (it does not need to be automated by your script).
The Challenge
You have been given an HDF5 data file containing a raster dataset (dataset path:
/data/assignment
) and a colleague has asked for it in ASCII raster format. Your mission—should you choose to accept it—is to:Add and commit your Python script
(sandbox/sb5_dt-woods.py
) to the repository. Create a PNG file of your raster data and copy it as a comment it to this issue along with your answer to "where in the world is this raster located?"Script Requirements
Your Python script should execute in the
sandbox
folder and:sandbox
directory; name your outputusername.asc
(e.g.,dt-woods.asc
)data/sandbox5.hdf
); it is your choice whether to hardcode the path, take a directory path or file path as an argument or input (it should be clear what you choose to do)h5py
Python package for reading the HDF fileOutput ASCII File Requirements
Your ascii file should:
You may use any tools to create your visualization, but it should be in PNG file format and be less than 1 MB file size (it does not need to be automated by your script).