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

Create foreoptic component #132

Open
abeerfatima opened this issue Mar 16, 2024 · 1 comment
Open

Create foreoptic component #132

abeerfatima opened this issue Mar 16, 2024 · 1 comment

Comments

@abeerfatima
Copy link
Contributor

Create a component for the selected foreoptic which inherits from the foreoptic class.

Copy link

dosubot bot commented Mar 16, 2024

Hey @abeerfatima, great to see you back! Hope you're doing awesome. 🚀

Sure, you can create a new foreoptic component by creating an instance of the Foreoptic class. Here's an example of how you might do this:

from architect.systems.optical import foreoptics

# Create a new foreoptic component
my_foreoptic = foreoptics.Foreoptic(
    diameter=0.1 * unit.m,  # 0.1 meters
    image_diameter=0.05 * unit.m,  # 0.05 meters
    focal_length=0.2 * unit.m,  # 0.2 meters
    mass=0.3 * unit.kg,  # 0.3 kilograms
    length=0.4 * unit.m,  # 0.4 meters
    transmittance=0.9 * unit.percent  # 90 percent
)

This will create a new Foreoptic component with the specified parameters. You can then use the methods of the Foreoptic class to interact with this component. For example, you can get the diameter of the foreoptic with my_foreoptic.get_diameter(), or calculate the f-number with my_foreoptic.get_f_number().

Please note that the Foreoptic class requires the astropy.units module for handling physical units, so you'll need to import this module as unit before you can create a Foreoptic component.

If you need to create a foreoptic component with different or additional functionality, you could create a new class that inherits from Foreoptic and add the necessary methods. However, without more specific requirements, it's hard to provide a more detailed example.

I hope this helps! If you have any further questions or need more specific guidance, please let me know.

For more information, you can refer to the Foreoptic class in the architect/systems/optical/foreoptics.py file on the architect repository.

-Dosu

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

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

No branches or pull requests

1 participant