Last active
April 1, 2021 11:31
-
-
Save robertjwilson/058e8e3ec985150641b9ecf9ee9341a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nctoolkit as nc | |
ds = nc.open_data("IASI_METOPA_L2_CO_20190921_ULB-LATMOS_V6.4.0.nc") | |
ds.assign(mask = lambda x: x.longitude > 0 and x.longitude < 180 and x.latitude > 77 and x.latitude < 80, drop = True) | |
# ds.set_missing(0) | |
time_steps = list(ds.to_dataframe().reset_index().reset_index(drop = True).query("mask == 1").index) | |
time_steps = [x for x in time_steps] | |
ds.select(time = time_steps) | |
ds.to_nc("cropped.nc") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment