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

Refactored DirectivityData to store far fields and flux as fields, and compute radiation parameters via properties #2129

Open
wants to merge 1 commit into
base: pre/2.8
Choose a base branch
from

Conversation

QimingFlex
Copy link
Contributor

No description provided.

@momchil-flex
Copy link
Collaborator

Does it make more sense to store the linearly polarized fields and add properties to get the circularly polarized ones?

@QimingFlex
Copy link
Contributor Author

Does it make more sense to store the linearly polarized fields and add properties to get the circularly polarized ones?

Linearly polarized fields are the regular far-field components Etheta​ and Ephi​. I was previously thinking of putting E_left and E_right as properties of FarfieldProjectionMonitor, but doing so would require users to define both FarfieldProjectionMonitor and DirectivityMonitor to obtain all radiation characteristics. So I placed E_left​ and E_right​ under DirectivityMonitor, allowing users to access these radiation characteristics with just one monitor. Maybe a better way is to keep all six far-field components (Er to Hphi​) as fields in DirectivityData and introduce E_left​ and E_right as properties?

@dmarek-flex
Copy link
Contributor

Does it make more sense to store the linearly polarized fields and add properties to get the circularly polarized ones?

I agree. For simplicity and extensibility, I think the DirectivityData should only store Etheta/Ephi far fields and total flux. Most antenna characteristics of interest can be derived from that data. We should not even need the radial components in the far field. (We could also compute H far fields on-the-fly given the background medium, but maybe simpler to keep it the way it is and store it explicitly.)

@QimingFlex can you think of any parameters of interest where the far field approximation is not used for antennas?

@QimingFlex
Copy link
Contributor Author

Does it make more sense to store the linearly polarized fields and add properties to get the circularly polarized ones?

I agree. For simplicity and extensibility, I think the DirectivityData should only store Etheta/Ephi far fields and total flux. Most antenna characteristics of interest can be derived from that data. We should not even need the radial components in the far field. (We could also compute H far fields on-the-fly given the background medium, but maybe simpler to keep it the way it is and store it explicitly.)

@QimingFlex can you think of any parameters of interest where the far field approximation is not used for antennas?

This sounds like a good plan. We store DirectivityData only with Etheta/Ephi, Htheta/Hphi, and total flux. Other characteristics, such as directivity, axial ratio, and polarized fields, are defined as properties. How do you think? @weiliangjin2021

@weiliangjin2021
Copy link
Collaborator

This sounds like a good plan. We store DirectivityData only with Etheta/Ephi, Htheta/Hphi, and total flux. Other characteristics, such as directivity, axial ratio, and polarized fields, are defined as properties. How do you think?

Sounds good to me.

@QimingFlex QimingFlex force-pushed the qiming/far_field_API branch 2 times, most recently from aa7df58 to 7737d34 Compare December 20, 2024 21:07
@QimingFlex QimingFlex changed the title Added polarized far field components to DirectivityData Refractored DirectivityData to store far fields and flux as fields, and compute radiation parameters via properties Dec 20, 2024
@QimingFlex QimingFlex changed the title Refractored DirectivityData to store far fields and flux as fields, and compute radiation parameters via properties Refactored DirectivityData to store far fields and flux as fields, and compute radiation parameters via properties Dec 20, 2024
@momchil-flex
Copy link
Collaborator

Sorry, wouldn't this now be almost identical to a far field monitor? Should we consider unifying, e.g. deprectating DirectivityMonitor, and adding the directivity, axial ratio, etc. properties to the FarFieldAngleMonitor?

@QimingFlex
Copy link
Contributor Author

Sorry, wouldn't this now be almost identical to a far field monitor? Should we consider unifying, e.g. deprectating DirectivityMonitor, and adding the directivity, axial ratio, etc. properties to the FarFieldAngleMonitor?

The difference lies in DirectivityMonitor inheriting FluxMonitor to compute directivity. Do you think it would be better for FarFieldAngleMonitor to inherit FluxMonitor and store flux as a field in FarFieldAngleData? This will allow DirectivitiMonitor to be depracted.

@momchil-flex
Copy link
Collaborator

Ok, I think it makes sense as is.

Note that you're modifying the notebooks submodule.

Copy link
Contributor

@dmarek-flex dmarek-flex left a comment

Choose a reason for hiding this comment

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

Great, this looks a lot simpler @QimingFlex! Couple of simple things and yea just need to revert the notebooks module.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
tidy3d/components/data/monitor_data.py Outdated Show resolved Hide resolved
tests/test_data/test_monitor_data.py Show resolved Hide resolved
tidy3d/components/data/monitor_data.py Outdated Show resolved Hide resolved
@QimingFlex QimingFlex force-pushed the qiming/far_field_API branch 4 times, most recently from 435ffd2 to 607e7de Compare January 3, 2025 22:48
CHANGELOG.md Outdated Show resolved Hide resolved
tidy3d/components/data/monitor_data.py Outdated Show resolved Hide resolved
tidy3d/components/data/monitor_data.py Outdated Show resolved Hide resolved
tidy3d/components/data/monitor_data.py Show resolved Hide resolved
tidy3d/components/data/monitor_data.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 left a comment

Choose a reason for hiding this comment

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

Could you also add tests for left and right polarization?

@QimingFlex QimingFlex force-pushed the qiming/far_field_API branch from 607e7de to fc2a5c8 Compare January 3, 2025 23:39
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 left a comment

Choose a reason for hiding this comment

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

Approve once tests for right/left polarization have been added

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.

4 participants