finish Combine.py

This commit is contained in:
2024-07-04 17:08:28 +02:00
parent cb62d15cb2
commit a6edf1c1b9
5 changed files with 134 additions and 29 deletions

View File

@@ -144,7 +144,7 @@ def save_Stokes(
header["INSTRUME"] = (header_stokes["instrume"] if "INSTRUME" in list(header_stokes.keys()) else "FOC", "identifier for instrument used to acuire data")
header["PHOTPLAM"] = (header_stokes["photplam"], "Pivot Wavelength")
header["PHOTFLAM"] = (header_stokes["photflam"], "Inverse Sensitivity in DN/sec/cm**2/Angst")
header["EXPTOT"] = (exp_tot, "Total exposure time in sec")
header["EXPTIME"] = (exp_tot, "Total exposure time in sec")
header["PROPOSID"] = (header_stokes["proposid"], "PEP proposal identifier for observation")
header["TARGNAME"] = (header_stokes["targname"], "Target name")
header["ORIENTAT"] = (np.arccos(new_wcs.wcs.pc[0, 0]) * 180.0 / np.pi, "Angle between North and the y-axis of the image")

View File

@@ -3225,7 +3225,7 @@ if __name__ == "__main__":
"-sc", "--scale-vec", metavar="scale_vec", required=False, help="Size of the 100% polarization vector in pixel units", type=float, default=3.0
)
parser.add_argument("-pa", "--pang-err", action="store_true", required=False, help="Whether the polarization angle uncertainties should be displayed")
parser.add_argument("-l", "--lim", metavar="flux_lim", nargs=2, required=False, help="Limits for the intensity map", default=None)
parser.add_argument("-l", "--lim", metavar="flux_lim", nargs=2, required=False, help="Limits for the intensity map", type=float, default=None)
parser.add_argument("-pdf", "--static-pdf", metavar="static_pdf", required=False, help="Whether the analysis tool or the static pdfs should be outputed", default=None)
args = parser.parse_args()

View File

@@ -797,8 +797,8 @@ def align_data(data_array, headers, error_array=None, data_mask=None, background
if do_shift:
shift, error, _ = phase_cross_correlation(ref_data / ref_data.max(), image / image.max(), upsample_factor=upsample_factor)
else:
shift = globals["pol_shift"][headers[i]["filtnam1"].lower()]
error = globals["sigma_shift"][headers[i]["filtnam1"].lower()]
shift = globals()["pol_shift"][headers[i]["filtnam1"].lower()]
error = globals()["sigma_shift"][headers[i]["filtnam1"].lower()]
# Rescale image to requested output
rescaled_image[i, res_shift[0] : res_shift[0] + shape[1], res_shift[1] : res_shift[1] + shape[2]] = deepcopy(image)
rescaled_error[i, res_shift[0] : res_shift[0] + shape[1], res_shift[1] : res_shift[1] + shape[2]] = deepcopy(error_array[i])