Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bool method to test whether a cell id has a vdf or not #292

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading