cubevis 0.5.12__py3-none-any.whl → 0.5.14__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.
cubevis/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.5.12'
1
+ __version__ = '0.5.14'
@@ -1,6 +1,6 @@
1
1
  ########################################################################
2
2
  #
3
- # Copyright (C) 2024
3
+ # Copyright (C) 2025
4
4
  # Associated Universities, Inc. Washington DC, USA.
5
5
  #
6
6
  # This script is free software; you can redistribute it and/or modify it
@@ -25,116 +25,6 @@
25
25
  # Charlottesville, VA 22903-2475 USA
26
26
  #
27
27
  ########################################################################
28
- '''casatasks provides on-the-fly creation of inp/go wrappers for tasks
29
- https://bayesianbrad.github.io/posts/2017_loader-finder-python.html
30
- '''
28
+ '''casatask equivalent bindings'''
31
29
 
32
- from importlib.abc import Loader as _Loader, MetaPathFinder as _MetaPathFinder
33
-
34
- import subprocess
35
- import re
36
- import os
37
- import sys
38
-
39
- class CasaTasks_Loader(_Loader):
40
-
41
- def __init__( self, java, jarpath, args, templ, xml ):
42
- self.__java = java
43
- self.__jarpath = jarpath
44
- self.__args = args
45
- self.__templ = templ
46
- self.__xml = xml
47
-
48
- def create_module(self, spec):
49
- return None
50
-
51
- def exec_module(self, module):
52
- python_source = subprocess.run( [ self.__java, '-jar', self.__jarpath ] + self.__args + [self.__templ, self.__xml], stdout=subprocess.PIPE ).stdout.decode('utf-8')
53
- exec( python_source, module.__dict__ )
54
-
55
-
56
- class CasaTasks_Finder(_MetaPathFinder):
57
-
58
- def __init__( self ):
59
- super(CasaTasks_Finder, self).__init__( )
60
- self.__java = None
61
- self.__source_dir = os.path.dirname(__file__)
62
- self.__jarpath = None
63
- self.__jarfile_name = "xml-casa-assembly-1.86.jar"
64
- self.__task_xml_files = None
65
-
66
- def __which( self, program ):
67
- def is_exe(fpath):
68
- return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
69
-
70
- fpath, fname = os.path.split(program)
71
- if fpath:
72
- if is_exe(program):
73
- return os.path.realpath(program)
74
- else:
75
- os.environ.get("PATH", "")
76
- for path in os.environ.get("PATH", "").split(os.pathsep):
77
- exe_file = os.path.join(path, program)
78
- if is_exe(exe_file):
79
- return os.path.realpath(exe_file)
80
- return None
81
-
82
- def __find_parameters( self, taskname ):
83
- templ = os.path.join( self.__source_dir, f'''{taskname}.mustache''' )
84
- if os.path.isfile(templ):
85
- ### <TASK>.mustache exists -------------------------------------------------------------------------------------------------------------
86
- with open(templ) as f:
87
- header = [ (m.group(1), m.group(2), m.group(0)) for m in [ re.match( "^\#+\s*TASK XML\s*>\s*(\S+)(.*)", next(f) ) for _ in range(5) ] if m ]
88
- if len(header) == 1:
89
- ### <TASK>.mustache has processing specification line --------------------------------------------------------------------------
90
- task = os.path.splitext(header[0][0])[0]
91
- if task in self.__task_xml_files:
92
- ### <TASK>.mustache has processing specification line and includes valid CASA task name ------------------------------------
93
- return templ, self.__task_xml_files[task], header[0][1].split( )
94
- elif taskname in self.__task_xml_files:
95
- ### <TASK>.mustache has processing specification line and <TASK> is a valid CASA task --------------------------------------
96
- return templ, self.__task_xml_files[taskname], header[0][1].split( )
97
- elif taskname in self.__task_xml_files:
98
- ### <TASK>.mustache does not have a processing specification line but <TASK> is a valid CASA task-------------------------------
99
- return templ, self.__task_xml_files[taskname], [ ]
100
-
101
- if taskname in self.__task_xml_files:
102
- ### <TASK>.mustache does not exist but <TASK> is a valid CASA task ---------------------------------------------------------------------
103
- templ = os.path.join( self.__source_dir, f'''generic.mustache''' )
104
- if os.path.isfile(templ):
105
- ### <TASK> is a valid CASA task and generic.mustache exists ------------------------------------------------------------------------
106
- with open(templ) as f:
107
- header = [ (m.group(1), m.group(2), m.group(0)) for m in [ re.match( "^\#+\s*TASK XML\s*>\s*(\S+)(.*)", next(f) ) for _ in range(5) ] if m ]
108
- if len(header) == 1:
109
- ### <TASK> is a valid CASA task, generic.mustache exists and has a processing specification line ---------------------------
110
- return templ, self.__task_xml_files[taskname], header[0][1].split( )
111
- else:
112
- ### <TASK> is a valid CASA task, generic.mustache exists but does not have a processing specification line -----------------
113
- return templ, self.__task_xml_files[taskname], [ ]
114
-
115
- return None, None, [ ]
116
-
117
- def find_spec(self, fullname, path, target = None):
118
-
119
- if fullname.startswith('cubevis.private.casatasks.'):
120
- if self.__java is None:
121
- self.__java = self.__which( "java" )
122
- if self.__jarpath is None:
123
- p = os.path.join( os.path.dirname(os.path.dirname(__file__)), "__java__", self.__jarfile_name )
124
- if os.path.isfile(p):
125
- self.__jarpath = p
126
- if self.__task_xml_files is None:
127
- try:
128
- from casatasks import xml_interface_defs
129
- self.__task_xml_files = { k:v for (k,v) in xml_interface_defs( ).items( ) if os.path.isfile(v) }
130
- except: pass
131
-
132
- module = fullname.split(sep='.')[-1]
133
- templ, xml, args = self.__find_parameters( fullname.split(sep='.')[-1] )
134
- if templ is not None and xml is not None:
135
- from importlib.machinery import ModuleSpec
136
- return ModuleSpec( fullname, CasaTasks_Loader( self.__java, self.__jarpath, args, templ, xml ) )
137
-
138
- return None
139
-
140
- sys.meta_path.append(CasaTasks_Finder( ))
30
+ from .iclean import iclean
cubevis/toolbox/_cube.py CHANGED
@@ -881,7 +881,7 @@ class CubeMask:
881
881
  ### power: 𝑦=(𝛼^𝑥−1)/(𝛼−1)
