PhosimCmpt

class lsst.ts.phosim.PhosimCmpt(tele)

Bases: object

Methods Summary

accDofInUm(dofInUm)

Accumulate the aggregated degree of freedom (DOF) in um.

addOpdFieldXYbyDeg(fieldXInDegree, ...)

Add the OPD new field X, Y in degree.

analyzeComCamOpdData([zkFileName, ...])

Analyze the ComCam OPD data.

analyzeOpdData(instName[, zkFileName, ...])

Analyze the OPD data.

getComCamOpdArgsAndFilesForPhoSim([...])

Get the OPD calculation arguments and files of ComCam for the PhoSim calculation.

getComCamStarArgsAndFilesForPhoSim(...[, ...])

Get the star calculation arguments and files of ComCam for the PhoSim calculation.

getDofInUm()

Get the accumulated degree of freedom (DOF) in um.

getExtraFocalDirName()

Get the extra-focal directory name.

getIntraFocalDirName()

Get the intra-focal directory name.

getListOfFwhmSensorData(pssnFileName, ...)

Get the list of FWHM sensor data based on the OPD PSSN file.

getM1M3ForceError()

Get the M1M3 force error.

getNumOfZk()

Get the number of Zk (annular Zernike polynomial).

getOpdArgsAndFilesForPhoSim(instName[, ...])

Get the OPD calculation arguments and files for the PhoSim calculation.

getOpdGqEffFwhmFromFile(pssnFileName)

Get the OPD GQ effective FWHM from file.

getOpdMetr()

Get the OPD metrology object.

getOpdPssnFromFile(pssnFileName)

Get the OPD PSSN from file.

getOutputDir()

Get the output directory.

getOutputImgDir()

Get the output image directory.

getPistonCamStarArgsAndFilesForPhoSim(...[, ...])

Get the star calculation arguments and files of piston camera ( ComCam or LSST FAM) for the PhoSim calculation.

getSeedNum()

Get the seed number for the M1M3 random surface purturbation.

getSettingFile()

Get the setting file.

getStarArgsAndFilesForPhoSim(skySim[, ...])

Get the star calculation arguments and files for the PhoSim calculation.

getTele()

Get the telescope object.

getWfsDirName()

Get the WFS directory name.

getWfsStarArgsAndFilesForPhoSim(obsId, skySim)

Get the star calculation arguments and files for the wavefront sensors for the PhoSim calculation.

mapOpdDataToListOfWfErr(opdZkFileName, ...)

Map the OPD data to the list of wavefront error.

reorderAndSaveWfErrFile(listOfWfErr, ...[, ...])

Reorder the wavefront error in the wavefront error list according to the reference sensor name list and save to a file.

repackageComCamAmpImgFromPhoSim()

Repackage the ComCam amplifier images from PhoSim to the single 16 extension MEFs for processing.

repackageComCamEimgFromPhoSim()

Repackage the ComCam eimages from PhoSim for processing.

repackagePistonCamImgs(instName[, isEimg])

Repackage the images of piston camera (ComCam and LSST FAM) from PhoSim for processing.

repackageWfsCamImgs(instName[, isEimg])

Repackage the images from in focus camera for processing.

runPhoSim(argString)

Run the PhoSim program.

saveDofInUmFileForNextIter(dofInUm[, ...])

Save the DOF in um data to file for the next iteration.

setDofInUm(dofInUm)

Set the accumulated degree of freedom (DOF) in um.

setM1M3ForceError(m1m3ForceError)

Set the M1M3 force error.

setOutputDir(outputDir)

Set the output directory.

setOutputImgDir(outputImgDir)

Set the output image directory.

setSeedNum(seedNum)

Set the seed number for the M1M3 mirror surface purturbation.

setSurveyParam([obsId, filterType, ...])

Set the survey parameters.

Methods Documentation

accDofInUm(dofInUm)

Accumulate the aggregated degree of freedom (DOF) in um.

idx 0-4: M2 dz, dx, dy, rx, ry idx 5-9: Cam dz, dx, dy, rx, ry idx 10-29: M1M3 20 bending modes idx 30-49: M2 20 bending modes

Parameters:
dofInUmlist or numpy.ndarray

DOF in um.

addOpdFieldXYbyDeg(fieldXInDegree, fieldYInDegree)

Add the OPD new field X, Y in degree.

OPD: optical path difference.

Parameters:
fieldXInDegreefloat, list, or numpy.ndarray

New field X in degree.

