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

Recreate Preparation files #23

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Recreate Preparation files #23

wants to merge 2 commits into from

Conversation

esrivas17
Copy link
Collaborator

Here I am trying to recreate coordinates_utm.h5 and background_map.h5 in the case of a second run with different inputs dimensions.

Copy link
Member

@Andreas-Piter Andreas-Piter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @esrivas17, thanks for your pull request and the implemented changes.
I would like to ask you to apply the following changes:

  • address the comments to the code
  • fix the coding style according to make lint (the pipeline failed for this part)
  • enter your name to the contributors in file "Authors.rst"
  • add the issue Recreating files in preparation step #12 to this Pull request.

Comment on lines +187 to +193
coord_utm_obj = CoordinatesUTM(file_path=join(self.path, "coordinates_utm.h5"), logger=self.logger)
if not exists(coord_utm_obj.file_path) or (exists(coord_utm_obj.file_path) and coord_utm_obj.getShape()[1:] != mean_amp_img.shape):
coord_utm_obj.prepare(input_path=join(self.config.general.input_path, "geometryRadar.h5"))
del coord_utm_obj

if not exists(join(self.path, "background_map.h5")):
bmap_obj = AmplitudeImage(file_path=join(self.path, "background_map.h5"))
del coord_utm_obj
bmap_obj = AmplitudeImage(file_path=join(self.path, "background_map.h5"))
if not exists(bmap_obj.file_path) or (exists(bmap_obj.file_path) and bmap_obj.getShape() != mean_amp_img.shape):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep it even simpler. Let's store the amplitude image and the coordinates every time as it is not the computational bottleneck. It is enough to remove the if statement.

Comment on lines +106 to +109
def getShape(self):
with h5py.File(self.file_path, 'r') as f:
return f["background_map"].shape

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this part.

Comment on lines +204 to +206
def getShape(self):
with h5py.File(self.file_path, 'r') as f:
return f["coord_utm"].shape
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this part.

@esrivas17 esrivas17 self-assigned this Nov 8, 2024
@esrivas17 esrivas17 linked an issue Nov 8, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recreating files in preparation step
2 participants