obsids = [1342205092, 1342192680, 1342192681, 1342205055, 1342192697, 1342192698, 1342205054, 1342192699, 1342205050, 1342205049, # cscans 1342198565, 1342198566, 1342198590, 1342198591, 1342198863] calTree = getCalTree(obs=getObservation(obsids[0], useHsa=True, instrument="PACS")) for camera in ["red", "blue"]: for obsid in obsids: # Load the frames from the archive obs = getObservation(obsid, useHsa=True, instrument="PACS") level1 = PacsContext(obs.level1) scans = level1.averaged.getCamera(camera).product.selectAll() # Create some of the masks scans = scanamorphosRemoveTurnarounds(scans, limit=50.0) scans = scanamorphosMaskLongTermGlitches(scans, stepAfter=20, galactic=True, calTree=calTree) scans = scanamorphosBaselinePreprocessing(scans) # Save the frames into disk if(camera == "blue"): if(scans.meta["blue"].value == "blue2"): cameraName = "green" else: cameraName = "blue" else: cameraName = "red" outputFitsFile = dataDir + "smc" + str(obsid) + "-" + cameraName + ".fits" FitsArchive().save(outputFitsFile, scans)