Commit d5b8de30 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

change colormap stars/halo, fix bug __uns.unsin.getData()

parent b662a643
......@@ -119,7 +119,7 @@ class C2dplot:
#
# smartAnalysis
#
def smartAnalysis(self,analysis=None,component=None,xrange="20",mergers=None,center_cod=None,cmap="gas:jet,stars:Paired,halo:Accent",contour=False,noxz=False,sigma=6.0):
def smartAnalysis(self,analysis=None,component=None,xrange="20",mergers=None,center_cod=None,cmap="gas:jet,stars:rainbow,halo:PuOr",contour=False,noxz=False,sigma=6.0):
"""
Main core function to compute MOVIE on current snapshot store in data_analysis
"""
......@@ -315,7 +315,7 @@ class C2dplot:
if self.__vdebug:
print("IN __getCenterCod [%s]"%(center_cod),file=sys.stderr)
if os.path.isfile(center_cod) : # it's a file
ok,time=self.__uns.getData("time")
ok,time=self.__uns.unsin.getData("time")
return CCod(None).getCodFromFile(center_cod,time)
else:
tmp=center_cod.split('@')
......@@ -325,7 +325,7 @@ class C2dplot:
print("Simulation name from COD [%s] comp <%s>\n"%(simname,comp))
print("SELF.__ANALYSIS = <%s>"%(self.__analysis))
cod=CCod(simname,verbose_debug=self.__vdebug)
ok,time=self.__uns.getData("time")
ok,time=self.__uns.unsin.getData("time")
cod_base=None
if self.__analysis is not None:
if hasattr(self.__analysis,"cod_dir"):
......@@ -389,10 +389,10 @@ class C2dplot:
comp_cmap = {}
comp_cmap['all' ]='jet'
comp_cmap['gas' ]='jet'
comp_cmap['stars']='Paired'
comp_cmap['stars']='rainbow'
comp_cmap['disk' ]='Set3'
comp_cmap['bndry']='hsv'
comp_cmap['halo' ]='RdBu'
comp_cmap['halo' ]='PuOr'
if len(cmap.split(","))==1 and len(cmap.split(":"))==1:
# set same cmap for all components
for i,ccomp in enumerate(comp_cmap):
......@@ -495,7 +495,7 @@ class C2dplot:
#zz=np.random.random((102,102))
#qq=ndi.gaussian_filter(zz,sigma=1.6,order=0)
#im = ax.imshow(qq, norm = matplotlib.colors.LogNorm(), cmap="jet")
#plt.contour(qq,cmap="Paired")
#plt.contour(qq,cmap="rainbow")
if r != nrows-1:
ax.set_xticks([])
if c!=0:
......@@ -789,9 +789,9 @@ def commandLine():
parser.add_argument('--range', help="plot range",default=20,type=str)
parser.add_argument('--cmap', help="color map name. You can use a common cmap for all components, or a specific one.\
Syntax is \"component1:cmap1,component2:cmap2\"\
example: stars:Paired,halo:Purples\n \
example: stars:rainbow,halo:Purples\n \
(to display all colormap available use \"show\" as keyword)",
default="gas:jet,stars:Paired,halo:Accent")
default="gas:jet,stars:rainbow,halo:PuOr")
parser.add_argument('--mergers', help="use results from mergers analysis to re-center (ex; @mdf648) to get file automatically from simulation ",default="",type=str)
parser.add_argument('--cod', help="use COD file to re-center, or @sim (ex; @mdf648) to get file automatically from simulation ",default=None)
parser.add_argument('--rect_sim', help="give a simname or a rectify file name to activate rectify",default=None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment