Skip to content

Commit

Permalink
Merge pull request #33 from lsst-ts/tickets/DM-36670
Browse files Browse the repository at this point in the history
Tickets/dm36670: Added the AT and ComCam Calibration test reports
  • Loading branch information
rbovill committed Feb 3, 2023
2 parents 10dfeea + 8749a4a commit 4459353
Show file tree
Hide file tree
Showing 21 changed files with 334 additions and 65 deletions.
2 changes: 1 addition & 1 deletion AuxTel/NightOps/Verify_LATISS_Acq_Take_Sequence.robot
Expand Up @@ -163,7 +163,7 @@ Set Variables
Set Suite Variable ${seq_length} 3
Set Suite Variable ${num_images} 3
Set Suite Variable @{exp_time} ${5.0} ${5.0} ${5.0}
Set Suite Variable @{filter_band} i r r
Set Suite Variable @{filter_band} r r r
Set Suite Variable ${filter_name} "SDSSr"
Set Suite Variable @{disperser_band} R90 R90 R90
Set Suite Variable @{disperser_name} ronchi90lpmm ronchi90lpmm ronchi90lpmm
Expand Down
110 changes: 110 additions & 0 deletions AuxTel/Verify_AT_Flat_Calibrations.robot
@@ -0,0 +1,110 @@
*** Settings ***
Resource ../Global_Vars.resource
Resource ../CSC_Lists.resource
Resource ../Common_Keywords.resource
Library QueryEfd ${SALVersion} ${XMLVersion} ${OSPLVersion}
Library Collections
Force Tags at_calibrations
Suite Setup Set Variables

*** Variables ***
${time_window} 10

*** Test Cases ***
Get Script Metadata
[Tags]
Common_Keywords.Get Script Metadata

Verify Runtime
[Tags] runtime DM-37818
Verify Script Runtime ${script_start} ${script_end}

Verify ATCamera Playlist Loaded
[Tags]
Log ${playlist_full_name}
${dataframe}= Get Recent Samples ATCamera command_play ["*",] 1 None
Should Be Equal ${dataframe.playlist.values}[0] ${playlist_full_name}

Verify ATPtg Target
[Documentation] Ensure the telescope is pointed at the correct target, in this case at the Az/El of the flat-field screen.
... This command is sent prior to the start of the script.
[Tags] robot:continue-on-failure
${cmd_dataframe}= Get Recent Samples ATPtg command_raDecTarget ["targetName", "ra", "declination",] 1 None
Should Be Equal ${cmd_dataframe.targetName.values}[0] Flatfield position
${evt_dataframe}= Get Recent Samples ATPtg logevent_currentTarget ["targetName", "azDegs", "elDegs",] 1 None
Should Be Equal ${evt_dataframe.targetName.values}[0] FlatField position
Should Be Equal ${evt_dataframe.azDegs.values.round(6)}[0] ${0}
Should Be Equal ${evt_dataframe.elDegs.values.round(6)}[0] ${0}

Verify ATPtg Tracking is Off
[Tags]
${evt_df}= Get Recent Samples ATPtg logevent_trackPosting ["status"] 1 None
Should Not Be True ${evt_df.status.values}[0]
Verify Time Delta ATPtg command_stopTracking logevent_trackPosting ${time_window}

Verify ATSpectrograph Filter
Verify Topic Attribute ATSpectrograph logevent_reportedFilterPosition ["name",] ${filter_name} output=json
${evt_df}= Get Recent Samples ATSpectrograph logevent_reportedFilterPosition ["*",] 1 None
Should Be Equal ${evt_df.name.values}[0] ${filter_name}

