pyampp 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. docs/Makefile +20 -0
  2. docs/changelog.rst +4 -0
  3. docs/conf.py +118 -0
  4. docs/conf.py.rej +25 -0
  5. docs/gui_workflow.rst +108 -0
  6. docs/images/MagFieldViewer_gui.png +0 -0
  7. docs/images/gxbox_gui.png +0 -0
  8. docs/images/pyampp_gui.png +0 -0
  9. docs/index.rst +20 -0
  10. docs/make.bat +35 -0
  11. docs/model_hdf5_format.rst +139 -0
  12. docs/requirements.txt +4 -0
  13. docs/viewers.rst +58 -0
  14. examples/create_box.py +20 -0
  15. licenses/LICENSE.rst +25 -0
  16. licenses/README.rst +9 -0
  17. licenses/TEMPLATE_LICENSE.rst +31 -0
  18. pyampp/__init__.py +3 -0
  19. pyampp/_dev/__init__.py +6 -0
  20. pyampp/_dev/scm_version.py +12 -0
  21. pyampp/_version.py +3 -0
  22. pyampp/data/README.rst +6 -0
  23. pyampp/data/__init__.py +1 -0
  24. pyampp/data/downloader.py +246 -0
  25. pyampp/gx_chromo/combo_model.py +113 -0
  26. pyampp/gx_chromo/decompose.py +113 -0
  27. pyampp/gx_chromo/gx_voxelid.py +5 -0
  28. pyampp/gx_chromo/populate_chromo.py +21 -0
  29. pyampp/gx_chromo/sav_precomputed/__init__.py +0 -0
  30. pyampp/gx_chromo/sav_precomputed/eduard_v3.sav +0 -0
  31. pyampp/gx_chromo/sav_precomputed/fontenla_b_v3.sav +0 -0
  32. pyampp/gx_chromo/sav_precomputed/fontenla_d_v3.sav +0 -0
  33. pyampp/gx_chromo/sav_precomputed/fontenla_f_v3.sav +0 -0
  34. pyampp/gx_chromo/sav_precomputed/fontenla_h_v3.sav +0 -0
  35. pyampp/gx_chromo/sav_precomputed/fontenla_p_v3.sav +0 -0
  36. pyampp/gx_chromo/sav_precomputed/fontenla_q_v3.sav +0 -0
  37. pyampp/gx_chromo/sav_precomputed/fontenla_r_v3.sav +0 -0
  38. pyampp/gx_chromo/sav_precomputed/fontenla_s_v3.sav +0 -0
  39. pyampp/gxbox/UI/__init__.py +0 -0
  40. pyampp/gxbox/UI/clear.svg +1 -0
  41. pyampp/gxbox/UI/eye_item.png +0 -0
  42. pyampp/gxbox/UI/gxampp.ui +581 -0
  43. pyampp/gxbox/UI/gxbox.ui +302 -0
  44. pyampp/gxbox/UI/play.svg +1 -0
  45. pyampp/gxbox/UI/refresh.svg +1 -0
  46. pyampp/gxbox/UI/save.svg +1 -0
  47. pyampp/gxbox/__init__.py +5 -0
  48. pyampp/gxbox/box.py +170 -0
  49. pyampp/gxbox/boxutils.py +497 -0
  50. pyampp/gxbox/coordinates-los-demo.ipynb +589 -0
  51. pyampp/gxbox/gx_box2id.py +183 -0
  52. pyampp/gxbox/gx_fov2box.py +895 -0
  53. pyampp/gxbox/gx_voxelid.py +67 -0
  54. pyampp/gxbox/gxampp.py +1248 -0
  55. pyampp/gxbox/gxbox_factory.py +1705 -0
  56. pyampp/gxbox/gxrefmap_view.py +313 -0
  57. pyampp/gxbox/magfield_viewer.py +1510 -0
  58. pyampp/gxbox/view_h5.py +158 -0
  59. pyampp/sfq/README.md +16 -0
  60. pyampp/sfq/__init__.py +28 -0
  61. pyampp/sfq/clean.py +118 -0
  62. pyampp/sfq/frame.py +50 -0
  63. pyampp/sfq/potential.py +303 -0
  64. pyampp/sfq/step.py +77 -0
  65. pyampp/sfq/utils.py +61 -0
  66. pyampp/tests/__init__.py +4 -0
  67. pyampp/tests/build_h5_from_sav.py +131 -0
  68. pyampp/tests/compare_base_maps.py +183 -0
  69. pyampp/tests/compare_idl_hdf5.py +210 -0
  70. pyampp/tests/idl_hdf5_mapping.md +66 -0
  71. pyampp/tests/idl_parity_notes.md +97 -0
  72. pyampp/tests/idl_stage_report.py +118 -0
  73. pyampp/tests/run_amp_stages_cli.py +311 -0
  74. pyampp/tests/test_MagFieldWrapper.py +130 -0
  75. pyampp/tests/test_compare_b3d.py +41 -0
  76. pyampp/tests/test_compare_base_maps.py +30 -0
  77. pyampp/tests/test_magfield_viewer.py +26 -0
  78. pyampp/util/MagFieldWrapper.py +280 -0
  79. pyampp/util/__init__.py +2 -0
  80. pyampp/util/compute.py +223 -0
  81. pyampp/util/config.py +50 -0
  82. pyampp/util/h5tree.py +101 -0
  83. pyampp/util/idl_execute_to_gxfov2box.py +425 -0
  84. pyampp/util/radio.py +367 -0
  85. pyampp/version.py +7 -0
  86. pyampp-1.0.0.dist-info/LICENSE +21 -0
  87. pyampp-1.0.0.dist-info/METADATA +256 -0
  88. pyampp-1.0.0.dist-info/RECORD +92 -0
  89. pyampp-1.0.0.dist-info/WHEEL +5 -0
  90. pyampp-1.0.0.dist-info/entry_points.txt +9 -0
  91. pyampp-1.0.0.dist-info/top_level.txt +7 -0
  92. reports/parity_review/PR_0_2_0_CHECKLIST.md +41 -0