882
882
  self._cm_adjust['alpha-value'] = TextInput( value="1000", prefix="alpha", max_width=170, visible=False )
883
883
  self._cm_adjust['gamma-value'] = TextInput( value="1", prefix="gamma", max_width=170, visible=False )
884
- self._cm_adjust['equation'] = Div(text='''<math><mrow><mi>y</mi><mo>=</mo><mi>x</mi></mrow></math>''') # linear
884
+ self._cm_adjust['equation'] = Div(text='''<math><mrow><mi>y</mi><mo>=</mo><mi>x</mi></mrow></math>''', margin=(12, 0, 0, 0)) # linear
885
885
  self._cm_adjust['scaling'] = Dropdown( label='linear',
886
886
  menu=[ ('linear', 'linear'), ('log', 'log'), ('sqrt','sqrt'),
887
887
  ('square', 'square'), ('gamma', 'gamma'), ('power', 'power') ],
@@ -1048,6 +1048,7 @@ class CubeMask:
1048
1048
 
1049
1049
  return dict( result='failure', update={ } )
1050
1050
 
1051
+ scaling_background = '#f8f8f8'
1051
1052
  return column( self._cm_adjust['fig'],
1052
1053
  row( Tip( self._cm_adjust['min input'],
1053
1054
  tooltip=Tooltip( content=HTML("set minimum clip here or drag the left red line above"),
@@ -1055,16 +1056,18 @@ class CubeMask:
1055
1056
  Tip( self._cm_adjust['max input'],
1056
1057
  tooltip=Tooltip( content=HTML("set maximum clip here or drag the right red line above"),
1057
1058
  position="top_left" ) ), width_policy='min' ),
1058
- row( Tip( self._cm_adjust['scaling'],
1059
- tooltip=Tooltip( content=HTML('scaling function applied to image intensities'),
1060
- position="top" ) ),
1061
- self._cm_adjust['equation'] ),
1062
- row( Tip( self._cm_adjust['alpha-value'],
1063
- tooltip=Tooltip( content=HTML('set alpha value as indicated in the equation'),
1064
- position="top" ) ),
1065
- Tip( self._cm_adjust['gamma-value'],
1066
- tooltip=Tooltip( content=HTML('set gamma value as indicated in the equation'),
1067
- position="top" ) ) ),
1059
+ column( Div(text="<small>scaling</small>", styles={'background-color': scaling_background, 'margin': '0px'}),
1060
+ row( Tip( self._cm_adjust['scaling'],
1061
+ tooltip=Tooltip( content=HTML('scaling function applied to image intensities'),
1062
+ position="top" ) ),
1063
+ self._cm_adjust['equation'] ),
1064
+ row( Tip( self._cm_adjust['alpha-value'],
1065
+ tooltip=Tooltip( content=HTML('set alpha value as indicated in the equation'),
1066
+ position="top" ) ),
1067
+ Tip( self._cm_adjust['gamma-value'],
1068
+ tooltip=Tooltip( content=HTML('set gamma value as indicated in the equation'),
1069
+ position="top" ) ) ),
1070
+ width=325, styles={'background-color': scaling_background, 'border': '1px solid black', 'padding': '10px'} ),
1068
1071
  sizing_mode="scale_width" )
1069
1072
 
1070
1073
  def bitmask_ctrl( self, reuse=None, **kw ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cubevis
3
- Version: 0.5.12
3
+ Version: 0.5.14
4
4
  Summary: visualization toolkit and apps for casa
5
5
  License: LGPL
6
6
  Author-email: Darrell Schiebel <darrell@schiebel.us>,Pam Harris <pharris@nrao.edu>
@@ -88,7 +88,6 @@ cubevis/plot/ms_plot/_ms_plot_selectors.py,sha256=bus0R6R8BNS6Y2dMxVngf6v54AIZTd
88
88
  cubevis/plot/ms_plot/_raster_plot.py,sha256=OtEDX5cjNZ65Wn1vB8vTxEr1JZejyXgE9nW_liUNAwc,12958
89
89
  cubevis/plot/ms_plot/_raster_plot_inputs.py,sha256=yUFob7t4JMXTwHjzNWZMEMLCvQdJ55SyWj3mZBxHgos,5173
90
90
  cubevis/plot/ms_plot/_xds_plot_axes.py,sha256=EeWvAbiKV33nEWdI8V3M0uwLTnycq4bFYBOyVWkxCu0,4429
91
- cubevis/private/__java__/xml-casa-assembly-1.86.jar,sha256=dBT_OxPtczAfWKRaOrHWwNZbDfEjtKkuQGuFOaKOczA,8041045
92
91
  cubevis/private/_gclean.py,sha256=ExdR6cRxSa6Xne2veGNKhbTtx-tXUIWr2htzEmEZ9Z4,41107
93
92
  cubevis/private/apps/__init__.py,sha256=-9U6o-SClwJolGDnFhlH1au4tz-w4HgRcyT4_OQ_Z7E,2510
94
93
  cubevis/private/apps/_createmask.py,sha256=bKFpME5MYhLh7HxlJZINBTwG25t0_T_d1nYrWYAWYPA,23527
@@ -101,7 +100,7 @@ cubevis/private/apps/_plotants.py,sha256=top6VWVd_sE48IVPH_sIg3_sQeDl5tadi5DL7r5
101
100
  cubevis/private/apps/_plotbandpass.py,sha256=NwOgKSRnpLw9Pt3KIdBpoV78q1OnjCvj6lWFqeyICt8,185
102
101
  cubevis/private/casashell/createmask.py,sha256=C1eSUUsttSGghjZ5aDUVhRxnjir5MlYXVyxzEYLcI3k,14457
103
102
  cubevis/private/casashell/iclean.py,sha256=FUrCMrfXuTjUHFBA0PVEctDXlHsZrMZBePwZ_otDwxI,294787
104
- cubevis/private/casatasks/__init__.py,sha256=yLL13GDxSxIkqjjap_sJO_aGVaBUW9gXMwlAlPli97g,6963
103
+ cubevis/private/casatasks/__init__.py,sha256=Uzt9uNiTl0ORavzuoIDJ8gfYUhdWwAAj1D2VJ3wAvvQ,1333
105
104
  cubevis/private/casatasks/createmask.py,sha256=qtp8IvFCB1BG2pqRbyP8CmTr-RRqLMBSjMIO86mZ7WA,3770
106
105
  cubevis/private/casatasks/createregion.py,sha256=f2KIrkbbdczZk3EHd3x9ZTUaewdjSxlRge-Es8BivNk,3355
107
106
  cubevis/private/casatasks/iclean.py,sha256=YO9RRtWVD3MxizqxTB-7yPD8NkX-mvbsB2yTyRcrvT0,152997
@@ -112,7 +111,7 @@ cubevis/remote/_local.py,sha256=PcPCFcwttTFZd3O33-5pqDuGKQKK6CA0gz1MTIkTiNI,1032
112
111
  cubevis/remote/_remote_kernel.py,sha256=wfu7ZzKn-oCxZxzDIkC5puBvGf8WbCLYL3CzM56_FNc,2652
113
112
  cubevis/toolbox/__init__.py,sha256=VqxO5Izv0nEjhPbqTUH1jo8SQoyj5YrSbs7m42N8Rm0,1433
114
113
  cubevis/toolbox/_app_context.py,sha256=0tRY2SSbSCM6RKLFs_T707_ehWkJXPvnLlE1P9cLXJY,3024
115
- cubevis/toolbox/_cube.py,sha256=bee3159jtNh_Ls4oF2rtEL5qbp_xQt2tep4TVIlVFUg,293778
114
+ cubevis/toolbox/_cube.py,sha256=Qx0ZMfIq6Qw82DPGVeupEF0c4jCzcWIVN8OcSpfN0Ew,294187
116
115
  cubevis/toolbox/_region_list.py,sha256=_1RvnXwqMoaAq8CPy-6IyhabLi_snXqO566onehI2y0,8957
117
116
  cubevis/utils/_ResourceManager.py,sha256=SaaR29etabRiKxmUK-aWvAm4v_OPFJH8CX7bNFm0Lgo,3410
118
117
  cubevis/utils/__init__.py,sha256=bVAMnKLIVmQM6ShL_deOuHW0Zi2wcDP8lh5agWRRDDc,23190
@@ -126,8 +125,8 @@ cubevis/utils/_pkgs.py,sha256=mu2CCzndmJZYP81UkFhxveW_CisWLUvagJVolHOEVgM,2294
126
125
  cubevis/utils/_regions.py,sha256=TdAg4ZUUyhg3nFmX9_KLboqmc0LkyOdEW8M1WDR5Udk,1669
127
126
  cubevis/utils/_static.py,sha256=rN-sqXNqQ5R2M3wmPHU1GPP5OTyyWQlUPRuimCrht-g,2347
128
127
  cubevis/utils/_tiles.py,sha256=A9W1X61VOhBMTOKXVajzOIoiV2FBdO5N2SFB9SUpDOo,7336
129
- cubevis/__version__.py,sha256=z3x2AegQWLToL5yMcS7dHEto7D9XUa4VzCOqg91RCYc,22
130
- cubevis-0.5.12.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
131
- cubevis-0.5.12.dist-info/METADATA,sha256=kKWypQp_9ty8BR68rOpj6EW27-GHplOvNgmBqcDX9hA,2629
132
- cubevis-0.5.12.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
133
- cubevis-0.5.12.dist-info/RECORD,,
128
+ cubevis/__version__.py,sha256=b0SXIqxAeGNbHqmEF6canIj9jyDgtVMVv8z82e2cFm0,22
129
+ cubevis-0.5.14.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
130
+ cubevis-0.5.14.dist-info/METADATA,sha256=tnS8xGsFgp9tzj35CfXhVLoG5qZKaL7kkrud-0Cm8ao,2629
131
+ cubevis-0.5.14.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
132
+ cubevis-0.5.14.dist-info/RECORD,,