Skip to main content

Analysis tools for Radyn in Python

Project description

This is a very early development release of RadynPy, a nascent suite of tools to allow analysis of Radyn simulations to be performed in Python.

If you don’t know what Radyn is, then this package is probably not aimed at you!

Currently the only class that is designed to be used is RadynData (and LazyRadynData), which can be used to load the .cdf files created by Radyn.

This module exposes the functions: index_convention, var_info, load_vars, and lazy_load_all.

  • Calling index_convention prints the indexing convention used in var_info.

  • var_info takes a str or list of str and prints the meaning of the associated variables, along with their dimensionality in the indexing convention used. var_info can also take ‘*’ as an argument, for which it will return the info on all variables.

  • load_vars takes the path to a CDF file and a list of the required variables which are then loaded into an instance of RadynData and can now be accesed as .varName rather than needing to go via the strings. If the filename is in the FCHROMA format then the heating parameters will be parsed from the string. If the filename is simply radyn_out.cdf then the filename isn’t scanned for parameters. If the filename is a different format then you may need to pass parseFilenameParams=False to load_vars. load_vars can also take ‘*’ as an argument, for which it will load all variables and timesteps into memory.

  • lazy_load_all loads all of the variables in the CDF in a lazy manner, meaning that they are only loaded into memory when called for the first time. This has the unfortunate side effect of needing to keep a handle to the CDF file open, so ideally the close() method should be called when you are done with the file, and not opening thousands (!) of CDF files simulataneously. For just a few files the call to close() isn’t too important as the class attempts to clean up after itself as much as possible. This mode is very good for easy exploration of CDF files as the requested variables do not need to be known a priori, making it easier to use in the REPL, without thehuge memory requirements of loading all of the variables from a file. lazy_load_all behaves in the same way as load_vars with respect to parsing the filename parameters, and also accepts the parseFilenameParams keyword.

I expect that lazy_load_all will become the prevailing mode of use, but in scripts where a large number of simulations (e.g. the grid) are being processed then load_vars will probably work out slightly more efficient.

This documentation will be fleshed out more in time, this is but a very early alpha release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radynpy-0.2.0.tar.gz (20.2 kB view details)

Uploaded Source

File details

Details for the file radynpy-0.2.0.tar.gz.

File metadata

  • Download URL: radynpy-0.2.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for radynpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7d2b77c13454914e64007297bb8be9bb1e38b9900ad0b5c12797a3d739ce6a34
MD5 6b365e73ec07442b683e61257b451bb0
BLAKE2b-256 77611e8e49c07398783a52ae5b23ca69b782cbd8d2f852521ad9c7db7e8826bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page