{"id":22669872,"url":"https://github.com/astrobarker/snac","last_synced_at":"2025-03-29T11:15:34.395Z","repository":{"id":108616440,"uuid":"263666514","full_name":"AstroBarker/snac","owner":"AstroBarker","description":"Python tools for analyzing/plotting SNEC CCSN data","archived":false,"fork":false,"pushed_at":"2021-05-03T02:26:50.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T10:56:40.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AstroBarker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-13T15:16:33.000Z","updated_at":"2022-11-22T23:23:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec1f035b-55dd-40c8-8516-8950bc9901dc","html_url":"https://github.com/AstroBarker/snac","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroBarker%2Fsnac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroBarker%2Fsnac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroBarker%2Fsnac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstroBarker%2Fsnac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstroBarker","download_url":"https://codeload.github.com/AstroBarker/snac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174609,"owners_count":20735417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T15:41:51.774Z","updated_at":"2025-03-29T11:15:34.360Z","avatar_url":"https://github.com/AstroBarker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# snac\nPython tools for analyzing/plotting data from SuperNova Explosion Code ([SNEC](https://stellarcollapse.org/SNEC)). [1](http://adsabs.harvard.edu/abs/2015ApJ...814...63M)\n\n\n# Setup\n\nSet these shell environment variables:\n\n* `SNAC_DIR` - path to this directory, e.g. export FLASHBANG=${HOME}/path/to/snac\n* `SNEC_MODELS` - path to SNEC directory containing SNEC run directories. This can be tricky - \neach SNEC run gets its own directory (`DIR`) that houses the executable and within that is a data directory `Data`. We want to point to \nthe directory conaining `DIR`\n\nIn order to import with ipython etc., append to your python path: `export PYTHONPATH=${SNAC_DIR}:${PYTHONPATH}`\n\n# Getting Started\nThe Simulation class contains tools to mediate the loading/manipulation of data. Each class represents a single SNEC run.\n`snac` assumes that the output is organized as follow, from `$SNEC_MODELS`:\n```\n$SNEC_MODELS\n├── mass1\n│   ├── Data\n│       ├── C_init_frac.dat\n│       ├── E_shell.xg\n│       ├── H_1.xg\n│            ...\n├── mass2\n│   ├── Data\n│   │   ├── C_init_frac.dat\n│   │   ├── E_shell.xg\n│   │   ├── H_1.xg\n│   │   ├── H_2.xg\n│   │   ├── H_init_frac.dat\n│   │   ├── He_1.xg\n```\n\nYou can construct the Simulation object in using:\n```\nimport snac\n\ndata = snac.simulation.Simulation(model='mass1', \n                                      output_dir='Data')\n```\nWhere `model` is the name of the SNEC run directory, and `output` is the name of the output directory containing the data.\n\nNote: Loading mass profiles for a large number of SNEC runs is quite slow in the current implementation, particularly \nfor the first time, before pickle'd copies have been made.\n\n# Data Structures\n\nThe Simulation class contained four primary data structures: \n`Simulation.profiles`     : dict\n\n`Simulation.solo_profile` : DataFrame\n\n`Simulation.dat`          : DataFrame\n\n`Simulation.scalars`      : DataFrame\n\n`Simulation.profiles` contains the mass profiles loaded, as listed in `snec.ini`, for all output times. Organized by\n`self.profiles['field'][timestamp][:,i]` where `i=0` is the mass profiles and `i=1` contains the field. Timestamps \nare keys and may be generally accessed by `[*self.profiles['rho]]` or your favorite method for generating a list of keys.\nExample:\n```python\ntimes = [*self.profiles['rho']]\nmass = self.profiles['rho'][times[0]][:,0]\ndensity = self.profiles['rho'][times[0]][:,0]\n```\n\n`Simulation.solo_profile` is a DataFrame containing Lagrangian profiles at one time, constructed via \n`Simulation.get_profile_day(day=d)` where `day` is a time, in days, post shock breakout. Passing `-1` gives the \ninitial profile. `solo_profile.time` returns the time of the profile.\n\n`Simulation.dat` contains integrated quantities as a function of time that are written by SNEC to `.dat` files. \n\n`Simulation.scalars` contains a few scalar quantities such as time of shock breakout.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrobarker%2Fsnac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrobarker%2Fsnac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrobarker%2Fsnac/lists"}