docs/Makefile ADDED
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
docs/changelog.rst ADDED
@@ -0,0 +1,4 @@
1
+ Changelog
2
+ =========
3
+
4
+ .. include:: ../CHANGELOG.rst
docs/conf.py ADDED
@@ -0,0 +1,118 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # This file does only contain a selection of the most common options. For a
4
+ # full list see the documentation:
5
+ # http://www.sphinx-doc.org/en/master/config
6
+
7
+
8
+ # -- Project information -----------------------------------------------------
9
+
10
+ # The full version, including alpha/beta/rc tags
11
+ release = "0.2.0"
12
+
13
+ project = "pyAMPP"
14
+ copyright = "2022, suncast-org"
15
+ author = "suncast-org"
16
+
17
+ # -- General configuration ---------------------------------------------------
18
+
19
+ # Add any Sphinx extension module names here, as strings. They can be
20
+ # extensions coming with Sphinx (named "sphinx.ext.*") or your custom
21
+ # ones.
22
+ extensions = [
23
+ 'sphinx.ext.autodoc', # Automatically document your code
24
+ 'sphinx.ext.napoleon', # Support for Google-style docstrings
25
+ 'sphinx.ext.viewcode', # Add links to source code from documentation
26
+ 'sphinx.ext.mathjax', # Render math via JavaScript
27
+ 'sphinx.ext.autosummary', # Automatically generates summary tables from the docstrings.
28
+ 'sphinx.ext.githubpages',
29
+ 'sphinx.ext.graphviz',
30
+ 'sphinx.ext.imgmath',
31
+ # 'sphinx_gallery.gen_gallery',
32
+ # 'sphinx_gallery',
33
+ 'autoapi.extension'
34
+ # Add any other Sphinx extensions here.
35
+ ]
36
+
37
+ # Add any paths that contain templates here, relative to this directory.
38
+ # templates_path = ["_templates"] # NOQA: ERA001
39
+
40
+ # List of patterns, relative to source directory, that match files and
41
+ # directories to ignore when looking for source files.
42
+ # This pattern also affects html_static_path and html_extra_path.
43
+ templates_path = ['_templates']
44
+ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
45
+
46
+ html_theme = 'sphinx_rtd_theme'
47
+
48
+ html_static_path = ['_static']
49
+
50
+ # The suffix(es) of source filenames.
51
+ # # You can specify multiple suffix as a list of string:
52
+ # source_suffix = ".rst"
53
+ #
54
+ # # The master toctree document.
55
+ # master_doc = "index"
56
+
57
+ # -- Options for intersphinx extension ---------------------------------------
58
+
59
+ # Example configuration for intersphinx: refer to the Python standard library.
60
+ # intersphinx_mapping = {"python": ("https://docs.python.org/", None)}
61
+
62
+ # -- Options for HTML output -------------------------------------------------
63
+
64
+ # The theme to use for HTML and HTML Help pages. See the documentation for
65
+ # a list of builtin themes.
66
+ # html_theme = "alabaster"
67
+
68
+
69
+ # Custom sidebar templates, must be a dictionary that maps document names
70
+ # to template names.
71
+ #
72
+ # The default sidebars (for documents that don't match any pattern) are
73
+ # defined by theme itself. Builtin themes are using a default sidebar with
74
+ # the links to the documentation's roots, contents & search, plus a link to
75
+ # the Python.org website.
76
+ html_sidebars = {
77
+ '**': [
78
+ 'about.html',
79
+ 'navigation.html',
80
+ 'relations.html', # needs 'show_related': True theme option to display
81
+ 'searchbox.html',
82
+ 'donate.html',
83
+ ]
84
+ }
85
+
86
+ # -- Options for sphinx.ext.autodoc -------------------------------------------
87
+ autoapi_type = 'python'
88
+ autoapi_dirs = ['../pyampp']
89
+ autoapi_python_use_implicit_namespaces = True
90
+ autoapi_options = [
91
+ 'members',
92
+ 'undoc-members',
93
+ 'show-inheritance',
94
+ 'show-module-summary',
95
+ ]
96
+ autoapi_ignore = [
97
+ # Ignore test and internal helper trees.
98
+ 'tests/*',
99
+ '*/tests/*',
100
+ '_dev/*',
101
+ '*/_dev/*',
102
+ 'lib/*',
103
+ '*/lib/*',
104
+ # Some modules with heavy relative-import assumptions can fail under
105
+ # AutoAPI static analysis; exclude from API doc generation.
106
+ 'gx_chromo/combo_model.py',
107
+ '*/gx_chromo/combo_model.py',
108
+ # Avoid duplicate object descriptions with pyampp.gxbox package exports.
109
+ 'gxbox/gx_box2id.py',
110
+ '*/gxbox/gx_box2id.py',
111
+ 'gxbox/gx_voxelid.py',
112
+ '*/gxbox/gx_voxelid.py',
113
+ ]
114
+
115
+ # Keep the docs build signal-to-noise focused on actionable errors.
116
+ suppress_warnings = [
117
+ 'autoapi.python_import_resolution',
118
+ ]
docs/conf.py.rej ADDED
@@ -0,0 +1,25 @@
1
+ diff a/docs/conf.py b/docs/conf.py (rejected hunks)
2
+ @@ -76,10 +76,22 @@ intersphinx_mapping = {"python": ("https://docs.python.org/", None)}
3
+ # a list of builtin themes.
4
+ html_theme = "alabaster"
5
+
6
+ +# Render inheritance diagrams in SVG
7
+ +graphviz_output_format = "svg"
8
+ +
9
+ +graphviz_dot_args = [
10
+ + "-Nfontsize=10",
11
+ + "-Nfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
12
+ + "-Efontsize=10",
13
+ + "-Efontname=Helvetica Neue, Helvetica, Arial, sans-serif",
14
+ + "-Gfontsize=10",
15
+ + "-Gfontname=Helvetica Neue, Helvetica, Arial, sans-serif",
16
+ +]
17
+ +
18
+ # Add any paths that contain custom static files (such as style sheets) here,
19
+ # relative to this directory. They are copied after the builtin static files,
20
+ # so a file named "default.css" will overwrite the builtin "default.css".
21
+ -# html_static_path = ["_static"]
22
+ +# html_static_path = ["_static"] # NOQA: ERA001
23
+
24
+ # By default, when rendering docstrings for classes, sphinx.ext.autodoc will
25
+ # make docs with the class-level docstring and the class-method docstrings,
docs/gui_workflow.rst ADDED
@@ -0,0 +1,108 @@
1
+ pyAMPP GUI Workflow
2
+ ===================
3
+
4
+ This page documents the current ``pyampp`` command-builder GUI behavior and how it maps to ``gx-fov2box``.
5
+
6
+ Purpose
7
+ -------
8
+
9
+ The GUI is a thin command constructor for reproducible CLI runs. It:
10
+
11
+ - captures model parameters,
12
+ - resolves entry-box resume/rebuild behavior,
13
+ - displays the exact command before execution,
14
+ - streams command output in the status panel.
15
+
16
+ Data Repositories
17
+ -----------------
18
+
19
+ The GUI has three path fields:
20
+
21
+ - ``SDO Data Dir`` (mapped to ``--data-dir``)
22
+ - ``GX Models Dir`` (mapped to ``--gxmodel-dir``)
23
+ - ``Entry Box`` (mapped to ``--entry-box`` when set)
24
+
25
+ Current behavior:
26
+
27
+ - ``data-dir`` and ``gxmodel-dir`` persist across sessions via ``QSettings``.
28
+ - If an entry box contains a valid ``metadata/execute`` path and that path exists on the current machine, the GUI pre-fills the corresponding directory field.
29
+ - If execute paths are invalid on this machine, the GUI falls back to default local directories and warns the user.
30
+
31
+ Model Configuration
32
+ -------------------
33
+
34
+ Core inputs:
35
+
36
+ - observation time (UTC)
37
+ - center coordinates with one selected frame:
38
+ - ``--hpc`` (helioprojective)
39
+ - ``--hgc`` (Carrington)
40
+ - ``--hgs`` (Stonyhurst)
41
+ - projection:
42
+ - ``--cea`` (default)
43
+ - ``--top``
44
+ - box dimensions:
45
+ - ``--box-dims NX NY NZ``
46
+ - spatial scale:
47
+ - ``--dx-km``
48
+ - padding:
49
+ - ``--pad-frac`` (GUI percent value is converted to fraction)
50
+ - disambiguation:
51
+ - ``HMI`` (default, no extra flag)
52
+ - ``SFQ`` (adds ``--sfq`` when applicable)
53
+
54
+ Entry-Box Modes
55
+ ---------------
56
+
57
+ When ``Entry Box`` is provided, the GUI detects the stage/type and offers three execution modes:
58
+
59
+ - ``Continue``:
60
+ - continue from detected entry stage,
61
+ - command is kept minimal (entry + paths + workflow flags).
62
+ - ``Rebuild from NONE``:
63
+ - keep entry as source metadata/context but restart stage computation from NONE (``--rebuild-from-none``).
64
+ - ``Rebuild from OBS``:
65
+ - recompute from observed maps and current GUI model parameters (``--rebuild``).
66
+
67
+ Pipeline Options and Stage Stops
68
+ --------------------------------
69
+
70
+ Save toggles:
71
+
72
+ - ``--save-empty-box``
73
+ - ``--save-potential``
74
+ - ``--save-bounds``
75
+ - ``--save-nas``
76
+ - ``--save-gen``
77
+
78
+ Stop rules:
79
+
80
+ - ``Stop after download`` -> ``--stop-after dl``
81
+ - ``NONE only`` -> ``--stop-after none``
82
+ - ``POT only`` -> ``--stop-after pot``
83
+ - ``NAS only`` -> ``--stop-after nas``
84
+ - ``GEN only`` (or CHR disabled) -> ``--stop-after gen``
85
+
86
+ Other stage controls:
87
+
88
+ - ``Skip NLFFF`` -> ``--use-potential``
89
+ - ``Skip line computation`` -> ``--skip-lines``
90
+
91
+ Context-map toggles:
92
+
93
+ - EUV checkbox -> ``--euv``
94
+ - UV checkbox -> ``--uv``
95
+
96
+ Command Display and Execution
97
+ -----------------------------
98
+
99
+ - The command preview updates live as inputs change.
100
+ - ``Run`` launches ``gx-fov2box`` as a subprocess.
101
+ - stdout/stderr are streamed into the status pane.
102
+ - A successful run reports generated model paths and stage timings in the log.
103
+
104
+ Operational Notes
105
+ -----------------
106
+
107
+ - If you modify package code, reinstall with ``pip install -e .`` before re-launching the GUI.
108
+ - Cached file reuse depends on ``--data-dir`` and timestamp/series compatibility with downloader filename matching.
Binary file
Binary file
Binary file
docs/index.rst ADDED
@@ -0,0 +1,20 @@
1
+ pyAMPP Documentation
2
+ --------------------
3
+
4
+ This is the documentation for pyAMPP.
5
+
6
+ .. toctree::
7
+ :maxdepth: 2
8
+ :caption: Contents:
9
+
10
+ model_hdf5_format
11
+ gui_workflow
12
+ viewers
13
+ changelog
14
+
15
+ Indices and tables
16
+ ==================
17
+
18
+ * :ref:`genindex`
19
+ * :ref:`modindex`
20
+ * :ref:`search`
docs/make.bat ADDED
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=.
11
+ set BUILDDIR=_build
12
+
13
+ if "%1" == "" goto help
14
+
15
+ %SPHINXBUILD% >NUL 2>NUL
16
+ if errorlevel 9009 (
17
+ echo.
18
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19
+ echo.installed, then set the SPHINXBUILD environment variable to point
20
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
21
+ echo.may add the Sphinx directory to PATH.
22
+ echo.
23
+ echo.If you don't have Sphinx installed, grab it from
24
+ echo.http://sphinx-doc.org/
25
+ exit /b 1
26
+ )
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,139 @@
1
+ pyAMPP HDF5 Model Format
2
+ ========================
3
+
4
+ This page documents the current stage-file contract written by ``gx-fov2box`` and consumed by:
5
+
6
+ - ``gxbox-view`` (3D viewer),
7
+ - ``gxrefmap-view`` (base/refmap browser),
8
+ - resume/rebuild workflows via ``--entry-box``.
9
+
10
+ File Naming
11
+ -----------
12
+
13
+ Typical output naming pattern:
14
+
15
+ - ``hmi.M_720s.YYYYMMDD_HHMMSS.<region>.CEA.NONE.h5``
16
+ - same stem with stage suffixes ``POT``, ``BND``, ``NAS``, ``NAS.GEN``, ``NAS.CHR``
17
+
18
+ Common Groups (All Stages)
19
+ --------------------------
20
+
21
+ ``base``
22
+ ~~~~~~~~
23
+
24
+ 2D boundary maps:
25
+
26
+ - ``base/bx``, ``base/by``, ``base/bz``
27
+ - ``base/ic``
28
+ - ``base/chromo_mask``
29
+ - ``base/index`` (IDL-compatible serialized header payload)
30
+
31
+ ``metadata``
32
+ ~~~~~~~~~~~~
33
+
34
+ Core provenance:
35
+
36
+ - ``metadata/id``: model identifier
37
+ - ``metadata/execute``: full command string used to create the model
38
+ - ``metadata/projection``: ``CEA`` or ``TOP``
39
+ - ``metadata/disambiguation``: e.g. ``HMI`` or ``SFQ``
40
+ - ``metadata/axis_order_2d`` and ``metadata/axis_order_3d`` when present
41
+ - ``metadata/vector_layout`` when present
42
+
43
+ ``refmaps``
44
+ ~~~~~~~~~~~
45
+
46
+ Optional context maps, each in its own subgroup:
47
+
48
+ - ``refmaps/<map_id>/data``
49
+ - ``refmaps/<map_id>/wcs_header``
50
+
51
+ ``grid``
52
+ ~~~~~~~~
53
+
54
+ Grid geometry and identity:
55
+
56
+ - ``grid/dx``, ``grid/dy``, ``grid/dz``
57
+ - ``grid/voxel_id`` (uint32)
58
+
59
+ Stage-Specific Groups
60
+ ---------------------
61
+
62
+ NONE
63
+ ~~~~
64
+
65
+ - Minimal model shell for downstream continuation.
66
+ - No solved extrapolation required.
67
+ - ``corona`` may exist as placeholder fields with ``attrs/model_type = "none"``.
68
+
69
+ POT
70
+ ~~~
71
+
72
+ Potential-field stage in ``corona``:
73
+
74
+ - ``corona/bx``, ``corona/by``, ``corona/bz``
75
+ - ``corona/dr``
76
+ - ``corona/attrs/model_type = "pot"``
77
+ - ``corona/corona_base`` when available
78
+
79
+ BND
80
+ ~~~
81
+
82
+ Boundary-conditioned stage in ``corona``:
83
+
84
+ - ``corona/bx``, ``corona/by``, ``corona/bz``
85
+ - ``corona/dr``
86
+ - ``corona/corona_base`` when available
87
+
88
+ NAS
89
+ ~~~
90
+
91
+ NLFFF stage in ``corona``:
92
+
93
+ - ``corona/bx``, ``corona/by``, ``corona/bz``
94
+ - ``corona/dr``
95
+ - ``corona/attrs/model_type = "nlfff"`` (or equivalent)
96
+
97
+ NAS.GEN
98
+ ~~~~~~~
99
+
100
+ Adds line-tracing products (stored in ``lines`` and/or stage-compatible chromo metadata):
101
+
102
+ - line indexing arrays (start/end/apex/seed)
103
+ - status/code arrays
104
+ - aggregate line properties (average field, physical length)
105
+
106
+ NAS.CHR
107
+ ~~~~~~~
108
+
109
+ Adds chromospheric payload in ``chromo`` and finalized grid metadata:
110
+
111
+ - chromospheric thermodynamic variables (where generated)
112
+ - chromosphere-resolved field cubes (when present)
113
+ - final ``grid/voxel_id`` and geometry values used by viewers/renderers
114
+
115
+ Reference-map IDs
116
+ -----------------
117
+
118
+ Typical AIA-derived IDs used by viewers:
119
+
120
+ - ``AIA_94``, ``AIA_131``, ``AIA_171``, ``AIA_193``, ``AIA_211``, ``AIA_304``, ``AIA_335``
121
+ - ``AIA_1600``, ``AIA_1700`` (if UV requested)
122
+
123
+ Axis and Layout Notes
124
+ ---------------------
125
+
126
+ - 2D base/refmap arrays are map-shaped with explicit WCS headers retained.
127
+ - 3D field arrays are stored in the package-native HDF5 convention used by current writers/readers.
128
+ - Viewers and adapters handle any required transpose/reindex for rendering and legacy compatibility.
129
+
130
+ Resume/Entry Compatibility
131
+ --------------------------
132
+
133
+ For robust resume behavior, entry files should include:
134
+
135
+ - ``metadata/execute`` (for reproducible command provenance and path recovery),
136
+ - valid ``metadata/id`` stage naming,
137
+ - required stage groups for the selected jump/rebuild mode.
138
+
139
+ When ``--entry-box`` is supplied, ``gx-fov2box`` detects stage availability and enforces required groups for continuation/rebuild paths.
docs/requirements.txt ADDED
@@ -0,0 +1,4 @@
1
+ Sphinx
2
+ sphinx-rtd-theme
3
+ sphinx-gallery
4
+ sphinx-autoapi
docs/viewers.rst ADDED
@@ -0,0 +1,58 @@
1
+ Model Viewers
2
+ =============
3
+
4
+ gxbox-view
5
+ ----------
6
+
7
+ ``gxbox-view`` opens an existing model HDF5 file in the 3D viewer without recomputing.
8
+
9
+ Expected inputs:
10
+
11
+ - A model file containing at least one of:
12
+ - ``corona`` (preferred),
13
+ - ``nlfff`` / ``pot`` (accepted and normalized), or
14
+ - ``chromo`` with sufficient magnetic cube fields.
15
+
16
+ Usage:
17
+
18
+ .. code-block:: bash
19
+
20
+ gxbox-view /path/to/model.h5
21
+
22
+ Optional file picker mode:
23
+
24
+ .. code-block:: bash
25
+
26
+ gxbox-view --pick
27
+
28
+ gxrefmap-view
29
+ -------------
30
+
31
+ ``gxrefmap-view`` is a 2D map browser for base maps and refmaps stored in model HDF5 files.
32
+
33
+ Expected layout:
34
+
35
+ - Base maps:
36
+ - ``base/bx``, ``base/by``, ``base/bz``, ``base/ic``, ``base/chromo_mask``
37
+ - base header in ``base/index`` (fallbacks: ``base/index_header``, ``base/wcs_header``)
38
+ - Refmaps:
39
+ - ``refmaps/<map_id>/data``
40
+ - ``refmaps/<map_id>/wcs_header``
41
+
42
+ Usage:
43
+
44
+ .. code-block:: bash
45
+
46
+ gxrefmap-view /path/to/model.h5
47
+
48
+ List available maps only:
49
+
50
+ .. code-block:: bash
51
+
52
+ gxrefmap-view /path/to/model.h5 --list
53
+
54
+ Start from a specific map:
55
+
56
+ .. code-block:: bash
57
+
58
+ gxrefmap-view /path/to/model.h5 --start AIA_94
examples/create_box.py ADDED
@@ -0,0 +1,20 @@
1
+ import astropy.time
2
+ import sunpy.sun.constants
3
+ from astropy.coordinates import SkyCoord
4
+ from sunpy.coordinates import Heliocentric, Helioprojective,get_earth
5
+ import astropy.units as u
6
+
7
+ from PyQt5.QtWidgets import QApplication
8
+ app = QApplication([])
9
+ from pyampp.gxbox.gxbox_factory import GxBox
10
+
11
+ time = astropy.time.Time('2020-12-01T20:00:00')
12
+ observer = get_earth(time)
13
+ box_origin = SkyCoord(450 * u.arcsec, -320 * u.arcsec, obstime=time, observer=observer, rsun=696 * u.Mm, frame='helioprojective')
14
+ box_dimensions = u.Quantity([400, 300, 300]) * u.pix
15
+ box_res = 1.4 * u.Mm
16
+
17
+
18
+ gxbox = GxBox(time, observer, box_origin, box_dimensions)
19
+ gxbox.show()
20
+ app.exec_()
licenses/LICENSE.rst ADDED
@@ -0,0 +1,25 @@
1
+ Copyright (c) 2024, suncast-org
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright notice, this
10
+ list of conditions and the following disclaimer in the documentation and/or
11
+ other materials provided with the distribution.
12
+ * Neither the name of the Astropy Team nor the names of its contributors may be
13
+ used to endorse or promote products derived from this software without
14
+ specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
20
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
licenses/README.rst ADDED
@@ -0,0 +1,9 @@
1
+ Licenses
2
+ ========
3
+
4
+ This directory holds license and credit information for the package,
5
+ works the package is derived from, and/or datasets.
6
+
7
+ Ensure that you pick a package licence which is in this folder and it matches
8
+ the one mentioned in the top level README.rst file. If you are using the
9
+ pre-rendered version of this template check for the word 'Other' in the README.
@@ -0,0 +1,31 @@
1
+ This project is based upon the OpenAstronomy package template
2
+ (https://github.com/OpenAstronomy/package-template/) which is licensed under the terms
3
+ of the following licence.
4
+
5
+ ---
6
+
7
+ Copyright (c) 2018, OpenAstronomy Developers
8
+ All rights reserved.
9
+
10
+ Redistribution and use in source and binary forms, with or without modification,
11
+ are permitted provided that the following conditions are met:
12
+
13
+ * Redistributions of source code must retain the above copyright notice, this
14
+ list of conditions and the following disclaimer.
15
+ * Redistributions in binary form must reproduce the above copyright notice, this
16
+ list of conditions and the following disclaimer in the documentation and/or
17
+ other materials provided with the distribution.
18
+ * Neither the name of the Astropy Team nor the names of its contributors may be
19
+ used to endorse or promote products derived from this software without
20
+ specific prior written permission.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pyampp/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ from . import sfq
2
+
3
+ __all__ = ["sfq"]
@@ -0,0 +1,6 @@
1
+ """
2
+ This package contains utilities that are only used when developing in a
3
+ copy of the source repository.
4
+ These files are not installed, and should not be assumed to exist at
5
+ runtime.
6
+ """
@@ -0,0 +1,12 @@
1
+ # Try to use setuptools_scm to get the current version; this is only used
2
+ # in development installations from the git repository.
3
+ import os.path
4
+
5
+ try:
6
+ from setuptools_scm import get_version
7
+
8
+ version = get_version(root=os.path.join('..', '..'), relative_to=__file__)
9
+ except ImportError:
10
+ raise
11
+ except Exception as e:
12
+ raise ValueError('setuptools_scm can not determine version.') from e
pyampp/_version.py ADDED
@@ -0,0 +1,3 @@
1
+ """Canonical package version."""
2
+
3
+ version = "0.2.0"
pyampp/data/README.rst ADDED
@@ -0,0 +1,6 @@
1
+ Data directory
2
+ ==============
3
+
4
+ This directory contains data files included with the package source
5
+ code distribution. Note that this is intended only for relatively small files
6
+ - large files should be externally hosted and downloaded as needed.
@@ -0,0 +1 @@
1
+ __all__=["downloader"]