rayopt icon indicating copy to clipboard operation
rayopt copied to clipboard

Installing rii materials?

Open ckemere opened this issue 8 years ago • 8 comments

I have trouble running the example files because none of the materials appear to have installed when I ran setup.py. Any suggestions?

ckemere avatar Oct 02 '17 21:10 ckemere

The refractiveindex.info materials are installed. The unittested and the tutorial use them. For the zemax and Oslo data you'll have to follow the instructions. updates to them would be appreciated.

jordens avatar Oct 03 '17 07:10 jordens

Ping. Is this resolved?

jordens avatar Mar 15 '18 18:03 jordens

Hello, For my part I am using Mac OS so *.exe files will not work, correct? [get and install http://www.lambdares.com/images/OSLO/OSLO662_EDU_Installer.exe get and install http://downloads.radiantsourcemodels.com/Downloads/Zemax_2015-03-03_x32.exe]

Moreover when I try to access the files directly a browser, the files appear to be absent. Would it be possible to post the files somewhere else where they could be loaded from using any OS?

Thanks

AndyPhil avatar Mar 31 '18 21:03 AndyPhil

I don't.know whether Oslo and/or zemax are supported under osx. It would be great if you could determine the current location of the downloads of the eval versions for Oslo and Zemax and submit a pull request with the updated urls.

jordens avatar Mar 31 '18 22:03 jordens

It looks like Zemax has moved to an online demo for evaluation, so the download might not exist anymore. The rayopt.library import wants an agf file, and other sources for glass catalogs seem to work.

For example Edmund Optics has a glass cat with the materials in their lenses here: https://www.edmundoptics.com/globalassets/documents/2018glasshop.agf

The Schott catalog is here: https://www.schott.com/advanced_optics/english/download/index.html

gabeycas avatar Dec 13 '18 16:12 gabeycas

Hello, I have the same question. I'd like to use Thorlab's catalog which is downloadable as a .zmx file in a zip folder here: https://www.thorlabs.com/software_pages/ViewSoftwarePage.cfm?Code=Zemax Can someone please explain what commands are necessary to install this library? It looks like library.py and zemax.py can access .zmx file extensions but I'm not sure how to use them.

numbersofpi avatar Jun 05 '19 14:06 numbersofpi

I am still trying to learn this library as well and thus don't know how to set catalogs, yet. However, based on code in one of the examples notebooks I flushed it out a bit more in order to use the refractiveindex.info search that is build in the latest version of rayopt that I am using as of 20200426:

import rayopt as ro
import pandas as pd

def refractiveindex_search(name_contains, return_result='Df', result_to_use=0):
    """
    Args:
        name_contains (str): search quarry name to search for in refractiveindex.info for
        set_result (bool/str; 'Df'): when True return the name set by `result_to_use` to use, 
            when set to 'Df' will return a pandas Dataframe of results, 
            if False will print the Dataframe of results
        result_to_use (int; 0): wich of the results to return
    
    Returns:
        Will print a results of the colomnated df of results from the refractiveindex.info if `return_result` is `True`
        will return of pandas Df of results if `return_result` is set to 'Df'
    """
    results=pd.DataFrame(columns=['name', 'catalog_name', 'catalog_source'])
    
    lib = ro.Library.one()
    for i, g in enumerate(lib.session.query(
        ro.library.Material).filter(
        ro.library.Material.name.contains(name_contains))):
        
        results.loc[i]=[g.name, g.catalog.name, g.catalog.source]
    
    #just print results
    if return_result==False:
        print(results)
    #return results Df
    elif return_result=='Df':
        return results
    #return just the ithe name set by `result_to_use`
    elif return_result==True:
        return results.iloc[result_to_use]['name']

I am going to start updating in the exsample notebooks using this to change materials to calll the names from refractiveindex.info

GProtoZeroW avatar Apr 27 '20 03:04 GProtoZeroW

#31 provides fixes to allow Zemax import with their latest demo files.

mabl avatar May 29 '20 18:05 mabl