Skip to content

generic multi-dataset file (e.g. velocity) support in add/diff/deramp#732

Merged
yunjunz merged 7 commits intoinsarlab:mainfrom
yuankailiu:dev_add-diff-ramp
Feb 3, 2022
Merged

generic multi-dataset file (e.g. velocity) support in add/diff/deramp#732
yunjunz merged 7 commits intoinsarlab:mainfrom
yuankailiu:dev_add-diff-ramp

Conversation

@yuankailiu
Copy link
Contributor

@yuankailiu yuankailiu commented Jan 27, 2022

  • add.py: when operating on velocity files, operate on velocity dset as default
  • diff.py: when operating on velocity files, operate on velocity dset as default
  • utils1..py: when deramping on velocity files, operate on velocity dset as default

Description of proposed changes

Here propose to operate on the velocity dataset as default when using the following functions/codes on the velocity files (FILE_TYPE=velocity)

Before, the default for deramping is operating on the first dataset, not necessarily the "velocity" if there are multiple fields in it, e.g., "annualAmplitude".

Also the same situation in add.py and diff.py.

This is a quick tweak, it would be even better to allow a user-defined dataset when calling the function, which could be in another PR.

Thanks for reviewing it.

Reminders

  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.

@yunjunz yunjunz self-requested a review January 28, 2022 05:03
Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

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

Thank you @yuankailiu for the useful PR. Could we use the existing else block by assigning dsName or datasetName for the velocity file type, for this functionality, instead of creating a new elif block of code? That would be a more adaptable solution.

@yunjunz
Copy link
Member

yunjunz commented Feb 2, 2022

Hi @yuankailiu, thank you for addressing the suggestion. We should apply the same style of changes in utils1.py to the other two scripts as well.

+ add.py: when operating on velocity files, operate on velocity dset as default
+ diff.py: when operating on velocity files, operate on velocity dset as default
+ utils1..py: when deramping on velocity files, operate on velocity dset as default
A more general change based on the previous commit
+ add.py: when input files have multiple datasets, operate on the common dataset(s)
+ diff.py: when input files have multiple datasets, operate on the common dataset(s)
@yuankailiu
Copy link
Contributor Author

Hi @yuankailiu, thank you for addressing the suggestion. We should apply the same style of changes in utils1.py to the other two scripts as well.

@yunjunz, for add.py and diff.py, thanks. I have this new commit with a maybe more general way. It is still using the current else block. Now I first identify the common datasets for two (or more) input files and operate on those common datasets.

So now diff.py imitates add.py to handle multiple datasets.

Do you think this is a good way to go?

@yunjunz
Copy link
Member

yunjunz commented Feb 3, 2022

Hi @yuankailiu, that is a good idea.

e.g. mask, mask, waterMask. This is done by 1) use the 1st file ds name as reference, and 2) ignore ds name for the rest file
Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

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

Looks all good to me now.

@yunjunz yunjunz changed the title velocity dataset in add/diff/deramp generic multi-dataset file (e.g. velocity) support in add/diff/deramp Feb 3, 2022
@yunjunz yunjunz merged commit b33fefc into insarlab:main Feb 3, 2022
@yuankailiu yuankailiu deleted the dev_add-diff-ramp branch February 7, 2022 19:44
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.

2 participants