<div dir="ltr">Hello all<div><br></div><div>I'm trying to get some stats for Mars using a MOLA dataset.</div><div><br></div><div>Since GRASS 7.0beta is having some problems with the most recent matplotlib i added the planetary spheroids from v.7.0 into v.6.4.4 ellipse.table file.</div>
<div>Then I created a Location using Equirectangular (eqc) projection, no datum definition (dx=dy=dz=0) and mars (IAU2000) spheroid.</div><div><br></div><div>After that I run, through python, r.stats and make a list of the area values:</div>
<div><br></div><div>gdem = 'mola'</div><div>bwidth = 10 #10m bins for histogram</div><div><br></div><div><div>rinfo = grass.parse_command('<a href="http://r.info">r.info</a>', map=gdem, flags='r')</div>
<div>g_min = float(rinfo['min'])</div><div>g_max = float(rinfo['max'])</div></div><div><br></div><div><div>grass.run_command('g.region', rast=gdem, flags='pa')</div><div>nbins = round((g_max - g_min)/bwidth) # bin size <br>
</div><div>mapstats = grass.read_command('r.stats', input = gdem, \</div><div> fs = ',', nsteps = nbins, flags = 'an')</div><div><br></div><div>histlist = mapstats.splitlines()</div><div>elevlist = []</div>
<div>arealist = []</div><div>for pair in histlist:</div><div> try:</div><div> pairlist = pair.split(',')</div><div> elev = int(float(pairlist[0]))</div><div> area = float(pair.split(',')[1])</div>
<div> elevlist.append(elev)</div><div> arealist.append(area)</div><div> except:</div><div> pass</div><div><br></div><div>np.sum(arealist)</div></div><div><br></div><div>this last step will give me:</div>
<div><div>>>> np.sum(arealist)</div><div>64793.652361588101</div></div><div><br></div><div>Of course this is wrong. Mars has a surface area of about 144.8E6km2. I know that my steps are working because I get correct values for Earth:</div>
<div><br></div><div>#with ETOPO5 (r.stats returns values in m2)</div><div><div>>>> np.sum(arealist)/10e6</div><div>507756893328616.19</div></div><div><br></div><div><br></div><div>So, what am I missing?</div><div>
<br></div><div>thanks</div><div><br></div><div>Carlos</div><div><br></div><div><br></div><div><div><br></div>-- <br><div dir="ltr">Prof. Carlos Henrique Grohmann<br>Institute of Energy and Environment - Univ. of São Paulo, Brazil<div>
- Digital Terrain Analysis | GIS | Remote Sensing - </div><div><br></div><div><a href="http://carlosgrohmann.com/" target="_blank">http://carlosgrohmann.com</a></div><div><a href="http://orcid.org/0000-0001-5073-5572" style="font-size:13px;color:rgb(17,85,204);font-family:arial,sans-serif;background-color:rgb(255,255,255)" target="_blank">http://orcid.org/0000-0001-5073-5572</a><br>
<div>________________<br>Can’t stop the signal.</div></div></div>
</div></div>