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

Filtering out first time step #57

Closed
Ashwitaa opened this issue Mar 1, 2021 · 7 comments
Closed

Filtering out first time step #57

Ashwitaa opened this issue Mar 1, 2021 · 7 comments

Comments

@Ashwitaa
Copy link

Ashwitaa commented Mar 1, 2021

Hello Antoine,
Could you please suggest to me, what could be the best possible way to discard (filter) eddies/tracks existing in the first time step of the analysis period?

@AntSimi
Copy link
Owner

AntSimi commented Mar 1, 2021

You could use EddySubSetter tool to create a new atlas with only track which start after first day and ended before last day.

EddySubSetter \
    --period {First day + 1 in julian day(day from 1950/1/1)} {Last day - 1 in julian day(day from 1950/1/1)} \
    --full_path {atlas} {new_atlas}

You must replace all value between '{}'.
full_path option will allow to keep only track which are fully in specified period.

You could do same things in python with your values

from py_eddy_tracker.observations.tracking import TrackEddiesObservations
c = TrackEddiesObservations.load_file("Cyclonic.nc")
c_subset = c.extract_with_period(
    (20000,25000),
    full_path=True)
c_subset.write_file(filename='my_dataset.nc')

You could found examples in gallery
and more information about API could be found here for TrackEddiesObservations

@Ashwitaa
Copy link
Author

Ashwitaa commented Mar 2, 2021

Thank you :)

@Ashwitaa Ashwitaa closed this as completed Mar 2, 2021
@Ashwitaa Ashwitaa reopened this Mar 9, 2021
@Ashwitaa
Copy link
Author

Ashwitaa commented Mar 9, 2021

Could you please tell me what full_path exactly do?

@AntSimi
Copy link
Owner

AntSimi commented Mar 9, 2021

'full_path' option will return the whole track even if only one part are selected by criterion API doc.
So it was not the good option for you, correct option is 'remove_incomplete', :( sorry.
All trajectory which have outside observations of your period will be fully removed.
Antoine

@Ashwitaa
Copy link
Author

Ashwitaa commented Mar 9, 2021

full_path = False,
works as well for the filtering the files!

do you recommend to use 'full_path=false' or should I just go for 'remove_incomplete'?

@AntSimi
Copy link
Owner

AntSimi commented Mar 10, 2021

Hi,
With the last message, i am not sure i understood original question.
I understood you would remove all track where you don't know if there are really born at first date or really dead(and not just stopped) at last date.
So my advice was to select all data between first_date + 1 and last_date -1 and remove with remove_incomplete=True option all the track which are partially selected with date filtering.

Note:
full_path=False is default value

@Ashwitaa
Copy link
Author

okay.
Thanks :)

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