fieldYInDegreefloat, list, or numpy.ndarray

New field Y in degree.

analyzeComCamOpdData(zkFileName='opd.zer', rotOpdInDeg=0.0, pssnFileName='PSSN.txt')

Analyze the ComCam OPD data.

Rotate OPD to simulate the output by rotated camera. When anaylzing the PSSN, the unrotated OPD is used.

ComCam: Commissioning camera. OPD: Optical path difference. PSSN: Normalized point source sensitivity.

Parameters:
zkFileNamestr, optional

OPD in zk file name. (the default is “opd.zer”.)

rotOpdInDegfloat, optional

Rotate OPD in degree in the counter-clockwise direction. (the default is 0.0.)

pssnFileNamestr, optional

PSSN file name. (the default is “PSSN.txt”.)

analyzeOpdData(instName, zkFileName='opd.zer', rotOpdInDeg=0.0, pssnFileName='PSSN.txt')

Analyze the OPD data.

Rotate OPD to simulate the output by rotated camera. When anaylzing the PSSN, the unrotated OPD is used.

OPD: Optical path difference. PSSN: Normalized point source sensitivity.

Parameters:
instNamestr

Instrument name.

zkFileNamestr, optional

OPD in zk file name. (the default is “opd.zer”.)

rotOpdInDegfloat, optional

Rotate OPD in degree in the counter-clockwise direction. (the default is 0.0.)

pssnFileNamestr, optional

PSSN file name. (the default is “PSSN.txt”.)

getComCamOpdArgsAndFilesForPhoSim(cmdFileName='opd.cmd', instFileName='opd.inst', logFileName='opdPhoSim.log', cmdSettingFileName='opdDefault.cmd', instSettingFileName='opdDefault.inst')

Get the OPD calculation arguments and files of ComCam for the PhoSim calculation.

OPD: optical path difference. ComCam: commissioning camera.

Parameters:
cmdFileNamestr, optional

Physical command file name. (the default is “opd.cmd”.)

instFileNamestr, optional

OPD instance file name. (the default is “opd.inst”.)

logFileNamestr, optional

Log file name. (the default is “opdPhoSim.log”.)

cmdSettingFileNamestr, optional

Physical command setting file name. (the default is “opdDefault.cmd”.)

instSettingFileNamestr, optional

Instance setting file name. (the default is “opdDefault.inst”.)

Returns:
str

Arguments to run the PhoSim.

getComCamStarArgsAndFilesForPhoSim(extraObsId, intraObsId, skySim, simSeed=1000, cmdSettingFileName='starDefault.cmd', instSettingFileName='starSingleExp.inst')

Get the star calculation arguments and files of ComCam for the PhoSim calculation.

Parameters:
extraObsIdint

Extra-focal observation Id.

intraObsIdint

Intra-focal observation Id.

skySimSkySim

Sky simulator

simSeedint, optional

Random number seed. (the default is 1000.)

cmdSettingFileNamestr, optional

Physical command setting file name. (the default is “starDefault.cmd”.)

instSettingFileNamestr, optional

Instance setting file name. (the default is “starSingleExp.inst”.)

Returns:
list[str]

List of arguments to run the PhoSim.

getDofInUm()

Get the accumulated degree of freedom (DOF) in um.

idx 0-4: M2 dz, dx, dy, rx, ry idx 5-9: Cam dz, dx, dy, rx, ry idx 10-29: M1M3 20 bending modes idx 30-49: M2 20 bending modes

Returns:
numpy.ndarray

DOF in um.

getExtraFocalDirName()

Get the extra-focal directory name.

Returns:
str

Extra-focal directory name.

getIntraFocalDirName()

Get the intra-focal directory name.

Returns:
str

Intra-focal directory name.

getListOfFwhmSensorData(pssnFileName, sensorIdList)

Get the list of FWHM sensor data based on the OPD PSSN file.

FWHM: Full width at half maximum. OPD: Optical path difference. PSSN: Normalized point source sensitivity.

Parameters:
pssnFileNamestr

PSSN file name.

sensorIdListlist

Reference sensor id list.

Returns:
fwhmCollectionnp.ndarray [object]

Numpy array with fwhm data. This is a numpy array of arrays. The data type is object because each element may have different number of elements.

sensor_id: np.ndarray

Numpy array with sensor ids.

getM1M3ForceError()

Get the M1M3 force error.

Returns:
float

Ratio of actuator force error.

getNumOfZk()

