pogucam 0.1.9__py3-none-any.whl → 0.1.12__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.
pogucam/buffers.py CHANGED
@@ -26,7 +26,7 @@ class FastAccumBuffer:
26
26
 
27
27
  def add(self, img: np.ndarray, info: dict):
28
28
  """
29
- inconsistent shape resets the buffer
29
+ inconsistent shapes reset the buffer
30
30
  """
31
31
  if img.dtype != np.uint8 or img.shape != self.shape:
32
32
  self.shape = img.shape
@@ -74,6 +74,19 @@ class FastAccumBuffer:
74
74
  self.previous_sum_frames = curr
75
75
  return curr# summed.astype(np.uint8)
76
76
 
77
+ def get_avg_frames(self):
78
+ """
79
+ untested averaged frame
80
+ """
81
+ if self.count == 0:
82
+ return None
83
+ avg = np.mean(self.cube[:self.count].astype(np.float32), axis=0)
84
+ avg = np.clip(avg, 0, 255).astype(np.uint8)
85
+ self.previous_sum_frames = avg
86
+ return avg
87
+
88
+
89
+
77
90
  def get_saturated_pixel_count(self):
78
91
  return self._saturated_pixel_count
79
92
 
@@ -8,7 +8,7 @@
8
8
  ############################# ]
9
9
  ############################# ///
10
10
  ############################
11
- """
11
+ a = """
12
12
  * I keep this on legacy .venv *** either --script install - or venv!
13
13
  * from astropy.io import fits *** some fits in threading done *** ... ds9.si.edu viewer DS9
14
14
  * NOT NOW **** Or store as hdf5 - files with metadata - and use HDFView ... one file
@@ -25,7 +25,7 @@ NEW - Fits saves nice, many CUBE , use like
25
25
  uv run --with=napari-crop --with=napari-tabu ./explore_view_napari.py ~/DATA/core6a_video0_20250604_113217.25.fits
