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

BUG: Verify dynamic pressure code #23

Open
KCollins opened this issue May 28, 2024 · 4 comments
Open

BUG: Verify dynamic pressure code #23

KCollins opened this issue May 28, 2024 · 4 comments
Milestone

Comments

@KCollins
Copy link
Owner

Validate dynamic pressure calculations.

should be:
inst_val - inst_val/(min_before + min_after)

@KCollins
Copy link
Owner Author

KCollins commented Jul 3, 2024

Relevant code snippet - got this from Xueling:

            mom_vars = pyspedas.mms.mom(probe=[spacecraft_id.lower()], trange=[start.timestamp(), end.timestamp()],
            # mom_vars = pyspedas.mms.mom(probe=[spacecraft_id.lower()], trange=[epoch.timestamp()-5*60, epoch.timestamp()+5*60],
                                   notplot=True,no_update=False,time_clip=True)



            thx_density = mom_vars['th'+spacecraft_id.lower()+'_peem_density']
            thx_density_time = thx_density['x']
            thx_density_data = thx_density['y']

            #calculate dynamic pressure
            thx_peim_velocity = mom_vars['th'+spacecraft_id.lower()+'_peim_velocity_gse']
            thx_velocity_data = thx_peim_velocity['y']

            thx_velocity_Vx = thx_velocity_data[:,0]
            thx_velocity_Vy = thx_velocity_data[:,1]
            thx_velocity_Vz = thx_velocity_data[:,2]

            print("Computing dynamic pressure for event ", event, " out of ", len(mms_events), ".")
            thx_pdy = thx_density_data*(thx_velocity_Vx**2+thx_velocity_Vy**2+thx_velocity_Vz**2)*1.67*(10**(-6))*0.5 # should return nPa

            dyp = thx_pdy[~pd.isnull(thx_pdy)] # dynamic pressure vector without NaNs

            mms_events.loc[epoch, 'Dynamic Pressure (nPa)'] = dyp.max()
            mms_events.loc[epoch, 'Electron density'] = thx_density_data[np.argmax(dyp)]        
            mms_events.loc[epoch, 'Vx'] = thx_velocity_Vx[np.argmax(dyp)]
            mms_events.loc[epoch, 'Vy'] = thx_velocity_Vy[np.argmax(dyp)]
            mms_events.loc[epoch, 'Vz'] = thx_velocity_Vz[np.argmax(dyp)]

@KCollins
Copy link
Owner Author

KCollins commented Jul 3, 2024

THEMIS computations: https://doi.org/10.5281/zenodo.10531587

@KCollins
Copy link
Owner Author

KCollins commented Jul 3, 2024

Sanity check: Dynamic pressure should be on the order of 1-10 nPa, but could peak much higher - 100 might be reasonable. Review survey plots with Mike to confirm that the resulting estimates are in the right ballpark. Check Wang paper, Hietala, etc. as well for points of comparison.

@KCollins
Copy link
Owner Author

KCollins commented Jul 3, 2024

Reference: Try comparing to Fig 2 of https://angeo.copernicus.org/articles/38/287/2020/#&gid=1&pid=1

@KCollins KCollins added this to the v0.1.5 milestone Sep 27, 2024
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