Skip to content

Commit

Permalink
write out vcorr info
Browse files Browse the repository at this point in the history
  • Loading branch information
palumbom committed Mar 26, 2024
1 parent 4a6b20d commit 749a7a2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
7 changes: 6 additions & 1 deletion scripts/merge_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def main():
fname2 = datadir + "region_output.csv"

# headers for output files
header1 = ["mjd", "aia_thresh", "a_aia", "b_aia", "c_aia", "hmi_thresh1", "hmi_thresh2", "a_hmi", "b_hmi", "c_hmi"]
header1 = ["mjd", "aia_thresh", "a_aia", "b_aia", "c_aia",
"hmi_thresh1", "hmi_thresh2", "a_hmi", "b_hmi", "c_hmi",
"vel_cbs_off",
"min_vel_sat", "max_vel_sat", "avg_vel_sat",
"min_vel_rot", "max_vel_rot", "avg_vel_rot",
"min_vel_mer", "max_vel_mer", "avg_vel_mer"]
header2 = ["mjd", "region", "lo_mu", "hi_mu", "pixel_frac", "light_frac", "v_hat", "v_phot", "v_quiet", "v_conv", "mag_unsigned", "avg_int", "avg_int_flat"]

# delete old files if they exists
Expand Down
1 change: 1 addition & 0 deletions sdo_clv_pipeline/sdo_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def mask_low_mu(self, mu_thresh):

def correct_magnetogram(self):
assert self.is_magnetogram()
self.B_obs = self.image.copy()
self.image /= self.mu
return None

Expand Down
7 changes: 6 additions & 1 deletion sdo_clv_pipeline/sdo_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ def organize_IO(indir, datadir=None, clobber=False, globexp=""):
fname2 = datadir + "region_output.csv"

# headers for output files
header1 = ["mjd", "aia_thresh", "a_aia", "b_aia", "c_aia", "hmi_thresh1", "hmi_thresh2", "a_hmi", "b_hmi", "c_hmi"]
header1 = ["mjd", "aia_thresh", "a_aia", "b_aia", "c_aia",
"hmi_thresh1", "hmi_thresh2", "a_hmi", "b_hmi", "c_hmi",
"vel_cbs_off",
"min_vel_sat", "max_vel_sat", "avg_vel_sat",
"min_vel_rot", "max_vel_rot", "avg_vel_rot",
"min_vel_mer", "max_vel_mer", "avg_vel_mer"]
header2 = ["mjd", "region", "lo_mu", "hi_mu", "pixel_frac", "light_frac", "v_hat", "v_phot", "v_quiet", "v_conv", "mag_unsigned", "avg_int", "avg_int_flat"]

# replace/create/modify output files
Expand Down
8 changes: 6 additions & 2 deletions sdo_clv_pipeline/sdo_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,13 @@ def process_data_set(con_file, mag_file, dop_file, aia_file,
# get the MJD of the obs
mjd = Time(con.date_obs).mjd

# write the limb darkening parameters and pixel fractions to disk
# write the limb darkening parameters, velocities, etc. to disk
write_results_to_file(fname1, mjd, mask.aia_thresh, *aia.ld_coeffs,
mask.con_thresh1, mask.con_thresh2, *con.ld_coeffs)
mask.con_thresh1, mask.con_thresh2, *con.ld_coeffs,
np.nanmax(dop.v_cbs),
np.nanmin(dop.v_obs), np.nanmax(dop.v_obs), np.nanmean(dop.v_obs),
np.nanmin(dop.v_rot), np.nanmax(dop.v_rot), np.nanmean(dop.v_rot),
np.nanmin(dop.v_mer), np.nanmax(dop.v_mer), np.nanmean(dop.v_mer))

# create arrays to hold velocity magnetic fiel, and pixel fraction results
results = []
Expand Down
2 changes: 1 addition & 1 deletion sdo_clv_pipeline/sdo_vels.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def calc_mag_stats(con, mag, region_mask=True):
return 0.0, 0.0, 0.0

# get intensity weighted unsigned magnetic field strength
mag_unsigned = np.nansum(np.abs(mag.image) * con.image * region_mask)
mag_unsigned = np.nansum(np.abs(mag.B_obs) * con.image * region_mask)

# divide by the denominator
mag_unsigned /= np.nansum(con.image * region_mask)
Expand Down

0 comments on commit 749a7a2

Please sign in to comment.