|
160 | 160 | " granule_id=[imagenator_info['granule_id']],\n", |
161 | 161 | " variables='product/vertical_column_stratosphere',\n", |
162 | 162 | " format='image/png',\n", |
| 163 | + " labels=['imagenator-l2-tempo-no2'],\n", |
163 | 164 | " )\n", |
164 | 165 | "\n", |
165 | 166 | " job_id = harmony_client.submit(request)\n", |
|
247 | 248 | " granule_id=[imagenator_info['granule_id']],\n", |
248 | 249 | " variables='product/vertical_column_stratosphere',\n", |
249 | 250 | " format='image/png',\n", |
| 251 | + " labels=['imagenator-l3-tempo-no2'],\n", |
250 | 252 | " )\n", |
251 | 253 | "\n", |
252 | 254 | " job_id = harmony_client.submit(request)\n", |
|
275 | 277 | "else:\n", |
276 | 278 | " print('Skipping test: imagenator L3 not configured for environment')" |
277 | 279 | ] |
| 280 | + }, |
| 281 | + { |
| 282 | + "cell_type": "markdown", |
| 283 | + "id": "4fc3076a", |
| 284 | + "metadata": {}, |
| 285 | + "source": [ |
| 286 | + "# Test: imagenator L3 request on MUR25 L4 analysed_sst variable\n", |
| 287 | + "\n", |
| 288 | + "Test rules for MUR/MUR25 collections in harmony-filtering-service + net2cog + hybig" |
| 289 | + ] |
| 290 | + }, |
| 291 | + { |
| 292 | + "cell_type": "code", |
| 293 | + "execution_count": null, |
| 294 | + "id": "630e396e", |
| 295 | + "metadata": {}, |
| 296 | + "outputs": [], |
| 297 | + "source": [ |
| 298 | + "imagenator_non_prod_information = {\n", |
| 299 | + " 'collection': Collection(id='C1238621140-POCLOUD'),\n", |
| 300 | + " 'granule_id': 'G1281443693-POCLOUD',\n", |
| 301 | + "}\n", |
| 302 | + "associated_output = '20260309090000-JPL-L4_GHRSST-SSTfnd-MUR25-GLOB-v02.0-fv04.2_filtered_analysed_sst_reformatted'\n", |
| 303 | + "\n", |
| 304 | + "imagenator_env = {\n", |
| 305 | + " Environment.LOCAL: imagenator_non_prod_information,\n", |
| 306 | + " Environment.SIT: imagenator_non_prod_information,\n", |
| 307 | + " Environment.UAT: imagenator_non_prod_information,\n", |
| 308 | + "}\n", |
| 309 | + "\n", |
| 310 | + "if harmony_environment in imagenator_env:\n", |
| 311 | + " imagenator_info = imagenator_env[harmony_environment]\n", |
| 312 | + "else:\n", |
| 313 | + " imagenator_info = None\n", |
| 314 | + "\n", |
| 315 | + "if imagenator_info is not None:\n", |
| 316 | + " request = Request(\n", |
| 317 | + " collection=imagenator_info['collection'],\n", |
| 318 | + " granule_id=[imagenator_info['granule_id']],\n", |
| 319 | + " variables=['analysed_sst'],\n", |
| 320 | + " labels=['imagenator-l3-mur25'],\n", |
| 321 | + " format='image/png',\n", |
| 322 | + " )\n", |
| 323 | + "\n", |
| 324 | + " job_id = harmony_client.submit(request)\n", |
| 325 | + " harmony_client.wait_for_processing(job_id)\n", |
| 326 | + "\n", |
| 327 | + " with TemporaryDirectory() as temp_dir:\n", |
| 328 | + " output_files = [\n", |
| 329 | + " Path(future.result())\n", |
| 330 | + " for future in harmony_client.download_all(job_id, directory=temp_dir)\n", |
| 331 | + " ]\n", |
| 332 | + "\n", |
| 333 | + " # MUR filename contains '.' character so the suffixes trick from above has to be modified\n", |
| 334 | + " assert len(output_files) == 3\n", |
| 335 | + " assert (\n", |
| 336 | + " output_files[0].suffixes[-1] == '.png'\n", |
| 337 | + " ), f'{output_files[0].suffixes[-1]} is not PNG'\n", |
| 338 | + " assert output_files[1].suffixes[-1] == '.pgw'\n", |
| 339 | + " assert output_files[2].suffixes[-1] == '.xml'\n", |
| 340 | + "\n", |
| 341 | + " reference_data = Path('reference_data')\n", |
| 342 | + " expected_png = reference_data / f'{associated_output}.png'\n", |
| 343 | + " expected_pgw = reference_data / f'{associated_output}.pgw'\n", |
| 344 | + " expected_aux = reference_data / f'{associated_output}.png.aux.xml'\n", |
| 345 | + "\n", |
| 346 | + " assert output_files[0].read_bytes() == expected_png.read_bytes()\n", |
| 347 | + " assert output_files[1].read_bytes() == expected_pgw.read_bytes()\n", |
| 348 | + " assert output_files[2].read_bytes() == expected_aux.read_bytes()\n", |
| 349 | + " print_success('imagenator L3 request on MUR25 analysed_sst')\n", |
| 350 | + "else:\n", |
| 351 | + " print('Skipping test: imagenator L3 not configured for environment')" |
| 352 | + ] |
278 | 353 | } |
279 | 354 | ], |
280 | 355 | "metadata": { |
|
0 commit comments