Skip to content

Commit 43a8ddb

Browse files
WIP - more prep to add GEOPHIRES profile data to graph
1 parent 70863ce commit 43a8ddb

2 files changed

Lines changed: 34 additions & 12 deletions

File tree

src/geophires_docs/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ def _get_input_parameters_dict( # TODO consolidate with FervoProjectCape5TestCa
8282
return ret
8383

8484

85-
def _get_full_profile(input_and_result: tuple[GeophiresInputParameters, GeophiresXResult], profile_key: str):
85+
def _get_full_profile(
86+
input_and_result: tuple[GeophiresInputParameters, GeophiresXResult], profile_key: str
87+
) -> list[PlainQuantity]:
88+
"""
89+
:return: List of data points with length Time steps per year * Plant lifetime
90+
"""
91+
8692
input_params: GeophiresInputParameters = input_and_result[0]
8793
result = GeophiresXClient().get_geophires_result(input_params)
8894

@@ -95,5 +101,7 @@ def _get_full_profile(input_and_result: tuple[GeophiresInputParameters, Geophire
95101
return profile
96102

97103

98-
def _get_full_production_temperature_profile(input_and_result: tuple[GeophiresInputParameters, GeophiresXResult]):
104+
def _get_full_production_temperature_profile(
105+
input_and_result: tuple[GeophiresInputParameters, GeophiresXResult],
106+
) -> list[PlainQuantity]:
99107
return _get_full_profile(input_and_result, 'Produced Temperature')

src/geophires_docs/generate_fervo_project_red_2026_docs.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
from scipy.ndimage import maximum_filter
99

1010
from geophires_docs import _PROJECT_ROOT
11+
from geophires_docs import _get_full_production_temperature_profile
1112
from geophires_docs import _get_logger
13+
from geophires_x_client import GeophiresXResult
14+
from geophires_x_client import ImmutableGeophiresInputParameters
1215

1316
_log = _get_logger(__name__)
1417

@@ -230,7 +233,7 @@ def _get_steady_state_mask(df_prod: pd.DataFrame, steady_state_start_years: floa
230233
def _generate_production_temperature_graph_from_fervo_graph_data_csv_and_project_red_geophires_result_data(
231234
production_csv_path: Path,
232235
model_csv_path: Path,
233-
steady_state_csv_path: Path,
236+
# steady_state_csv_path: Path, # unused...
234237
output_path: Path,
235238
steady_state_start_years: float = _STEADY_STATE_START_YEARS,
236239
# TODO/WIP pass GEOPHIRES production profile data
@@ -271,7 +274,7 @@ def _generate_production_temperature_graph_from_fervo_graph_data_csv_and_project
271274
alpha=0.5,
272275
label='Measured '
273276
# f'Flowing '
274-
'Temperature (Excluded Operational Periods)',
277+
'Temperature (Excluded Operational Periods)', # TODO better wording/phrasing
275278
# f', n={len(df_excluded)}',
276279
)
277280

@@ -287,9 +290,7 @@ def _generate_production_temperature_graph_from_fervo_graph_data_csv_and_project
287290
ax.set_xlabel('Time (Years)', fontsize=12)
288291
ax.set_ylabel('Temperature (°C)', fontsize=12)
289292
ax.set_title(
290-
'Project Red Temperature: Measured vs. Fervo-Modeled'
291-
# ' vs. GEOPHIRES-Modeled' # WIP/TODO
292-
'',
293+
'Project Red Temperature: Measured vs. Fervo-Modeled' ' vs. GEOPHIRES-Modeled' '',
293294
fontsize=13,
294295
)
295296

@@ -305,11 +306,13 @@ def _generate_production_temperature_graph_from_fervo_graph_data_csv_and_project
305306
plt.close(fig)
306307

307308

309+
def _get_file_path(file_name) -> Path:
310+
return Path(__file__).parent / file_name
311+
312+
308313
if __name__ == '__main__':
309-
IMAGE_PATH = Path(__file__).parent / 'fervo-project-red-2026_figure-5_measured-flowing-temperature.png'
310-
PRODUCTION_IMAGE_PATH = (
311-
Path(__file__).parent / 'fervo_project_red-2026_graph-data-extraction_production-series-edited.png'
312-
)
314+
IMAGE_PATH = _get_file_path('fervo-project-red-2026_figure-5_measured-flowing-temperature.png')
315+
PRODUCTION_IMAGE_PATH = _get_file_path('fervo_project_red-2026_graph-data-extraction_production-series-edited.png')
313316

314317
_BUILD_DIR.mkdir(parents=True, exist_ok=True)
315318
production_csv_path = _BUILD_DIR / _PRODUCTION_CSV_FILENAME
@@ -343,7 +346,18 @@ def _generate_production_temperature_graph_from_fervo_graph_data_csv_and_project
343346
df_steady_state.to_csv(steady_state_csv_path, index=False)
344347
_log.info(f'Wrote variance analysis CSV: {steady_state_csv_path}')
345348

349+
project_red_geophires_result_data = _get_full_production_temperature_profile(
350+
ImmutableGeophiresInputParameters(
351+
from_file_path=_get_file_path('../../tests/examples/Fervo_Project_Red-2026.txt')
352+
),
353+
GeophiresXResult(_get_file_path('../../tests/examples/Fervo_Project_Red-2026.out')),
354+
)
355+
346356
_generate_production_temperature_graph_from_fervo_graph_data_csv_and_project_red_geophires_result_data(
347-
production_csv_path, model_csv_path, steady_state_csv_path, regenerated_graph_path
357+
production_csv_path,
358+
model_csv_path,
359+
# steady_state_csv_path, # unused...
360+
regenerated_graph_path,
361+
# TODO/WIP pass project_red_geophires_result_data as series with interpolation matching csvs
348362
)
349363
_log.info(f'Wrote regenerated graph: {regenerated_graph_path}')

0 commit comments

Comments
 (0)