Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calibrate_visibility should use (0, 0) in HPC rather than in STIX coord so that phase center is center of Sun #139

Open
hayesla opened this issue Aug 27, 2024 · 1 comment

Comments

@hayesla
Copy link
Contributor

hayesla commented Aug 27, 2024

When calibrating visibilities with stixpy.calibrate.visibility.calibrate_visibility, the default flare_location coordinate should be the center of the Sun rather than 0, 0 in STIX coordinate frame, which is important for times when Solar Orbiter is offpointing.

For example,

with using the current default (where flare_location is default to STIXImaging(0 * u.arcsec, 0 * u.arcsec) see here.

cal_vis = calibrate_visibility(vis)

old_pointing

however, when usign this:

>>> center_map = SkyCoord(0*u.arcsec, 0*u.arcsec, frame=Helioprojective(observer=solo, obstime=solo.obstime))
>>> cal_vis = calibrate_visibility(vis, flare_location=center_map.transform_to(STIXImaging))

fixed_pointing

So I guess this should be the default to center the map on the Sun. Thoughts @samaloney

To reproduce

cpd_file = './pixel_data/solo_L1_stix-sci-xray-cpd_20210914T063019-20210914T065025_V02_2109140589-60826.fits'
time_range = ['2021-09-14T06:39:17', '2021-09-14T06:39:57']
energy_range = [4, 16]*u.keV

cpd_sci = Product(cpd_file)


meta_pixels_sci = create_meta_pixels(cpd_sci, 
                                     time_range=time_range, 
                                     energy_range=energy_range, 
                                     flare_location=[0, 0] * u.arcsec, 
                                     no_shadowing=True)

vis_tr = TimeRange(time_range)
roll, solo_xyz, pointing = get_hpc_info(vis_tr.start, vis_tr.end)
solo = HeliographicStonyhurst(*solo_xyz, obstime=vis_tr.center, representation_type="cartesian")

center_map = SkyCoord(0*u.arcsec, 0*u.arcsec, frame=Helioprojective(observer=solo, obstime=solo.obstime))

vis = create_visibility(meta_pixels_sci )
if old:
    cal_vis = calibrate_visibility(vis)
else:
    cal_vis = calibrate_visibility(vis, flare_location=center_map.transform_to(STIXImaging))
# order by sub-collimator e.g. 10a, 10b, 10c, 9a, 9b, 9c ....
isc_10_7 = [3, 20, 22, 16, 14, 32, 21, 26, 4, 24, 8, 28]
idx = np.argwhere(np.isin(cal_vis.meta["isc"], isc_10_7)).ravel()

vis10_7 = cal_vis[idx]
imsize = [512, 512] * u.pixel  # number of pixels of the map to reconstruct
pixel = [10, 10] * u.arcsec / u.pixel  # pixel size in arcsec

bp_image = vis_to_image(vis10_7, imsize, pixel_size=pixel)
@hayesla
Copy link
Contributor Author

hayesla commented Aug 27, 2024

also just to note that the IDL version matches the fixed flare_location
Screenshot 2024-08-27 at 11 00 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant