Note
Go to the end to download the full example code
OMAS plot examplesΒΆ
This example loads some data from S3, augments the ODS with pressure information, and generates some plots
Traceback (most recent call last):
File "/home/bechtelt/omas/omas/examples/plot_omas.py", line 13, in <module>
ods = load_omas_s3('OMFITprofiles_sample', user='omas_shared')
File "/home/bechtelt/omas/omas/omas_s3.py", line 131, in load_omas_s3
remote_uri(_base_S3_uri(user) + filename, os.path.abspath(tmp_dir) + os.sep + os.sep + os.path.split(filename)[1], 'down')
File "/home/bechtelt/omas/omas/omas_s3.py", line 64, in remote_uri
obj.download_file(filename, Config=TransferConfig(use_threads=False))
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/boto3/s3/inject.py", line 365, in object_download_file
Config=Config,
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/boto3/s3/inject.py", line 195, in download_file
callback=Callback,
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/boto3/s3/transfer.py", line 326, in download_file
future.result()
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/s3transfer/futures.py", line 103, in result
return self._coordinator.result()
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/s3transfer/futures.py", line 266, in result
raise self._exception
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/s3transfer/tasks.py", line 269, in _main
self._submit(transfer_future=transfer_future, **kwargs)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/s3transfer/download.py", line 357, in _submit
**transfer_future.meta.call_args.extra_args,
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/client.py", line 535, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/client.py", line 964, in _make_api_call
operation_model, request_dict, request_context
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/client.py", line 986, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/endpoint.py", line 119, in make_request
return self._send_request(request_dict, operation_model)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/endpoint.py", line 198, in _send_request
request = self.create_request(request_dict, operation_model)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/endpoint.py", line 137, in create_request
operation_name=operation_model.name,
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/hooks.py", line 412, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/hooks.py", line 256, in emit
return self._emit(event_name, kwargs)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/hooks.py", line 239, in _emit
response = handler(**kwargs)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/signers.py", line 105, in handler
return self.sign(operation_name, request)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/signers.py", line 189, in sign
auth.add_auth(request)
File "/fusion/projects/codes/atom/omfit_v3.x/atom_iris_test/mambaforge/envs/3.2023.35.0/lib/python3.7/site-packages/botocore/auth.py", line 418, in add_auth
raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials
from matplotlib import pyplot
from omas import *
# load some data from S3
ods = load_omas_s3('OMFITprofiles_sample', user='omas_shared')
# augment ODS with pressure information
ods.physics_core_profiles_pressures()
# omas plot for pressures
ods.plot_core_profiles_pressures()
pyplot.show()
# omas plot for core profiles
ods.plot_core_profiles_summary()
pyplot.show()
# omas plot for equilibrium
omas_plot.equilibrium_summary(ods, linewidth=1, label='my equilibrium')
pyplot.show()
# omas plot for transport fluxes
ods = ODS().sample(5)
ods.plot_core_transport_fluxes()
pyplot.show()