norbitAnalyzer 0.0.1__tar.gz

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.
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: norbitAnalyzer
3
+ Version: 0.0.1
4
+ Requires-Dist: pandas
5
+ Requires-Dist: numpy
6
+ Requires-Dist: agama
7
+ Requires-Dist: matplotlib
8
+ Requires-Dist: pyyaml
9
+ Requires-Dist: scienceplots
@@ -0,0 +1,2 @@
1
+ # Code_astro_project_rep
2
+ Making a "user friendly" orbit package, re-using and cleaning astr 399 code and make it avalaible to public
@@ -0,0 +1,57 @@
1
+ import numpy as np
2
+
3
+
4
+ def generate_hex_indices(start, stop, step):
5
+ """
6
+ Generate a list of hexadecimal frame indices.
7
+
8
+ Parameters
9
+ ----------
10
+ start : str
11
+ Starting hex index (e.g. "8000")
12
+ stop : str
13
+ Final hex index, inclusive (e.g. "10000")
14
+ step : str or int
15
+ Hex increment (e.g. "40" or 0x40)
16
+
17
+ Returns
18
+ -------
19
+ indices : list[str]
20
+ List of hex indices as lowercase strings without '0x'
21
+ """
22
+ # Convert inputs to integers
23
+ start_i = int(start, 16)
24
+ stop_i = int(stop, 16)
25
+ step_i = int(step, 16) if isinstance(step, str) else int(step)
26
+
27
+ if step_i <= 0:
28
+ raise ValueError("step must be positive")
29
+ if stop_i < start_i:
30
+ raise ValueError("stop must be >= start")
31
+
32
+ indices = []
33
+ i = start_i
34
+ while i <= stop_i:
35
+ indices.append(f"{i:x}") # hex string without 0x
36
+ i += step_i
37
+
38
+ return indices
39
+
40
+
41
+ # config
42
+ N_ROWS = 2 ** 20 # rows per file
43
+ VAL_RANGE = (-100, 100) # min, max for all 6 columns
44
+ PREFIX = "r10A" # filename prefix
45
+ OUT_DIR = "." # output directory
46
+
47
+ file_paths = []
48
+ indices = generate_hex_indices("7000", "8000", "40")
49
+
50
+ for idx in indices:
51
+ out_path = f"{OUT_DIR}/{PREFIX}_{idx}.txt" # r10A_<index>.txt convention
52
+ data = np.random.uniform(VAL_RANGE[0], VAL_RANGE[1], size=(N_ROWS, 6))
53
+ np.savetxt(out_path, data, fmt="%.6f", header="x y z vx vy vz", comments="")
54
+ file_paths.append(out_path)
55
+ print(f"wrote {N_ROWS} rows to {out_path}")
56
+
57
+ print(f"\ndone: {len(file_paths)} files written")
@@ -0,0 +1,24 @@
1
+ import os
2
+
3
+ __version__ = "0.0.1"
4
+
5
+ # Fixed: Changed os.path_dirname to os.path.dirname
6
+ norbit_dir = os.path.dirname(__file__)
7
+ DATADIR = os.path.join(norbit_dir, "norbit_data_ex/")
8
+
9
+ # Check for PyCUDA availability
10
+ try:
11
+ import pycuda.driver as cuda
12
+ import pycuda.autoinit
13
+ from pycuda.compiler import SourceModule
14
+ cuda_ext = True
15
+ except ImportError:
16
+ cuda_ext = False
17
+
18
+
19
+ try:
20
+ from . import _kepler
21
+ cext = True
22
+ except ImportError:
23
+ cext = False
24
+