Get the number of Zk (annular Zernike polynomial).

Returns:
int

Number of Zk.

getOpdArgsAndFilesForPhoSim(instName, cmdFileName='opd.cmd', instFileName='opd.inst', logFileName='opdPhoSim.log', cmdSettingFileName='opdDefault.cmd', instSettingFileName='opdDefault.inst')

Get the OPD calculation arguments and files for the PhoSim calculation.

OPD: optical path difference.

Parameters:
instNamestr

Instrument name.

cmdFileNamestr, optional

Physical command file name. (the default is “opd.cmd”.)

instFileNamestr, optional

OPD instance file name. (the default is “opd.inst”.)

logFileNamestr, optional

Log file name. (the default is “opdPhoSim.log”.)

cmdSettingFileNamestr, optional

Physical command setting file name. (the default is “opdDefault.cmd”.)

instSettingFileNamestr, optional

Instance setting file name. (the default is “opdDefault.inst”.)

Returns:
str

Arguments to run the PhoSim.

getOpdGqEffFwhmFromFile(pssnFileName)

Get the OPD GQ effective FWHM from file.

OPD: Optical path difference. GQ: Gaussian quadrature. FWHM: Full width at half maximum. PSSN: Normalized point source sensitivity.

Parameters:
pssnFileNamestr

PSSN file name.

Returns:
float

OPD GQ effective FWHM.

getOpdMetr()

Get the OPD metrology object.

OPD: optical path difference.

Returns:
OpdMetrology

OPD metrology object.

getOpdPssnFromFile(pssnFileName)

Get the OPD PSSN from file.

OPD: Optical path difference. PSSN: Normalized point source sensitivity.

Parameters:
pssnFileNamestr

PSSN file name.

Returns:
numpy.ndarray

PSSN.

getOutputDir()

Get the output directory.

Returns:
str

Output directory.

getOutputImgDir()

Get the output image directory.

Returns:
str

Output image directory

getPistonCamStarArgsAndFilesForPhoSim(extraObsId, intraObsId, skySim, simSeed=1000, cmdSettingFileName='starDefault.cmd', instSettingFileName='starSingleExp.inst')

Get the star calculation arguments and files of piston camera ( ComCam or LSST FAM) for the PhoSim calculation.

FAM: Full-array mode.

Parameters:
extraObsIdint

Extra-focal observation Id.

intraObsIdint

Intra-focal observation Id.

skySimSkySim

Sky simulator

simSeedint, optional

Random number seed. (the default is 1000.)

cmdSettingFileNamestr, optional

Physical command setting file name. (the default is “starDefault.cmd”.)

instSettingFileNamestr, optional

Instance setting file name. (the default is “starSingleExp.inst”.)

Returns:
list[str]

List of arguments to run the PhoSim.

getSeedNum()

Get the seed number for the M1M3 random surface purturbation.

Returns:
int or None

Seed number. None means there is no random purturbation.

getSettingFile()

Get the setting file.

Returns:
lsst.ts.wep.paramReader

Setting file.

getStarArgsAndFilesForPhoSim(skySim, cmdFileName='star.cmd', instFileName='star.inst', logFileName='starPhoSim.log', simSeed=1000, cmdSettingFileName='starDefault.cmd', instSettingFileName='starSingleExp.inst')

Get the star calculation arguments and files for the PhoSim calculation.

Parameters:
skySimSkySim

Sky simulator

cmdFileNamestr, optional

Physical command file name. (the default is “star.cmd”.)

instFileNamestr, optional

Star instance file name. (the default is “star.inst”.)

logFileNamestr, optional

Log file name. (the default is “starPhoSim.log”.)

simSeedint, optional

Random number seed. (the default is 1000)

cmdSettingFileNamestr, optional

Physical command setting file name. (the default is “starDefault.cmd”.)

instSettingFileNamestr, optional

Instance setting file name. (the default is “starSingleExp.inst”.)

Returns:
str

Arguments to run the PhoSim.

getTele()

Get the telescope object.

Returns:
TeleFacade

Telescope object.

getWfsDirName()

Get the WFS directory name.

Returns:
str

WFS directory name.

getWfsStarArgsAndFilesForPhoSim(obsId, skySim, simSeed=1000, cmdSettingFileName='starDefault.cmd', instSettingFileName='starSingleExp.inst')

Get the star calculation arguments and files for the wavefront sensors for the PhoSim calculation.

Parameters:
obsIdint

Observation Id.

