quartiq / rayopt

Python optics and lens design, raytracing
GNU Lesser General Public License v3.0
260 stars 50 forks source link

Installing rii materials? #19

Open ckemere opened 7 years ago

ckemere commented 7 years ago

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

jordens commented 7 years ago

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 commented 6 years ago

Ping. Is this resolved?

AndyPhil commented 6 years ago

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

jordens commented 6 years ago

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.

gabeycas commented 5 years ago

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

numbersofpi commented 5 years ago

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.

GProtoZeroW commented 4 years ago

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

mabl commented 4 years ago

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