<jupyter_start><jupyter_text>Show locations of TAO arrays ingested in ECCOv4r4<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import xarray

import cartopy.crs as ccrs
import re
plt.style.use('thesis')<jupyter_output><empty_output><jupyter_text>Read from the csv file<jupyter_code>filename = 'MRB_CSV/tao_grep.txt'
read = {'Latitude': lambda line : float(line.split(',decimal')[0].split(' ')[-1]),
        'Longitude': lambda line : float(line.split(',decimal')[0].split(' ')[-1]),
        'Year': lambda line : int(line.split(',,,')[0].split(' ')[-1]),
        'Month': lambda line : int(line.split(',,,')[0].split(' ')[-1]),
        'Day': lambda line : int(line.split(',,,')[0].split(' ')[-1])
       }
tao = {key:[] for key in read.keys()}
with open(filename,'r') as f:
    for line in f:
        for key, readme in read.items():
            if key in line:
                tao[key].append(readme(line))<jupyter_output><empty_output><jupyter_text>Create date and sort<jupyter_code>tao['date'] = [np.datetime64(f'{Y}-{M:02d}-{D:02d}') for Y,M,D in zip(tao['Year'],tao['Month'],tao['Day'])]
tao_sorted = {}
for key in tao.keys():
    tao_sorted[key] = [x for _,x in sorted(zip(tao['date'],tao[key]))]<jupyter_output><empty_output><jupyter_text>Plot<jupyter_code>ticks = np.linspace(0,len(tao['date'])-1,5)
ticklabels = [tao_sorted['date'][int(tt)] for tt in ticks]
fig, ax = plt.subplots(constrained_layout=True,
                       subplot_kw={'projection':ccrs.Robinson(central_longitude=-180)})

ax.set_extent([-240, -60, -30, 30], crs=ccrs.PlateCarree())

mappable = ax.scatter(tao_sorted['Longitude'],tao_sorted['Latitude'], c=range(len(tao_sorted['date'])),
                      marker='.',
                      cmap='plasma',
                      transform=ccrs.PlateCarree())
ax.coastlines()
cbar = fig.colorbar(mappable,ticks=ticks, orientation='horizontal')
cbar.ax.set_xticklabels(ticklabels)

fig.savefig('../figures/tao_locations.jpg',bbox_inches='tight',dpi=300)
print(len(tao['date']))<jupyter_output>257954
{'fraction_non_alphanumeric': 0.19394235466536394, 'fraction_numerical': 0.02051783097215437, 'mean_word_length': 4.505376344086022, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '74474', 'license': 'MIT', 'n_tokens_mistral': 815, 'n_tokens_neox': 785, 'n_words': 127, 'path': 'insitu/read_tao_from_csv.ipynb', 'repo_name': 'timothyas/eccov4-euc', 'size': '2047'}