skySimSkySim

Sky simulator

simSeedint, optional

Random number seed. (the default is 1000.)

cmdSettingFileNamestr, optional

Physical command setting file name. (the default is “starDefault.cmd”.)

instSettingFileNamestr, optional

Instance setting file name. (the default is “starSingleExp.inst”.)

Returns:
str

Arguments to run the PhoSim.

mapOpdDataToListOfWfErr(opdZkFileName, sensorIdList, sensorNameList)

Map the OPD data to the list of wavefront error.

OPD: Optical path difference.

Parameters:
opdZkFileNamestr

OPD zk file name.

sensorIdListlist

Reference sensor ID list.

sensorNameListlist

Reference sensor name list.

Returns:
list [lsst.ts.wep.ctrlIntf.SensorWavefrontError]

List of SensorWavefrontError object.

reorderAndSaveWfErrFile(listOfWfErr, refSensorNameList, lsstCamera, zkFileName='wfs.zer')

Reorder the wavefront error in the wavefront error list according to the reference sensor name list and save to a file.

The unexisted wavefront error will be a numpy zero array. The unit is um.

Parameters:
listOfWfErrlist [lsst.ts.wep.ctrlIntf.SensorWavefrontData]

List of SensorWavefrontData object.

refSensorNameListlist

Reference sensor name list.

lsstCameralsst.afw.cameraGeom.Camera

Lsst instrument.

zkFileNamestr, optional

Wavefront error file name. (the default is “wfs.zer”.)

repackageComCamAmpImgFromPhoSim()

Repackage the ComCam amplifier images from PhoSim to the single 16 extension MEFs for processing.

ComCam: commissioning camera. MEF: multi-extension frames.

repackageComCamEimgFromPhoSim()

Repackage the ComCam eimages from PhoSim for processing.

ComCam: commissioning camera.

repackagePistonCamImgs(instName, isEimg=False)

Repackage the images of piston camera (ComCam and LSST FAM) from PhoSim for processing.

FAM: Full-array mode.

Parameters:
instNamestr

Instrument name.

isEimgbool, optional

Is eimage or not. (the default is False.)

repackageWfsCamImgs(instName, isEimg=False)

Repackage the images from in focus camera for processing.

Parameters:
instNamestr

Instrument name.

isEimgbool, optional

Is eimage or not. (the default is False.)

runPhoSim(argString)

Run the PhoSim program.

Parameters:
argStringstr

Arguments for PhoSim.

saveDofInUmFileForNextIter(dofInUm, dofInUmFileName='dofPertInNextIter.mat')

Save the DOF in um data to file for the next iteration.

DOF: degree of freedom.

Parameters:
dofInUmlist or numpy.ndarray

DOF in um.

dofInUmFileNamestr, optional

File name to save the DOF in um. (the default is “dofPertInNextIter.mat”.)

setDofInUm(dofInUm)

Set the accumulated degree of freedom (DOF) in um.

idx 0-4: M2 dz, dx, dy, rx, ry idx 5-9: Cam dz, dx, dy, rx, ry idx 10-29: M1M3 20 bending modes idx 30-49: M2 20 bending modes

Parameters:
dofInUmlist or numpy.ndarray

DOF in um.

setM1M3ForceError(m1m3ForceError)

Set the M1M3 force error.

Parameters:
m1m3ForceErrorfloat

Ratio of actuator force error between 0 and 1.

setOutputDir(outputDir)

Set the output directory.

The output directory will be constructed if there is no existed one.

Parameters:
outputDirstr

Output directory.

setOutputImgDir(outputImgDir)

Set the output image directory.

The output image directory will be constructed if there is no existed one.

Parameters:
outputImgDirstr

Output image directory

setSeedNum(seedNum)

Set the seed number for the M1M3 mirror surface purturbation.

Parameters:
seedNumint

Seed number.

setSurveyParam(obsId=None, filterType=None, boresight=None, zAngleInDeg=None, rotAngInDeg=None)

Set the survey parameters.

Parameters:
obsIdint, optional

Observation Id. (the default is None.)

filterTypeenum ‘FilterType’ in lsst.ts.wep.utils, optional

Active filter type. (the default is None.)

boresighttuple, optional

Telescope boresight in (ra, decl). (the default is None.)

zAngleInDegfloat, optional

Zenith angle in degree. (the default is None.)

rotAngInDegfloat, optional

Camera rotation angle in degree between -90 and 90 degrees. (the default is None.)