OpticSim.jl icon indicating copy to clipboard operation
OpticSim.jl copied to clipboard

Add visualization and analysis tools for glasses

Open BrianGun opened this issue 4 years ago • 6 comments

It is frequently useful to be able to plot glass properties to help in the process of choosing glasses. Extending the GlassCat.drawglassmap function is a good beginner PR because the code is relatively simple and doesn't have many dependencies on the rest of OpticSim.

The plotting of glassmaps is basic. It would be great to improve the plot to handle the case when many glass types have similar (index,dispersion) coordinates which makes the glass names print on top of each other. It would also be nice to be able to filter the glasses before plotting the glass map, and to plot multiple glass catalogs at the same time.

The current plot graphs index vs. dispersion, the derivative of index with respect to wavelength. Many optical engineers are more familiar with the Abbe number which is related to the derivative. It would be nice to allow the user to plot either the derivative or Abbe number along the x axis.

BrianGun avatar Apr 14 '21 17:04 BrianGun

Hi all

Is there a function that returns the glass id from the catalogs?

Sorn89 avatar Apr 15 '21 20:04 Sorn89

Is this what you're looking for?

https://microsoft.github.io/OpticSim.jl/dev/glasscat/#OpticSim.GlassCat.glassid

alfredclwong avatar Apr 15 '21 20:04 alfredclwong

No, I have the problem that I only get the glass names from the catalogs.But I need a way to get the data type AbstractGlass or the glass ID. So I can get nd and vd from the glass.

Maybe the problem is also due to my little Julia knowledge. But I find the project very interesting.

Sorn89 avatar Apr 15 '21 21:04 Sorn89

@friggog could you help @Sorn89?

BrianGun avatar Apr 15 '21 22:04 BrianGun

If you want to get all the glasses in the glass catalog you can use this function:

GlassCat.AGF_GLASSES

this is a vector of glasses. If you do

glasses = GlassCat.AGF_GLASSES

and then

b = glasses[30] #get the 30th glass in the catalog

then

b.Nd

this will return the index of that particular glass. Not sure if this is what you were looking for. Perhaps if you are more specific we can give more directed advice.

BrianGun avatar Apr 15 '21 22:04 BrianGun

@BrianGun Thank you very much! I was looking for such a function. This has solved my problem.

Sorn89 avatar Apr 15 '21 23:04 Sorn89