Skip to content

Commit

Permalink
Merge pull request #292 from kstppd/has_vdf
Browse files Browse the repository at this point in the history
Bool method to test whether a cell id has a vdf or not
  • Loading branch information
alhom authored Nov 27, 2024
2 parents 0ce3ace + a9a8e32 commit 92d0ae0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pyVlsv/vlsvreader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#s
# This file is part of Analysator.
# Copyright 2013-2016 Finnish Meteorological Institute
# Copyright 2017-2024 University of Helsinki
Expand Down Expand Up @@ -2375,6 +2375,15 @@ def get_cellid_with_vdf(self, coords, pop = 'proton'):
return output
else:
return output[0]

def cellid_has_vdf(self, cid, pop = 'proton')->bool:
''' Returns whether the cid in question has a vdf or not
:param coords: the cellid to test for
:returns: bool
'''
self.__set_cell_offset_and_blocks_nodict(pop)
cid_w_vdf = self.__cells_with_blocks[pop]
return cid in cid_w_vdf

def get_vertex_indices(self, coordinates):
''' Get dual grid vertex indices for all coordinates.
Expand Down

0 comments on commit 92d0ae0

Please sign in to comment.