-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
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): |
There was a problem hiding this comment.
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.
def getShape(self): | ||
with h5py.File(self.file_path, 'r') as f: | ||
return f["background_map"].shape | ||
|
There was a problem hiding this comment.
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.
def getShape(self): | ||
with h5py.File(self.file_path, 'r') as f: | ||
return f["coord_utm"].shape |
There was a problem hiding this comment.
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.
Here I am trying to recreate
coordinates_utm.h5
andbackground_map.h5
in the case of a second run with different inputs dimensions.