demisjohn / ASML_JobCreator

Generate ASCII Job files for an ASML PAS 5500 Stepper Lithography system, by the UCSB Nanofabrication Facility.
16 stars 4 forks source link

Enable Predefined Images #4

Closed demisjohn closed 4 years ago

demisjohn commented 4 years ago

predefined images (in separate module sub-folder, imported into Images namespace?)

Eg.

ImagePF=MyJob.Images.MarkClearout - pre-defined image for this ImagePM=MyJob.Images.PrimaryMark/SPM_X/SPM_Y- pre-defined image for this ImagePM=MyJob.Images.UCSB_Res/ResOPC/MA6/EBLpos+neg/GCA

Envision a sub-folder, eg. ASML_JobCreator/Images/ with separate files for each predefined Image. ASML_JobCreator/Images/__init__.py would import each file in the folder into the Images namespace.

Each file could be like this: Images/UCSB_Res.py

ImageID = "UCSB_Res" ReticleID = "UCSB-OPC1" ImageSize = [5, 5] ImageShift = [-3, 4]

demisjohn commented 4 years ago

How to import all files in a subfolder, in attached file.

import os # file path manipulations import glob # file-name matching

the following directs init to import (add to all) all the files within it's directory that match *.py

all = [ os.path.basename(f)[:-3] for f in glob.glob( os.path.dirname(file) + "/*.py" ) ]

demisjohn commented 4 years ago

(from here: http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python )

demisjohn commented 4 years ago

Initial implementation in: 070b87965d9a3b3f8a76125b4b09cc2dc12d4d2d Used these hints:

Usage is a bit ugly, because it doesn't get added directly to the Job like a normal Image would.

Example usage:

import ASML_JobCreator.Images as Images
PM = Images.PM.get_Image()
MyJob.add_Images( PM ) 
PM.distribute( cellCR=[4,4], shiftXY=[2.00, 2.00] )
PM.distribute( cellCR=[4,4], shiftXY=[-2.00, -2.00] )
PM.distribute( cellCR=[4,4], shiftXY=[-2.00, 2.00] )
PM.distribute( cellCR=[4,4], shiftXY=[2.00, -2.00] )

Would like instead to use like so:

MyJob.add_Images( asml.Images.PM ) 
PM.distribute( cellCR=[4,4], shiftXY=[2.00, 2.00] )

This requires

  1. Images makes the Images objects inside the files *.py to be visible in it's namespace, and
  2. ASML_JobCreator's __init__.py makes Images available in it's namespace after importing.
demisjohn commented 4 years ago

Improved this in 2a0d3cc, new syntax is much simpler (same as regular Image def.):

SPM_X = MyJob.Image( asml.Images.SPM_X )

in Images/__init__.py, Used this hint: https://stackoverflow.com/a/11553818/2453202 and iterated through the file list and had to require that the user set the Image object's name the same as the file basename.