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

Downsampling frequencies #15

Open
SashaAivaz opened this issue Feb 7, 2024 · 2 comments
Open

Downsampling frequencies #15

SashaAivaz opened this issue Feb 7, 2024 · 2 comments
Assignees

Comments

@SashaAivaz
Copy link

I have a MT collection that has no survey id and to downsample frequencies, I needed to add the survey id because the keys for MT collection are survey_id.station_id and having '0' for survey id meant no string and problem. I got this error:
image
I have used this code to downsample and add the id:

# with MTCollection() as mc:
     mc.open_collection(r"C:\Users\aivazpourporgous\Documents\MT\CCA\Inversion\CCA_0\edi\lin0_resampled_frequency.h5")
     for filename in edifiles:
        mt_object = MT()
        mt_object.read(filename)
        #mt_object.survey = "downsampled"
        new_frequency = np.logspace(-3, 3, 20)
        new_mt_obj = mt_object.interpolate(new_frequency, f_type="frequency")
        new_mt_obj.survey = "downsampled"
        mc.add_tf(new_mt_obj)
#
#

Now I have two entities for each station one unknown survey id and one downsampled. I added the id to the original mt_object before making new_mt_obj but result is same.
image

@kujaku11 kujaku11 self-assigned this Feb 9, 2024
@kujaku11
Copy link
Contributor

kujaku11 commented Feb 9, 2024

@SashaAivaz Try again, I just fixed a bug in MTCollection.add_tf.

I updated the add_tf to have arguments add_tf(tf_object, new_survey='new_survey_name', tf_id_extra='interpolated'

The tf_id_extra will add this onto the end of the tf_id which is the transfer function id, usually the same as the station. If your station and tf_id are "mt01" then if you set tf_id_extra the new tf_id will be "mt01_tf_id_extra", helps organize transfer functions.

But now you should be able to set the survey for your original data and your downsampled data.

@SashaAivaz
Copy link
Author

@kujaku11 I did installed the updates but it seems it doesn't like any argument for add_tf It gives same error for tf_id_extra.
Untitled

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

2 participants