Verify ATCamera Image Sequence
[Documentation] Verify the ATCamera images are the correct type, with the correct exposure time.
[Tags] robot:continue-on-failure
${cmd_df}= Get Recent Samples ATCamera command_takeImages ["expTime", "keyValueMap", "numImages", "shutter",] ${num_images} None
${evt_df}= Get Recent Samples ATCamera logevent_startIntegration ["additionalValues", "exposureTime", "imageName"] ${num_images} None
Set Suite Variable @{image_names} ${evt_df.imageName.values}
Log Many ${image_names}
Verify Sequence ATCamera command_takeImages expTime ${num_images} ${exp_time}
Verify Sequence ATCamera logevent_startIntegration exposureTime ${num_images} ${exp_time}
FOR ${i} IN RANGE ${num_images}
${evt_image_type}= Fetch From Left ${evt_df.additionalValues.values}[${i}] :
Should Be Equal As Strings ${evt_image_type} ${img_type_seq}[${i}]
${image_type_str}= Fetch From Left ${cmd_df.keyValueMap.values}[${i}] ,
${cmd_image_type}= Fetch From Right ${image_type_str} :${SPACE}
Should Be Equal As Strings ${cmd_image_type} ${img_type_seq}[${i}]
Should Be Equal As Numbers ${cmd_df.numImages.values}[${i}] 1
END

Verify ATOODS ImageInOODS
[Tags] robot:continue-on-failure
${total_images}= Evaluate ${num_images} * 1
Set Suite Variable ${total_images}
${dataframe}= Get Recent Samples ATOODS logevent_imageInOODS ["camera", "description", "obsid",] ${total_images} None
FOR ${i} IN RANGE ${num_images}
Should Be Equal As Strings ${dataframe.camera.values}[${i}] LATISS
Should Be Equal As Strings ${dataframe.description.values}[${i}] file ingested
Should Be Equal As Strings ${dataframe.obsid.values}[${i}] ${image_names}[0][${i}]
END

Verify ATHeaderService LargeFileObjectAvailable
[Tags] robot:continue-on-failure
${dataframe}= Get Recent Samples ATHeaderService logevent_largeFileObjectAvailable ["id", "url",] ${total_images} None
FOR ${i} IN RANGE ${num_images}
Should Be Equal As Strings ${dataframe.id.values}[${i}] ${image_names}[0][${i}]
${file_name}= Catenate SEPARATOR= ATHeaderService_header_ ${image_names}[0][${i}] .yaml
Should Be Equal As Strings ${dataframe.url[${i}].split("/")[-1]} ${file_name}
END

*** Keywords ***
Set Variables
[Documentation] The sequence length is defined by the number of exposures, num_images.
... The img_type_seq is defined by the sequence of image types, in reverse order (dataframes are in time-descending order).
Set Suite Variable ${playlist_full_name} bias_dark_flat.playlist
# Image type.
Set Suite Variable ${num_images} 30 # 10 Bias + 10 Dark + 10 Flat
@{n_flat}= Evaluate ["FLAT"] * 10
@{n_dark}= Evaluate ["DARK"] * 10
@{n_bias}= Evaluate ["BIAS"] * 10
@{img_type_seq}= Create List @{n_flat} @{n_dark} @{n_bias}
Set Suite Variable @{img_type_seq}
# Exposure time: BIAS images have 0 for the exposure time.
@{bias_exp_time}= Evaluate [${0}] * 10
@{dark_exp_time}= Evaluate [${10}] * 10
@{flat_exp_time}= Evaluate [${2}] * 10
@{exp_time}= Create List @{bias_exp_time} @{dark_exp_time} @{flat_exp_time}
Set Suite Variable @{exp_time}
# Filter and band.
Set Suite Variable ${filter_type} r
Set Suite Variable @{filter_name} SDSSr_65mm
Set Suite Variable @{disperser_band} EMPTY
Set Suite Variable @{disperser_name} EMPTY
107 changes: 107 additions & 0 deletions AuxTel/Verify_AT_PTC_Calibrations.robot
@@ -0,0 +1,107 @@
*** Settings ***
Resource ../Global_Vars.resource
Resource ../CSC_Lists.resource
Resource ../Common_Keywords.resource
Library QueryEfd ${SALVersion} ${XMLVersion} ${OSPLVersion}
Library Collections
Force Tags at_calibrations
Suite Setup Set Variables

*** Variables ***
${time_window} 10

*** Test Cases ***
Get Script Metadata
[Tags]
Common_Keywords.Get Script Metadata

Verify Runtime
[Tags] runtime DM-37818
Verify Script Runtime ${script_start} ${script_end}

