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

Confusion while installing .AGF files

Open fortunewalla opened this issue 3 years ago • 1 comments

Describe the bug I downloaded the schott-optical-glass-overview-zemax-format.zip which contains schottzemax-20220124.agf. Now I am bit uncertain as to how to install it.

Do I simply rename it and copy it to the agf folder but then where to find the corresponding .jl file?

According to the documentation, I need to run a function called add_agf(agffile; agfdir = AGF_DIR, sourcefile = SOURCES_PATH, name = nothing, rebuild = true)

  1. Would the below code be the right one?
OpticSim.GlassCat.add_agf(
raw"c:\users\sw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\schottzemax-20220124.agf"; 
agfdir=raw"c:\users\sw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\agf", 
sourcefile=raw"c:\users\sw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\sources.txt",
name="SCHOTT",
rebuild=true
)

Steps to reproduce it

I tried to run the above code with rebuild=true but for some reason it started downloading numpy to install it. I exited the installation procedure as I was not sure if it install it in my existing python installation or not. Would rebuild=false suffice?

julia> using OpticSim

julia> OpticSim.GlassCat.add_agf(raw"c:\users\sw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\schottzemax-20220124.agf"; agfdir=raw"c:\users\sw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\agf", sourcefile=raw"c:\users\sw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\sources.txt",name="SCHOTT",rebuild=true)
[ Info: Re-building OpticSim.jl
    Building GR ──────→ `c:\users\sw\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\c98aea696662d09e215ef7cda5296024a9646c75\build.log`
┌ Info: Creating depsfile. GR provider is BinaryBuilder 0/7
│   provider = "BinaryBuilder"
└   depsfile = "c:\\users\\sw\\julia\\.julia\\packages\\GR\\xhzFJ\\deps\\deps.jl"
    Building ModernGL → `c:\users\sw\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\344f8896e55541e30d5ccffcbf747c98ad57ca47\build.log`
    Building GLPK ────→ `c:\users\sw\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6f4e9754ee93e2b2ff40c0b0a6b4cdffd289190d\build.log`
    Building Conda ───→ `c:\users\sw\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\6e47d11ea2776bc5627421d59cdcc1296c058071\build.log`
    Building PyCall ──→ `c:\users\sw\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\1fc929f47d7c151c839c5fc1375929766fb8edcc\build.log`
┌ Info: Using the Python distribution in the Conda package by default.
└ To use a different Python version, set ENV["PYTHON"]="pythoncommand" and re-run Pkg.build("PyCall").
[ Info: Running `conda install -y numpy` in root environment
                                                       ERROR- ERROR/ InterruptException:LoadError: InterruptException:
Stacktrace:
  [1] poptask(W::Base.InvasiveLinkedListSynchronized{Task})
  1. Would the above function also generate the corresponding .jl file?

Besides the folder c:\users\fw\.julia\packages\OpticSim\gelEh\src\GlassCat\data\agf containing

ARCHER.agf
ARTON.agf
BIREFRINGENT.agf
CDGM.agf
CORNING.agf
HERAEUS.agf
HIKARI.agf
HOYA.agf
INFRARED.agf
ISUZU.agf
LIGHTPATH.agf
LZOS.agf
MISC.agf
NIKON.agf
OHARA.agf
RPO.agf
TOPAS.agf
UMICORE.agf
ZEON.agf

and there is also a folder c:\users\fw\julia\.julia\packages\OpticSim\gelEh\src\GlassCat\data\jl containing the corresponding .jl files.

AGFGlassCat.jl
ARCHER.jl
ARTON.jl
BIREFRINGENT.jl
CDGM.jl
CORNING.jl
HERAEUS.jl
HIKARI.jl
HOYA.jl
INFRARED.jl
ISUZU.jl
LIGHTPATH.jl
LZOS.jl
MISC.jl
NIKON.jl
OHARA.jl
OTHER.jl
RPO.jl
TOPAS.jl
UMICORE.jl
ZEON.jl

Expected behavior a step-by-step installation example in the documentation would really help beginners. thanks.

Screenshots The main https://github.com/microsoft/OpticSim.jl#readme states

Warning: During installation OpticSim automatically downloads glass catalogs from a variety of public sources. The Schott website keeps moving their catalog on their website so our software can't find it to download. This caused all our examples to fail because they use Schott glasses. We have replaced the glasses in the examples with hard coded glass files so all examples now work (if they don't file an issue).

If you want to use Schott glasses you will have to manually download and install the Schott catalog.

BUT https://microsoft.github.io/OpticSim.jl/stable/glasscat/ states

The central configuration file for GlassCat is located at src/GlassCat/data/sources.txt, which ships with the following default entries.

NIKON a49714470fa875ad4fd8d11cbc0edbf1adfe877f42926d7612c1649dd9441e75 https://www.nikon.com/products/components/assets/pdf/nikon_zemax_data.zip
OHARA 0c9021bf11b8d4e660012191818685ad3110d4f9490699cabdc89aae1fd26d2e https://www.oharacorp.com/xls/OHARA_201130_CATALOG.zip
HOYA b02c203e5a5b7a8918cc786badf0a9db1fe2572372c1c163dc306b0a8a908854 http://www.hoya-opticalworld.com/common/agf/HOYA20210105.agf
SCHOTT e9aabbb8ebff116ba0c106a71afd86e72f2a397ac9bc447469129e325e795f4e https://www.schott.com/d/advanced_optics/6959f9a4-0e4f-4ef2-a302-2347468a82f5/1.31/schott-optical-glass-overview-zemax-format.zip
SUMITA c1093e42a1d08acbe30698aba730161e3b43f8f0d50533f65de8b6b11100fdc8 https://www.sumita-opt.co.jp/en/wp/wp-content/themes/sumita-opt-en/download-files.php files%5B%5D=new_sumita.agf&category=data

Desktop (please complete the following information):

  • OS: win 10
  • Julia version 1.7.3
  • OpticSim.jl version 0.6.0

Additional context Add any other context about the problem here.

fortunewalla avatar Jul 05 '22 04:07 fortunewalla

#411 Solves this SHA256 for SCHOTT was outdated in sources.txt Change it from e9aabbb8ebff116ba0c106a71afd86e72f2a397ac9bc447469129e325e795f4e to a7bd8d5fb301efffb54a0eedd5652cbdb96c51b8918c7be9b9448d0da9c19bd4

Then run julia> import Pkg; Pkg.build()

fduple avatar Aug 29 '22 15:08 fduple