3 :synopsis: Combines figures and network information to make the output report pdf
5 :maintainer: Jeffrey Hyman
6 :moduleauthor: Jeffrey Hyman <jhyman@lanl.gov>
12 dfnworks_image_black =
"/Users/jhyman/src/dfnworks-main/pydfnworks/pydfnworks/dfnGen/generation/output_report/figures/dfnWorks.all.black.png"
13 lanl_image =
"/Users/jhyman/src/dfnworks-main/pydfnworks/pydfnworks/dfnGen/generation/output_report/figures/lanl-logo-footer.png"
20 self.image(dfnworks_image_black, x=5, y=8, w=50)
21 self.set_font(
'Times',
'B', 18)
22 self.text(x=100, y=10, txt=f
'dfnGen Output Report: {name}')
23 self.image(lanl_image, x=240, y=2, w=50)
30 self.set_font(
'Times',
'I', 8)
32 self.cell(0, 10,
'Page ' + str(self.page_no()), 0, 0,
'C')
36 """ Creates Table of contents
41 General dictionary of output analysis code. Contains information on number of families, number of fractures, and colors.
56 print(
"--> Making Table of Contents")
59 pdf.image(f
"{params['output_dir']}/network/network_orientations.png",
63 pdf.text(x=10, y=50, txt=
"Page 1: Table of Contents")
64 pdf.text(x=10, y=60, txt=
"Page 2: Network Summary")
65 for i
in range(1, params[
"num_families"] + 1):
66 pdf.text(x=10, y=60 + i * 10, txt=f
"Page {2+i}: Family Number {i}")
68 y=60 + (params[
"num_families"] + 1) * 10,
69 txt=f
"Page {3+params['num_families']}: FRAM information")
75 """ Creates block text for the entire network.
81 Output report dictionary containing general parameters. See output_report for more details
86 Block of text with information about the network.
93 text = f
'Jobname: {params["jobname"]}\n\
94 Number of fracture families:\t{params["num_families"]}\n\
95 Total number of fractures:\t{params["num_total_fractures"]}\n\
96 Fractures in connected network:\t{params["num_accepted_fractures"]}\n\
98 x : {-0.5 * params["domain"]["x"]} x {0.5 * params["domain"]["x"]}\
99 y : {-0.5 * params["domain"]["y"]} x {0.5 * params["domain"]["y"]} \
100 z : {-0.5 * params["domain"]["z"]} x {0.5 * params["domain"]["z"]}\n'
102 text += f
'Entire Network:\n'
103 text += f
' P30: {params["Pre-Iso Total Fracture Density (P30)"]:0.2e} / '
104 text += f
'P32 : {params["Pre-Iso Total Fracture Intensity (P32)"]:0.2e} / '
105 text += f
'P33: {params["Pre-Iso Total Fracture Porosity (P33)"]:0.2e}\n'
107 text += f
'Connected Network:\n'
108 text += f
' P30: {params["Post-Iso Total Fracture Density (P30)"]:0.2e} / '
109 text += f
'P32: {params["Post-Iso Total Fracture Intensity (P32)"]:0.2e} / '
110 text += f
'P33: {params["Post-Iso Total Fracture Porosity (P33)"]:0.2e}\n'
116 """ Add page about the entire network
120 General dictionary of output analysis code. Contains information on number of families, number of fractures, and colors.
135 if params[
"verbose"]:
136 print(f
"--> Working on Entire Network")
138 pdf.text(x=120, y=20, txt=f
'Network Summary')
140 pdf.image(f
"{params['output_dir']}/network/all_fracture_centers.png",
144 pdf.image(f
"{params['output_dir']}/network/network_all_radii.png",
148 pdf.image(f
"{params['output_dir']}/network/network_orientations.png",
155 pdf.set_xy(x=165, y=110)
156 pdf.set_font(
'Times', size=14)
157 pdf.multi_cell(0, 7, text, 1)
163 """ Creates block text for one family
169 Fracture family dictionary
174 Block of text with information about the family.
182 dist = family[
"Distribution"]
183 text = f
'Number of Fractures: {family["final_number_of_fractures"]}, Shape: {family["Shape"]}\n'
184 text += f
'Radii Distribution: {dist}\n'
185 if dist ==
'Truncated Power-Law':
186 text += f
'\t - alpha: {family["Alpha"]}\n'
187 elif dist ==
'Lognormal':
188 text += f
'\t - mu: {family["Mean"]}, sigma: {family["Standard Deviation"]}\n'
189 elif dist ==
'Exponential':
190 text += f
'\t - lambda: {family["Lambda"]}\n'
191 if dist !=
"Constant":
192 text += f
'\t - Min. Radius: {family["Minimum Radius (m)"]} m, Max. Radius: {family["Maximum Radius (m)"]} m\n'
193 text += f
'Orientation - Kappa: {family["Kappa"]}, Theta-deg: {family["Theta-deg"]}, Phi-deg: {family["Phi-deg"]}\n'
195 if "P32 (Fracture Intensity) Target" in keys:
196 text += f
'Target P32: {family["P32 (Fracture Intensity) Target"]}, Final P32: {family["Post-Iso Fracture Intensity (P32)"]}'
198 text += f
'Final P32: {family["Post-Iso Fracture Intensity (P32)"]}\n'
203 """ Add page about fracture family.
208 General dictionary of output analysis code. Contains information on number of families, number of fractures, and colors.
210 Dictionary of information about a fracture family
226 if params[
"verbose"]:
227 print(f
"--> Working on Family {family['Global Family']}")
229 pdf.text(x=120, y=20, txt=f
'Fracture Family Number {i}')
230 pdf.image(f
"{params['output_dir']}/family_{i}/family_{i}_centers.png",
234 if family[
"Distribution"] !=
"Constant":
235 pdf.image(f
"{params['output_dir']}/family_{i}/family_{i}_radii.png",
239 pdf.image(f
"{params['output_dir']}/family_{i}/family_{i}_orienations.png",
244 pdf.set_xy(x=165, y=130)
245 pdf.set_font(
'Times', size=14)
246 pdf.multi_cell(0, 7, text, 1)
251 """ Add Page about FRAM information
256 General dictionary of output analysis code. Contains information on number of families, number of fractures, and colors.
270 if params[
"verbose"]:
271 print(
"--> FRAM information")
274 pdf.text(x=120, y=20, txt=f
'FRAM Information')
275 pdf.image(f
"{params['output_dir']}/network/fram_information.png",
283 """ Combines plots and information to make the final output report pdf.
288 General dictionary of output analysis code. Contains information on number of families, number of fractures, and colors.
290 families: list of fracture family dictionaries
291 Created by get_family_information
293 fractures: list of fracture dictionaries
294 Created by get_fracture_information
306 print(
"\n--> Combing Images and Making PDF")
309 name = params[
"jobname"]
311 pdf =
PDF(orientation=
"L")
316 for i
in range(1, params[
"num_families"] + 1):
322 pdf.output(f
"{name}_output_report.pdf",
"F")
def create_family_text(family)
def add_fram_page(params, pdf)
def add_family_page(params, family, i, pdf)
def add_network_page(params, pdf)
def add_table_of_contents(params, pdf)
def make_pdf(params, families, fractures)
def create_network_text(params)