Verify ATCamera Playlist Loaded
[Tags]
Log ${playlist_full_name}
${dataframe}= Get Recent Samples ATCamera command_play ["*",] 1 None
Should Be Equal ${dataframe.playlist.values}[0] ${playlist_full_name}

Verify ATPtg Target
[Documentation] Ensure the telescope is pointed at the correct target, in this case at the Az/El of the flat-field screen.
... This command is sent prior to the start of the script.
[Tags] robot:continue-on-failure
${evt_dataframe}= Get Recent Samples ATPtg logevent_currentTarget ["targetName", "azDegs", "elDegs",] 1 None
Should Be Equal ${evt_dataframe.targetName.values}[0] FlatField position
Should Be Equal ${evt_dataframe.azDegs.values.round(6)}[0] ${0}
Should Be Equal ${evt_dataframe.elDegs.values.round(6)}[0] ${0}

Verify ATPtg Tracking is Off
[Tags]
${evt_df}= Get Recent Samples ATPtg logevent_trackPosting ["status"] 1 None
Should Not Be True ${evt_df.status.values}[0]
Verify Time Delta ATPtg command_stopTracking logevent_trackPosting ${time_window}

Verify ATSpectrograph Filter
Verify Topic Attribute ATSpectrograph logevent_reportedFilterPosition ["name",] ${filter_name} output=json
#${evt_df}= Get Recent Samples ATSpectrograph logevent_reportedFilterPosition ["*",] 1 None
#Should Be Equal ${evt_df.name.values}[0] ${filter_name}

Verify ATCamera Image Sequence
[Documentation] Verify the ATCamera images are the correct type, with the correct exposure time.
[Tags] robot:continue-on-failure
${cmd_df}= Get Recent Samples ATCamera command_takeImages ["expTime", "keyValueMap", "numImages", "shutter",] ${num_images} None
${evt_df}= Get Recent Samples ATCamera logevent_startIntegration ["additionalValues", "exposureTime", "imageName"] ${num_images} None
Set Suite Variable @{image_names} ${evt_df.imageName.values}
Log Many ${image_names}
Verify Sequence ATCamera command_takeImages expTime ${num_images} ${exp_time}
Verify Sequence ATCamera logevent_startIntegration exposureTime ${num_images} ${exp_time}
FOR ${i} IN RANGE ${num_images}
${evt_image_type}= Fetch From Left ${evt_df.additionalValues.values}[${i}] :
Should Be Equal As Strings ${evt_image_type} ${img_type_seq}[${i}]
${image_type_str}= Fetch From Left ${cmd_df.keyValueMap.values}[${i}] ,
${cmd_image_type}= Fetch From Right ${image_type_str} :${SPACE}
Should Be Equal As Strings ${cmd_image_type} ${img_type_seq}[${i}]
Should Be Equal As Numbers ${cmd_df.numImages.values}[${i}] 1
END

Verify ATOODS ImageInOODS
[Tags] robot:continue-on-failure
${total_images}= Evaluate ${num_images} * 1
Set Suite Variable ${total_images}
${dataframe}= Get Recent Samples ATOODS logevent_imageInOODS ["camera", "description", "obsid",] ${total_images} None
FOR ${i} IN RANGE ${num_images}
Should Be Equal As Strings ${dataframe.camera.values}[${i}] LATISS
Should Be Equal As Strings ${dataframe.description.values}[${i}] file ingested
Should Be Equal As Strings ${dataframe.obsid.values}[${i}] ${image_names}[0][${i}]
END

Verify ATHeaderService LargeFileObjectAvailable
[Tags] robot:continue-on-failure
${dataframe}= Get Recent Samples ATHeaderService logevent_largeFileObjectAvailable ["id", "url",] ${total_images} None
FOR ${i} IN RANGE ${num_images}
Should Be Equal As Strings ${dataframe.id.values}[${i}] ${image_names}[0][${i}]
${file_name}= Catenate SEPARATOR= ATHeaderService_header_ ${image_names}[0][${i}] .yaml
Should Be Equal As Strings ${dataframe.url[${i}].split("/")[-1]} ${file_name}
END

