Hi all, My name is Devan Conroy and I am working at SLAC as a summer intern in the SULI program with Jeff Oishi. I am trying to figure out how to count the number of cells in the grid when loading in data. I tried using (len(DataIn)), but got the error: object of type 'AMRRegion' has no len(). Any suggestions? Thank you, Devan Conroy -- Devan Conroy Fairfield University 2013 Mathematics Major Computer Science/French Minor
Hi Devan, You can do that in a couple ways. On the command line: yt stats <dataset> or in a python session from yt.mods import * pf = load(<dataset>) pf.h.print_stats() Britton On Thu, Jul 26, 2012 at 6:20 PM, Devan Conroy < devan.conroy@student.fairfield.edu> wrote:
Hi all,
My name is Devan Conroy and I am working at SLAC as a summer intern in the SULI program with Jeff Oishi. I am trying to figure out how to count the number of cells in the grid when loading in data. I tried using (len(DataIn)), but got the error: object of type 'AMRRegion' has no len().
Any suggestions?
Thank you, Devan Conroy
-- Devan Conroy Fairfield University 2013 Mathematics Major Computer Science/French Minor
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Britton,
Thanks for the message. Unfortunately, this needs to be within the
api, in an analysis module, without loading any data. It also needs to
be done on a particular AMRRegion that gets fed in to the (new)
module.
thanks,
j
On Thu, Jul 26, 2012 at 3:20 PM, Devan Conroy
Hi all,
My name is Devan Conroy and I am working at SLAC as a summer intern in the SULI program with Jeff Oishi. I am trying to figure out how to count the number of cells in the grid when loading in data. I tried using (len(DataIn)), but got the error: object of type 'AMRRegion' has no len().
Any suggestions?
Thank you, Devan Conroy
-- Devan Conroy Fairfield University 2013 Mathematics Major Computer Science/French Minor
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Jeff and Devan,
Right now until data is loaded, a data object doesn't know its own
size. (This changes in the geometry refactor.) However, this should
get you what you want:
reg.quantities["TotalQuantity"]("Ones")
A bit obtuse, but will give you a cell count.
(FWIW, you can get all of the data that comes from stats/print_stats
yourself by looking at level_stats on the hierarchy object.)
-Matt
On Thu, Jul 26, 2012 at 6:32 PM, j s oishi
Hi Britton,
Thanks for the message. Unfortunately, this needs to be within the api, in an analysis module, without loading any data. It also needs to be done on a particular AMRRegion that gets fed in to the (new) module.
thanks,
j
On Thu, Jul 26, 2012 at 3:20 PM, Devan Conroy
wrote: Hi all,
My name is Devan Conroy and I am working at SLAC as a summer intern in the SULI program with Jeff Oishi. I am trying to figure out how to count the number of cells in the grid when loading in data. I tried using (len(DataIn)), but got the error: object of type 'AMRRegion' has no len().
Any suggestions?
Thank you, Devan Conroy
-- Devan Conroy Fairfield University 2013 Mathematics Major Computer Science/French Minor
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (4)
-
Britton Smith
-
Devan Conroy
-
j s oishi
-
Matthew Turk