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

add bandwidth options #36

Closed
jkingslake opened this issue Oct 30, 2023 · 3 comments
Closed

add bandwidth options #36

jkingslake opened this issue Oct 30, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jkingslake
Copy link
Member

jkingslake commented Oct 30, 2023

Irena's suggest was to have options for the start and stop frequency to use when computing the fft. This could look something like:

import xapres_package as xa
ds = xa.load.generate_xarray(directory='../../data/sample/single_dat_file/', 
             start_freq = [300e6, 400e6], 
             stop_freq = [500e6])

and this would do all the processing twice, once with start_freq = 200e6 and once with start_freq = 400e6. There would then be another dimension in the resulting xarray: start_freq.

If yo ualso provide multiple stop_freq's it could do every combination of start_freq and stop_freq.

cc @glugeorge

@jkingslake jkingslake added the enhancement New feature or request label Nov 9, 2023
@jkingslake
Copy link
Member Author

as a starting point though we could just allow start_freq and stop_freq to be adjustable parameters.

@glugeorge glugeorge self-assigned this Sep 6, 2024
@jkingslake
Copy link
Member Author

this should be possible using the new custom fft options that were added in #51 and a script I wrote for a different project (here), which allows you to loop over different parameter values and save the results in an xarray.

This wont result in a change to the code, I dont think, but I could add a notebook demonstrating it.

@jkingslake
Copy link
Member Author

This works nicely.

You can download the script from github gist with a little package I found called getgist and then run the processing with

## load data
def load_zarr(f):
    return xr.open_dataset(f, engine = 'zarr', chunks = {})
LTG = load_zarr('/Users/jkingslake/Documents/science/ApRES/TG_apres/notebooks/zarrs/LTG_stacked.zarr').load()

## calculate velocities etc. 
dLTG = LTG.profile_stacked.displacement_timeseries().compute()

## get grid search function
!pip install getgist
!getgist jkingslake xarray_grid_search.py

## apply grid search function and plot
xgs.gridSearch(LTG.profile_stacked.displacement_timeseries, lower_limit_on_fit=[800, 1000, 1200, 1400]).strain_rate.plot(hue='lower_limit_on_fit')

cc @glugeorge, I wonder if this would be useful to you?

xgs.gridSearch(LTG.profile_stacked.displacement_timeseries, lower_limit_on_fit=[800, 1000, 1200, 1400])

outputs an xarray with a new dimension corresponding to the parameter you varied, in this case lower_limit_on_fit:
image

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

No branches or pull requests

2 participants