*** Keywords ***
Set Variables
[Documentation] The sequence length is defined by the number of exposures, num_images.
... The img_type_seq is defined by the sequence of image types, in reverse order (dataframes are in time-descending order).
Set Suite Variable ${playlist_full_name} bias_dark_ptc.playlist
# Image type.
Set Suite Variable ${num_images} 60 # 10 Bias + 10 Dark + 40 Flat
@{n_flat}= Evaluate ["FLAT"] * 10
@{n_dark}= Evaluate ["DARK"] * 10
@{n_bias}= Evaluate ["BIAS"] * 40
@{img_type_seq}= Create List @{n_flat} @{n_dark} @{n_bias}
Set Suite Variable @{img_type_seq}
# Exposure time; BIAS images have 0 for the exposure time.
@{bias_exp_time}= Evaluate [${0}] * 10
@{dark_exp_time}= Evaluate [${10}] * 10
@{exp_time}= Create List @{bias_exp_time} @{dark_exp_time} ${0.2} ${0.2} ${0.4} ${0.4} ${0.6} ${0.6} ${0.8} ${0.8} ${1.0} ${1.0} ${1.2} ${1.2} ${1.4} ${1.4} ${1.6} ${1.6} ${1.8} ${1.8} ${2.0} ${2.0} ${2.2} ${2.2} ${2.4} ${2.4} ${2.6} ${2.6} ${2.8} ${2.8} ${3.0} ${3.0} ${3.2} ${3.2} ${3.4} ${3.4} ${3.6} ${3.6} ${3.8} ${3.8} ${4.0} ${4.0}
Set Suite Variable @{exp_time}
# Filter and band.
Set Suite Variable ${filter_type} r
Set Suite Variable @{filter_name} SDSSr_65mm
Set Suite Variable @{disperser_band} EMPTY
Set Suite Variable @{disperser_name} EMPTY
2 changes: 1 addition & 1 deletion AuxTel/Verify_AT_Prepare_Flat.robot
Expand Up @@ -65,7 +65,7 @@ Verify ATMCS Tracking Disabled
Verify ATMCS m3State
[Tags]
${dataframe}= Get Recent Samples ATMCS logevent_m3State ["*",] 1 None
Should Be Equal As Integers ${dataframe.state.values}[0] 6 #NASMYTH1
Should Be Equal As Integers ${dataframe.state.values}[0] 7 #NASMYTH2

Verify ATPneumatics m1CoverState
[Tags]
Expand Down
46 changes: 25 additions & 21 deletions ComCam/Verify_ComCam_Calibrations.robot
Expand Up @@ -48,19 +48,15 @@ Verify CCCamera Filter
Should Be Equal ${evt_df.filterName.values}[0] ${filter_name}
Should Be Equal ${evt_df.filterType.values}[0] ${filter_type}

# OCPS command_execute and logevent_job_result ?



Verify CCCamera Image Sequence
[Documentation] Verify the CCCamera images are the correct type, with the correct exposure time.
[Tags] robot:continue-on-failure
${cmd_df}= Get Recent Samples CCCamera command_takeImages ["expTime", "keyValueMap", "numImages", "shutter",] ${num_images} None
${evt_df}= Get Recent Samples CCCamera logevent_startIntegration ["additionalValues", "exposureTime", "imageName"] ${num_images} None
Set Suite Variable @{image_names} ${evt_df.imageName.values}
Log Many ${image_names}
Verify Sequence CCCamera command_takeImages expTime ${seq_length} ${exp_time}
Verify Sequence CCCamera logevent_startIntegration exposureTime ${seq_length} ${exp_time}
Verify Sequence CCCamera command_takeImages expTime ${num_images} ${exp_time}
Verify Sequence CCCamera logevent_startIntegration exposureTime ${num_images} ${exp_time}
FOR ${i} IN RANGE ${num_images}
${evt_image_type}= Fetch From Left ${evt_df.additionalValues.values}[${i}] :
Should Be Equal As Strings ${evt_image_type} ${img_type_seq}[${i}]
Expand All @@ -69,46 +65,54 @@ Verify CCCamera Image Sequence
Should Be Equal As Strings ${cmd_image_type} ${img_type_seq}[${i}]
Should Be Equal As Numbers ${cmd_df.numImages.values}[${i}] 1
END
#imageType (BIAS x10, DARK x10 and FLAT x10)