26
26
  napari-tabu :((((
27
27
  DS9 ... ~/Downloads/DS9/ds9 core6a_video0_20250604_185439.68.fits just GRAY,
28
- wine /home/ojr/.wine/dosdevices/c:/Program\ Files\ \(x86\)/AvisFV30/AvisFV.exe core6a_video0_20250604_185439.68.fits
28
+ wine /home/ojr/.wine/dosdevices/c:/Program Files (x86)/AvisFV30/AvisFV.exe core6a_video0_20250604_185439.68.fits
29
29
  #------------
30
30
  NEW 1 2 3 4 and shift(save) are registers for rota,zoom,r_integrr,move,l_gamma (r_gain t?in future?)
31
31
  CROSS, FG BG....
@@ -504,6 +504,7 @@ class StreamWidget(QLabel):
504
504
  #self.accum_buffer = None #
505
505
  #self.accum_image = None #
506
506
  self.l_show_accum = False # THIS MUST BE KEPT
507
+ self.l_show_accum_avg = False
507
508
  # ---- np stak-------------------------------------
508
509
  #self.accum_buffer_size = 0 #
509
510
  #self.accum_count = 0 # actual number of img in buff
@@ -535,9 +536,15 @@ class StreamWidget(QLabel):
535
536
  #print(self.internet_not_device, self.internet_not_device)
536
537
  # -------------------------------------------------------------- ACCUM -----------------
537
538
  if self.internet_not_device:
539
+ # every internet call do here
538
540
  if ('accumtxt' in data) and int(data['accumtxt']) == 1: # skip Loop 1
539
541
  print("D... LOOP 1 skipped for remote send command - for some reason I send out 0 only,not 1")
540
542
  pass
543
+ elif ('accumtxt' in data): # NO ACCUM REMOTE !!!!!!!!!!! ??? test
544
+ val = int(data['accumtxt']) # SIZE OF THE BUFFER
545
+ if val == 0: val = 1 # trying to fix
546
+ if len(self.FABuffer) != val and val > 0:
547
+ self.FABuffer.set_max_frames(val)
541
548
  else:
542
549
  post_response = requests.post(url=self.post_addr, data=data )
543
550
  else:
@@ -1671,11 +1678,14 @@ class StreamWidget(QLabel):
1671
1678
  #if self.define_accum_buffer( self.accum_n ): # does nothing if already exists
1672
1679
  # self.add_to_accum_buffer( self.img) # No idea why fits has wrong colors
1673
1680
 
1674
- # showing or NOT the average image
1681
+ # showing or NOT the average image ************* SHO@WING *********** SHOWING **********
1675
1682
  if self.l_show_accum and (len(self.FABuffer) > 1):# and (len(self.accum_buffer) > 1):
1676
1683
  rimg = None
1677
1684
  if self.FABuffer.new_sum_available():
1678
- rimg = self.FABuffer.get_sum_frames()#_mean_accum_buffer()
1685
+ if self.l_show_accum_avg:
1686
+ rimg = self.FABuffer.get_avg_frames()#_mean_accum_buffer()
1687
+ else:
1688
+ rimg = self.FABuffer.get_sum_frames()#_mean_accum_buffer()
1679
1689
  #print("\n new", type(rimg))
1680
1690
  print(f"SATURATED: {self.FABuffer.get_saturated_pixel_count()}", end="")
1681
1691
  else:
@@ -2152,7 +2162,7 @@ class StreamWidget(QLabel):
2152
2162
  print( "i... reset position red cross")
2153
2163
  self.redcross = [0, 0]
2154
2164
  # ----------------------------------------------------------------- i integrate accumulate
2155
- if (key == Qt.Key.Key_I):
2165
+ if (key == Qt.Key.Key_I): # i shift-i Ctrl-i Ctrl-Shift-i Alt
2156
2166
  # 4.6GB / 1000 640x480
2157
2167
  if ( len(parts_set) == 0):
2158
2168
  if self.r_integrate < 8:
@@ -2184,6 +2194,9 @@ class StreamWidget(QLabel):
2184
2194
  elif (parts_set == {'Ctrl', 'Shift'}) :
2185
2195
  self.l_show_accum = not self.l_show_accum
2186
2196
  print(f"i... ACCUMULATION IS {self.l_show_accum}")
2197
+ elif (parts_set == {'Alt'}) :
2198
+ self.l_show_accum_avg = not self.l_show_accum_avg
2199
+ print(f"i... ACCUMULATION AVG/nonSUM IS {self.l_show_accum_avg}")
2187
2200
 
2188
2201
  # ----------------------------------------------------------------- b
2189
2202
  if (key == Qt.Key.Key_B):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pogucam
3
- Version: 0.1.9
3
+ Version: 0.1.12
4
4
  Summary: Add your description here
5
5
  Author-email: jaromrax <jaromrax@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -0,0 +1,9 @@
1
+ pogucam/__init__.py,sha256=Iij7VvXCrFPMtTia41mQ7LxFLaulf_fD5cb-AyjpUo0,53
2
+ pogucam/buffers.py,sha256=1JLkuenkHoA-K-uZAlNV7chHQDZLrspgT5_XOY-E-34,6692
3
+ pogucam/explore_u24_uni.py,sha256=JY_fid_w-Trycs0plLUjv_UNLTjQW66wk4OP-nNiaTs,112075
4
+ pogucam/installation.md,sha256=8qspiLlYjEBx5CedRfBU7Mm0A2pz0lfAnaupZyBm5Eo,128
5
+ pogucam/text_write.py,sha256=hyRyA1M5z-pda963T-k0i8fvvAlv1p3YBTZtYNdOeoE,19304
6
+ pogucam-0.1.12.dist-info/METADATA,sha256=K9zizgKKO_Ur-I4-whqe6rFG8gaBI3xVCQuYYRgl6WA,467
7
+ pogucam-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ pogucam-0.1.12.dist-info/entry_points.txt,sha256=-97N0LsXIR8h0rJMzIMuNeNwuY8LvPYPTqnXsuAnVsM,63
9
+ pogucam-0.1.12.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- pogucam/__init__.py,sha256=Iij7VvXCrFPMtTia41mQ7LxFLaulf_fD5cb-AyjpUo0,53
2
- pogucam/buffers.py,sha256=9nW9W8z3wjaLcfFrZqmsnsowxQOWXTweOuHVjwWWIn8,6368
3
- pogucam/explore_u24_uni.py,sha256=e2qpEagex5vqauXhPyaKOvxQelUjNyGnBJypoZmlZTk,111220
4
- pogucam/installation.md,sha256=8qspiLlYjEBx5CedRfBU7Mm0A2pz0lfAnaupZyBm5Eo,128
5
- pogucam/text_write.py,sha256=hyRyA1M5z-pda963T-k0i8fvvAlv1p3YBTZtYNdOeoE,19304
6
- pogucam-0.1.9.dist-info/METADATA,sha256=frJgje8YmVhg6yTv6Vh_SjoSy-k66L9ixETyFAY-xNs,466
7
- pogucam-0.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- pogucam-0.1.9.dist-info/entry_points.txt,sha256=-97N0LsXIR8h0rJMzIMuNeNwuY8LvPYPTqnXsuAnVsM,63
9
- pogucam-0.1.9.dist-info/RECORD,,