Skip to content
Snippets Groups Projects
Commit b9b618c0 authored by Kwang, Jeffrey S's avatar Kwang, Jeffrey S
Browse files

reorganize files and filenames. made sure image previews are correct

parent 1b2566d8
No related branches found
No related tags found
1 merge request!70Adds the Python code for creating two of the FireInIce visualizations.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 576 576">
<defs>
<style>
.cls-1 {
fill: none;
stroke: #000;
stroke-miterlimit: 10;
}
</style>
</defs>
<!-- Generator: Adobe Illustrator 28.7.1, SVG Export Plug-In . SVG Version: 1.2.0 Build 142) -->
<g>
<g id="Layer_1">
<path class="cls-1" d="M521.5,170.5v289H54.5V170.5h161v.5H55v288h466V171h-160.5v-.5h161ZM216,117h144v53.5h.5v-54h-145v54h.5v-53.5ZM360,171h.5v.5h160v287H55.5V171.5h160v-.5h.5v-.5h.5v-53h143v53h.5v.5Z"/>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 73 325.6">
<defs>
<style>
.cls-1 {
fill: #fff;
stroke: #231f20;
stroke-miterlimit: 10;
}
</style>
</defs>
<!-- Generator: Adobe Illustrator 28.7.1, SVG Export Plug-In . SVG Version: 1.2.0 Build 142) -->
<g>
<g id="Layer_1">
<path class="cls-1" d="M.5,288.5V.5h72v288l-36,36.4L.5,288.9"/>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -72,8 +72,8 @@ def main(
renderfile,
extent_shpfile,
forward_trajectory_files,
aerosol_mapfile,
aerosol_svg_mapfile
regional_fires_mapfile,
regional_fires_svg_mapfile
):
# make figure
......@@ -163,13 +163,13 @@ def main(
#label wild fire location
x_offset_label = -50000
y_offset_label = -200000
ax.text(gdf_for_traj.geometry.x[0]-x_offset_label,gdf_for_traj.geometry.y[0]+y_offset_label,fire_labels[i],color='w',fontsize=label_fontsize,va='center',ha='right',alpha=0.0,gid='wildfire-label-'+str(i),
ax.text(gdf_for_traj.geometry.x[0]-x_offset_label,gdf_for_traj.geometry.y[0]+y_offset_label,fire_labels[i],color='w',fontsize=label_fontsize,va='center',ha='right',alpha=1.0,gid='wildfire-label-'+str(i),
bbox=dict(facecolor=(0,0,0,0.75),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
# juneau icefield symbol and label
x_offset_ice_label = 120000
y_offset_ice_label = 60000
gdf_juneau_icefield = gpd.GeoDataFrame({'geometry': [Point(58.842, -134.188)], 'name': ['Sample Point']})
gdf_juneau_icefield = gpd.GeoDataFrame({'geometry': [Point(-134.188,58.842)], 'name': ['Sample Point']}, crs="EPSG:4326").to_crs(map_crs)
ax.scatter(gdf_juneau_icefield.geometry.x[0],gdf_juneau_icefield.geometry.y[0],s=400,linewidth=1.5,marker='v',facecolor='tab:blue',edgecolor='k',zorder=3,gid='sink-'+str(i))
ax.text(gdf_juneau_icefield.geometry.x[0]+x_offset_ice_label,gdf_juneau_icefield.geometry.y[0]+y_offset_ice_label,"Juneau\nIcefield",color='w',fontsize=label_fontsize,va='center',ha='left',alpha=1.0,gid='JIF-label',
bbox=dict(facecolor=(0,0,0,0.75),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
......@@ -179,15 +179,15 @@ def main(
bbox=dict(facecolor=(0,0,0,0.75),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
# mobile only annotations
ax.text((west+east)/2.0,south+0.1*(north-south),"Click here to show the major regional\nwildfires that occurred from 2015-2016",color='w',fontsize=big_label_fontsize,va='center',ha='center',alpha=1.0,gid='multi-path-label-mb-1',
bbox=dict(facecolor=(0,0,0,0.75),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
ax.text((west+east)/2.0,south+0.1*(north-south),"Click here to show the major regional\nwildfires that occurred from 2015-2016",color='w',fontsize=big_label_fontsize,va='center',ha='center',alpha=0.0,gid='multi-path-label-mb-1',
bbox=dict(facecolor=(0,0,0,0.0),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
ax.text((west+east)/2.0,south+0.1*(north-south),"Click fires to show all potential smoke\npaths within a 10-day window",color='w',fontsize=big_label_fontsize,va='center',ha='center',alpha=1.0,gid='multi-path-label-mb-2',
bbox=dict(facecolor=(0,0,0,0.75),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
ax.text((west+east)/2.0,south+0.1*(north-south),"Click fires to show all potential smoke\npaths within a 10-day window",color='w',fontsize=big_label_fontsize,va='center',ha='center',alpha=0.0,gid='multi-path-label-mb-2',
bbox=dict(facecolor=(0,0,0,0.0),boxstyle='round', edgecolor='none', pad=0.2,linewidth=0.0))
# save file
fig.savefig(aerosol_mapfile,dpi=240)
fig.savefig(aerosol_svg_mapfile,dpi=240,transparent=True)
fig.savefig(regional_fires_mapfile,dpi=240)
fig.savefig(regional_fires_svg_mapfile,dpi=240,transparent=True)
if __name__ == "__main__":
fires = snakemake.params["fires"]
......@@ -195,14 +195,14 @@ if __name__ == "__main__":
renderfile = snakemake.input["renderfile"]
extent_shpfile = snakemake.input["extent_shpfile"]
forward_trajectory_files = snakemake.input["forward_trajectory_files"]
aerosol_mapfile = snakemake.output["aerosol_mapfile"]
aerosol_svg_mapfile = snakemake.output["aerosol_svg_mapfile"]
regional_fires_mapfile = snakemake.output["regional_fires_mapfile"]
regional_fires_svg_mapfile = snakemake.output["regional_fires_svg_mapfile"]
main(
fires,
fire_labels,
renderfile,
extent_shpfile,
forward_trajectory_files,
aerosol_mapfile,
aerosol_svg_mapfile
regional_fires_mapfile,
regional_fires_svg_mapfile
)
\ No newline at end of file
......@@ -349,7 +349,7 @@ def main(
#legend
ax_texturemap.scatter(0,0,facecolor=core_color,edgecolor='k',linewidth=1.0,marker=cent_drillicon,s=802,label='Ice Core')
ax_texturemap.scatter(0,0,facecolor="tab:red",edgecolor='k',linewidth=1.0,marker=camicon,s=402,alpha=0.8,label='Photo')
ax_texturemap.legend(loc='right',facecolor='w',edgecolor='none',framealpha=0.75, fancybox=False,markerfirst=True)
ax_texturemap.legend(loc='right',bbox_to_anchor=(1.01, 0.5),facecolor='w',edgecolor='none',framealpha=0.75, fancybox=False,markerfirst=True)
#make the scale bar
sclx1 = buff_west + (buff_east-buff_west) * scale_bar_rel_x
......@@ -390,11 +390,11 @@ def main(
ax_texturemap.text(0.01,0.99,"Click to MRI\nthe glacier!",
transform=ax_texturemap.transAxes,fontweight='bold',va='top',ha='left',fontsize=tutorial_fontsize,zorder=6,
bbox=dict(facecolor='w', alpha=0.7, edgecolor="none",pad=2.0),gid='tutorial-mb-1')
bbox=dict(facecolor='w', alpha=0.0, edgecolor="none",pad=2.0),gid='tutorial-mb-1',alpha=0.0)
ax_texturemap.text(0.99,0.625,"Click on\npoints of\ninterest!",
transform=ax_texturemap.transAxes,fontweight='bold',va='bottom',ha='right',fontsize=tutorial_fontsize,zorder=6,
bbox=dict(facecolor='w', alpha=0.7, edgecolor="none",pad=2.0),gid='tutorial-mb-2')
bbox=dict(facecolor='w', alpha=0.0, edgecolor="none",pad=2.0),gid='tutorial-mb-2',alpha=0.0)
# tutorial arrow
tutorial_arrow = mpl.patches.FancyArrowPatch((0.32,0.95),(0.45,0.55) , transform = ax_texturemap.transAxes, gid = "tutorial_arrow",
......
......@@ -7,7 +7,7 @@ rule all:
# HYSPLIT model's parameters were taken from https://iopscience.iop.org/article/10.1088/1748-9326/ab8fd2/pdf
# This makes the svg map for the regional fires viz
rule aerosol_map:
rule regional_fires_map:
params:
fires = 2,
fire_labels = ["Dennison Fork\n2015 Wildfire","Steamboat Creek\n2016 Wildfire"]
......@@ -16,10 +16,10 @@ rule aerosol_map:
extent_shpfile = "2_visualize/in/extent_{name}.shp",
forward_trajectory_files = ["2_visualize/in/tdump.111986.txt","2_visualize/in/tdump.160303.txt"]
output:
aerosol_mapfile = "2_visualize/out/{name}_map.png",
aerosol_svg_mapfile = "2_visualize/out/{name}_map.svg"
regional_fires_mapfile = "2_visualize/out/{name}_map.png",
regional_fires_svg_mapfile = "2_visualize/out/{name}_map.svg"
script:
"2_visualize/src/aerosol_map.py"
"2_visualize/src/regional_fires_map.py"
# remove the metadata from the svg and save into the data_out folder
rule remove_metadata:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment