<jupyter_start><jupyter_text>`status_flag` looks interesting - what does it map to?<jupyter_code>print(dumps({int(k):v for k,v in zip(ds['status_flag'].attrs['flag_values'], ds['status_flag'].attrs['flag_meanings'].split(' '))}, indent=2))<jupyter_output>{
  "0": "missing_input_data",
  "1": "over_land",
  "2": "no_ice",
  "3": "close_to_coast_or_edge",
  "4": "summer_period",
  "10": "processing_failed",
  "11": "too_low_correlation",
  "12": "not_enough_neighbours",
  "13": "filtered_by_neighbours",
  "20": "smaller_pattern",
  "21": "corrected_by_neighbours",
  "22": "interpolated",
  "30": "nominal_quality"
}<jupyter_text>what's the grid?<jupyter_code>ds.Polar_Stereographic_Grid.attrs['proj4_string']
# we can approximate the above grid for our figure
crs = ccrs.Stereographic(
    central_latitude=90,
    central_longitude=-45,
    true_scale_latitude=70, 
    globe=ccrs.Globe(
        ellipse=None,
        semimajor_axis=6378273, 
        semiminor_axis=6356889.44891),
)
print(f"'{crs.proj4_init}'")
# remember to convert xc/yc to meters (stored as km)
u = ds['dX'].isel(time=0).assign_coords(coords={'xc': ds['xc'] * 1000, 'yc': ds['yc'] * 1000})
v = ds['dY'].isel(time=0).assign_coords(coords={'xc': ds['xc'] * 1000, 'yc': ds['yc'] * 1000})
uncertainty = ds['uncert_dX_and_dY'].isel(time=0).assign_coords(coords={'xc': ds['xc'] * 1000, 'yc': ds['yc'] * 1000})
fig, (data_ax, uncert_ax) = plt.subplots(figsize=(22,9), ncols=2, sharex=True, sharey=True, subplot_kw={'projection': crs})
data_ax.set_extent([-3.5e6, 3.5e6, -3.5e6, 3.5e6], crs=crs)
data_ax.coastlines(zorder=3)
data_ax.add_feature(cfeature.LAND.with_scale('110m'), facecolor='lightgrey', zorder=2)
xr.plot.pcolormesh((u ** 2 + v ** 2) ** 0.5, zorder=2, ax=data_ax, cmap='cividis')
data_ax.set_title('Ice Displacement (km)\n%s - %s' % (ds.attrs['start_date'], ds.attrs['stop_date']))
uncert_ax.coastlines(zorder=3)
uncert_ax.add_feature(cfeature.LAND.with_scale('110m'), facecolor='lightgrey', zorder=2)
xr.plot.pcolormesh(uncertainty, zorder=2, vmin=0, vmax=15, ax=uncert_ax, cmap='viridis')
uncert_ax.set_title('Uncertainity ($\sigma$)\n%s - %s' % (ds.attrs['start_date'], ds.attrs['stop_date']));<jupyter_output><empty_output><jupyter_text>above, as histograms<jupyter_code>fig, (data_ax, uncert_ax) = plt.subplots(figsize=(22,9), ncols=2, subplot_kw={'ylabel': 'Frequency'})
xr.plot.hist((u ** 2 + v ** 2) ** 0.5, ax=data_ax, bins=100)
data_ax.set_title(None)
data_ax.set_xlim(left=0)
data_ax.set_xlabel('Ice Displacement (km)')
xr.plot.hist(uncertainty, ax=uncert_ax, bins=100)
uncert_ax.set_xlabel('Uncertainty ($\sigma$)')
uncert_ax.set_xlim(left=0)
uncert_ax.set_title(None);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19962894248608534, 'fraction_numerical': 0.04712430426716141, 'mean_word_length': 7.269938650306749, 'pattern_counts': {'":': 13, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '385629', 'license': 'MIT', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1142, 'n_words': 166, 'path': 'notebooks/osisaf_lr_eda.ipynb', 'repo_name': 'm9brady/notebooks', 'size': '2695'}