pymakeplots 0.2.4__tar.gz → 0.2.5__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.
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/PKG-INFO +1 -1
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots/pymakeplots.py +41 -7
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots.egg-info/PKG-INFO +1 -1
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/setup.py +1 -1
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/LICENSE.md +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/README.md +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots/__init__.py +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots/sauron_colormap.py +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots.egg-info/SOURCES.txt +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots.egg-info/dependency_links.txt +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots.egg-info/requires.txt +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots.egg-info/top_level.txt +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/pymakeplots.egg-info/zip-safe +0 -0
- {pymakeplots-0.2.4 → pymakeplots-0.2.5}/setup.cfg +0 -0
|
@@ -9,8 +9,9 @@ import matplotlib.pyplot as plt
|
|
|
9
9
|
import matplotlib
|
|
10
10
|
from pymakeplots.sauron_colormap import sauron
|
|
11
11
|
from mpl_toolkits.axes_grid1 import make_axes_locatable
|
|
12
|
-
from matplotlib.patches import Ellipse,Rectangle, Arrow
|
|
12
|
+
from matplotlib.patches import Ellipse,Rectangle, Arrow, FancyArrowPatch
|
|
13
13
|
from matplotlib import cm
|
|
14
|
+
from matplotlib.text import Text
|
|
14
15
|
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
|
|
15
16
|
from matplotlib.offsetbox import AnchoredText,AuxTransformBox, AnchoredOffsetbox
|
|
16
17
|
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar,AnchoredDirectionArrows
|
|
@@ -366,6 +367,7 @@ class pymakeplots:
|
|
|
366
367
|
hdr=scube.header
|
|
367
368
|
cube = np.squeeze(scube.filled_data[:,:,:].T).value #squeeze to remove singular stokes axis if present
|
|
368
369
|
cube[np.isfinite(cube) == False] = 0.0
|
|
370
|
+
|
|
369
371
|
try:
|
|
370
372
|
beamtab=scube.beam
|
|
371
373
|
except:
|
|
@@ -377,7 +379,13 @@ class pymakeplots:
|
|
|
377
379
|
beamvals=[scube.header['bmaj'],scube.header['bmin']]
|
|
378
380
|
beamtab=Beam(major=np.max(beamvals)*u.deg,minor=np.min(beamvals)*u.deg,pa=self.spectralcube.header['bpa']*u.deg)
|
|
379
381
|
except:
|
|
380
|
-
beamtab=False
|
|
382
|
+
beamtab=False
|
|
383
|
+
|
|
384
|
+
if beamtab.major.value ==0:
|
|
385
|
+
### MeerKAT style beams
|
|
386
|
+
beamvals=[np.mean([scube.header['bmaj1'],scube.header['bmaj3826']]),np.mean([scube.header['bmin1'],scube.header['bmin3826']])]
|
|
387
|
+
beamtab=Beam(major=np.max(beamvals)*u.deg,minor=np.min(beamvals)*u.deg,pa=np.mean([scube.header['bpa1'],scube.header['bpa3826']])*u.deg)
|
|
388
|
+
|
|
381
389
|
if primary:
|
|
382
390
|
self.spectralcube=scube
|
|
383
391
|
self.repfreq=np.median(self.spectralcube.with_spectral_unit(u.GHz).spectral_axis)
|
|
@@ -705,11 +713,14 @@ class pymakeplots:
|
|
|
705
713
|
|
|
706
714
|
def add_beam(self,ax):
|
|
707
715
|
aux_tr_box = AuxTransformBox(ax.transData)
|
|
708
|
-
|
|
716
|
+
if self.rotate!=None:
|
|
717
|
+
rotang=self.rotate
|
|
718
|
+
else:
|
|
719
|
+
rotang=0
|
|
709
720
|
if self.all_axes_physical:
|
|
710
|
-
aux_tr_box.add_artist(Ellipse((0, 0), width=self.ang2kpctrans(self.bmaj), height=self.ang2kpctrans(self.bmin), angle=self.bpa+90,edgecolor='black',facecolor='none',linewidth=1.5))
|
|
721
|
+
aux_tr_box.add_artist(Ellipse((0, 0), width=self.ang2kpctrans(self.bmaj), height=self.ang2kpctrans(self.bmin), angle=self.bpa+90+rotang,edgecolor='black',facecolor='none',linewidth=1.5))
|
|
711
722
|
else:
|
|
712
|
-
aux_tr_box.add_artist(Ellipse((0, 0), width=self.bmaj, height=self.bmin, angle=self.bpa+90,edgecolor='black',facecolor='none',linewidth=1.5))
|
|
723
|
+
aux_tr_box.add_artist(Ellipse((0, 0), width=self.bmaj, height=self.bmin, angle=self.bpa+90+rotang,edgecolor='black',facecolor='none',linewidth=1.5))
|
|
713
724
|
box = AnchoredOffsetbox(child=aux_tr_box, loc='lower left', pad=0.5, borderpad=0.4,frameon=False)
|
|
714
725
|
ax.add_artist(box)
|
|
715
726
|
|
|
@@ -761,7 +772,31 @@ class pymakeplots:
|
|
|
761
772
|
|
|
762
773
|
rotmat=np.array([[np.cos(np.deg2rad(self.rotate)),-np.sin(np.deg2rad(self.rotate))],[np.sin(np.deg2rad(self.rotate)),np.cos(np.deg2rad(self.rotate))]])
|
|
763
774
|
dx1,dx2=np.dot(rotmat,np.array([0,length2use]))
|
|
764
|
-
|
|
775
|
+
if (dx1 <0)&(dx2<0):
|
|
776
|
+
#lower left quadrant
|
|
777
|
+
startx,starty= np.abs(dx1), np.abs(dx2)
|
|
778
|
+
endx,endy=0,0
|
|
779
|
+
ha='right'
|
|
780
|
+
if (dx1 <0)&(dx2>0):
|
|
781
|
+
#upper left quadrant
|
|
782
|
+
startx,starty= 0,0
|
|
783
|
+
endx,endy= dx1,dx2
|
|
784
|
+
ha='right'
|
|
785
|
+
if (dx1 >0)&(dx2>0):
|
|
786
|
+
#upper right quadrant
|
|
787
|
+
startx,starty= 0,0
|
|
788
|
+
endx,endy= dx1, dx2
|
|
789
|
+
ha='left'
|
|
790
|
+
if (dx1 >0)&(dx2<0):
|
|
791
|
+
#lower right quadrant
|
|
792
|
+
startx,starty= -np.abs(dx1), np.abs(dx2)
|
|
793
|
+
endx,endy=0,0
|
|
794
|
+
ha='left'
|
|
795
|
+
|
|
796
|
+
aux_tr_box.add_artist(Text(endx,endy,'N',color='k',ha=ha,fontsize='small',va='center'))
|
|
797
|
+
aux_tr_box.add_artist(FancyArrowPatch((startx,starty), (endx,endy),
|
|
798
|
+
mutation_scale=100,color='k',arrowstyle='->,head_length=0.1, head_width=0.05'))
|
|
799
|
+
|
|
765
800
|
box = AnchoredOffsetbox(child=aux_tr_box, loc=loc, frameon=False)
|
|
766
801
|
ax.add_artist(box)
|
|
767
802
|
#ax.text(3, y + 0.05, bracketstyle, ha="center", va="bottom", fontsize=14)
|
|
@@ -1234,7 +1269,6 @@ class pymakeplots:
|
|
|
1234
1269
|
ylab="Unknown"
|
|
1235
1270
|
|
|
1236
1271
|
if (''.join(self.bunit.split())).lower() == "Jy/beam".lower():
|
|
1237
|
-
|
|
1238
1272
|
spec*=1/self.beam_area()
|
|
1239
1273
|
spec_mask*=1/self.beam_area()
|
|
1240
1274
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|