Verify CCOODS ImageInOODS
[Tags] robot:continue-on-failure
${total_images}= Evaluate ${num_images} * 9 # ComCam has 9 CCDs, so there are 9 times the images.
Set Suite Variable ${total_images}
${dataframe}= Get Recent Samples CCOODS logevent_imageInOODS ["camera", "description", "obsid",] ${total_images} None
Log ${image_names}
Log ${dataframe.obsid.values}
FOR ${i} IN RANGE ${num_images}
FOR ${j} IN RANGE ${9} # ComCam has 9 CCDs, so there are 9 times the images.
${k}= Evaluate ${i} * 9 + ${j}
Should Be Equal As Strings ${dataframe.camera.values}[${k}] LSSTComCam
Should Be Equal As Strings ${dataframe.description.values}[${k}] file ingested
Should Be Equal As Strings ${dataframe.obsid.values}[${k}] ${image_names}[0][${j}]
Should Be Equal As Strings ${dataframe.obsid.values}[${k}] ${image_names}[0][${i}]
END
END

Verify CCHeaderService LargeFileObjectAvailable
[Tags] robot:continue-on-failure
${dataframe}= Get Recent Samples CCHeaderService logevent_largeFileObjectAvailable ["id", "url",] ${total_images} None
Log ${image_names}
Log ${dataframe.id.values}
FOR ${i} IN RANGE ${num_images}
FOR ${j} IN RANGE ${9} # ComCam has 9 CCDs, so there are 9 times the images.
${k}= Evaluate ${i} * 9 + ${j}
Should Be Equal As Strings ${dataframe.id.values}[${k}] ${image_names}[0][${j}]
${file_name}= Catenate SEPARATOR= CCHeaderService_header_ ${image_names}[0][${j}] .yaml
Should Be Equal As Strings ${dataframe.url[${k}].split("/")[-1]} ${file_name}
END
Should Be Equal As Strings ${dataframe.id.values}[${i}] ${image_names}[0][${i}]
${file_name}= Catenate SEPARATOR= CCHeaderService_header_ ${image_names}[0][${i}] .yaml
Should Be Equal As Strings ${dataframe.url[${i}].split("/")[-1]} ${file_name}
END

*** Keywords ***
Set Variables
[Documentation] The seq_length is defined by the number of exposures.
... The num_images is the sum of the sequence and some number of do_acquire iterations.
[Documentation] The sequence length is defined by the number of exposures, num_images.
... The img_type_seq is defined by the sequence of image types, in reverse order (dataframes are in time-descending order).
Set Suite Variable ${playlist_full_name} bias_dark_flat.playlist
Set Suite Variable ${num_images} 10 # 10 Bias + 10 Dark + 10 Flat
Set Suite Variable ${seq_length} 10
# BIAS images have 0 for the exposure time.
Set Suite Variable @{exp_time} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0}
# Image type.
Set Suite Variable ${num_images} 30 # 10 Bias + 10 Dark + 10 Flat
@{n_flat}= Evaluate ["FLAT"] * 10
@{n_dark}= Evaluate ["DARK"] * 10
@{n_bias}= Evaluate ["BIAS"] * 10
@{img_type_seq}= Create List @{n_flat} @{n_dark} @{n_bias}
Set Suite Variable @{img_type_seq}
# Exposure time; BIAS images have 0 for the exposure time.
@{bias_exp_time}= Evaluate [${0}] * 10
@{dark_exp_time}= Evaluate [${20}] * 10
@{flat_exp_time}= Evaluate [${5}] * 10
@{exp_time}= Create List @{bias_exp_time} @{dark_exp_time} @{flat_exp_time}
Set Suite Variable @{exp_time}
# Filter and band.
Set Suite Variable ${filter_type} r
Set Suite Variable ${filter_name} r_03
Set Suite Variable @{disperser_band} EMPTY
Set Suite Variable @{disperser_name} EMPTY
Set Suite Variable @{img_type_seq} BIAS BIAS BIAS BIAS BIAS BIAS BIAS BIAS BIAS BIAS

0 comments on commit 4459353

Please sign in to comment.