import numpy as np
import matplotlib.pyplot as plt
import netCDF4 as nc
%matplotlib inline
with nc.Dataset('/data/eolson/MEOPAR/NEMO-forcing-new/grid/mesh_mask201702.nc') as mesh:
tmask=mesh.variables['tmask'][:,:,:,:]
!ls /data/sallen/results/MEOPAR/202007/202007D-nociliates
myncra.sh myncra.sh~ SalishSea_1d_20150101_20150105_grid_T_20150101-20150101.nc SalishSea_1d_20150101_20150105_grid_T_20150102-20150102.nc SalishSea_1d_20150101_20150105_grid_T_20150103-20150103.nc SalishSea_1d_20150101_20150105_grid_T_20150104-20150104.nc SalishSea_1d_20150101_20150105_grid_T_20150105-20150105.nc SalishSea_1d_20150101_20150105_ptrc_T_20150101-20150101.nc SalishSea_1d_20150101_20150105_ptrc_T_20150102-20150102.nc SalishSea_1d_20150101_20150105_ptrc_T_20150103-20150103.nc SalishSea_1d_20150101_20150105_ptrc_T_20150104-20150104.nc SalishSea_1d_20150101_20150105_ptrc_T_20150105-20150105.nc SalishSea_1d_20150106_20150110_grid_T_20150106-20150106.nc SalishSea_1d_20150106_20150110_grid_T_20150107-20150107.nc SalishSea_1d_20150106_20150110_grid_T_20150108-20150108.nc SalishSea_1d_20150106_20150110_grid_T_20150109-20150109.nc SalishSea_1d_20150106_20150110_grid_T_20150110-20150110.nc SalishSea_1d_20150106_20150110_ptrc_T_20150106-20150106.nc SalishSea_1d_20150106_20150110_ptrc_T_20150107-20150107.nc SalishSea_1d_20150106_20150110_ptrc_T_20150108-20150108.nc SalishSea_1d_20150106_20150110_ptrc_T_20150109-20150109.nc SalishSea_1d_20150106_20150110_ptrc_T_20150110-20150110.nc SalishSea_1d_20150111_20150115_grid_T_20150111-20150111.nc SalishSea_1d_20150111_20150115_grid_T_20150112-20150112.nc SalishSea_1d_20150111_20150115_grid_T_20150113-20150113.nc SalishSea_1d_20150111_20150115_grid_T_20150114-20150114.nc SalishSea_1d_20150111_20150115_grid_T_20150115-20150115.nc SalishSea_1d_20150111_20150115_ptrc_T_20150111-20150111.nc SalishSea_1d_20150111_20150115_ptrc_T_20150112-20150112.nc SalishSea_1d_20150111_20150115_ptrc_T_20150113-20150113.nc SalishSea_1d_20150111_20150115_ptrc_T_20150114-20150114.nc SalishSea_1d_20150111_20150115_ptrc_T_20150115-20150115.nc SalishSea_1d_20150116_20150120_grid_T_20150116-20150116.nc SalishSea_1d_20150116_20150120_grid_T_20150117-20150117.nc SalishSea_1d_20150116_20150120_grid_T_20150118-20150118.nc SalishSea_1d_20150116_20150120_grid_T_20150119-20150119.nc SalishSea_1d_20150116_20150120_grid_T_20150120-20150120.nc SalishSea_1d_20150116_20150120_ptrc_T_20150116-20150116.nc SalishSea_1d_20150116_20150120_ptrc_T_20150117-20150117.nc SalishSea_1d_20150116_20150120_ptrc_T_20150118-20150118.nc SalishSea_1d_20150116_20150120_ptrc_T_20150119-20150119.nc SalishSea_1d_20150116_20150120_ptrc_T_20150120-20150120.nc SalishSea_1d_20150121_20150125_grid_T_20150121-20150121.nc SalishSea_1d_20150121_20150125_grid_T_20150122-20150122.nc SalishSea_1d_20150121_20150125_grid_T_20150123-20150123.nc SalishSea_1d_20150121_20150125_grid_T_20150124-20150124.nc SalishSea_1d_20150121_20150125_grid_T_20150125-20150125.nc SalishSea_1d_20150121_20150125_ptrc_T_20150121-20150121.nc SalishSea_1d_20150121_20150125_ptrc_T_20150122-20150122.nc SalishSea_1d_20150121_20150125_ptrc_T_20150123-20150123.nc SalishSea_1d_20150121_20150125_ptrc_T_20150124-20150124.nc SalishSea_1d_20150121_20150125_ptrc_T_20150125-20150125.nc SalishSea_1d_20150126_20150131_grid_T_20150126-20150126.nc SalishSea_1d_20150126_20150131_grid_T_20150127-20150127.nc SalishSea_1d_20150126_20150131_grid_T_20150128-20150128.nc SalishSea_1d_20150126_20150131_grid_T_20150129-20150129.nc SalishSea_1d_20150126_20150131_grid_T_20150130-20150130.nc SalishSea_1d_20150126_20150131_grid_T_20150131-20150131.nc SalishSea_1d_20150126_20150131_ptrc_T_20150126-20150126.nc SalishSea_1d_20150126_20150131_ptrc_T_20150127-20150127.nc SalishSea_1d_20150126_20150131_ptrc_T_20150128-20150128.nc SalishSea_1d_20150126_20150131_ptrc_T_20150129-20150129.nc SalishSea_1d_20150126_20150131_ptrc_T_20150130-20150130.nc SalishSea_1d_20150126_20150131_ptrc_T_20150131-20150131.nc SalishSea_1d_20150201_20150205_ptrc_T_20150201-20150201.nc SalishSea_1d_20150201_20150205_ptrc_T_20150202-20150202.nc SalishSea_1d_20150201_20150205_ptrc_T_20150203-20150203.nc SalishSea_1d_20150201_20150205_ptrc_T_20150204-20150204.nc SalishSea_1d_20150201_20150205_ptrc_T_20150205-20150205.nc SalishSea_1d_20150206_20150210_ptrc_T_20150206-20150206.nc SalishSea_1d_20150206_20150210_ptrc_T_20150207-20150207.nc SalishSea_1d_20150206_20150210_ptrc_T_20150208-20150208.nc SalishSea_1d_20150206_20150210_ptrc_T_20150209-20150209.nc SalishSea_1d_20150206_20150210_ptrc_T_20150210-20150210.nc SalishSea_1d_20150211_20150215_ptrc_T_20150211-20150211.nc SalishSea_1d_20150211_20150215_ptrc_T_20150212-20150212.nc SalishSea_1d_20150211_20150215_ptrc_T_20150213-20150213.nc SalishSea_1d_20150211_20150215_ptrc_T_20150214-20150214.nc SalishSea_1d_20150211_20150215_ptrc_T_20150215-20150215.nc SalishSea_1d_20150216_20150220_ptrc_T_20150216-20150216.nc SalishSea_1d_20150216_20150220_ptrc_T_20150217-20150217.nc SalishSea_1d_20150216_20150220_ptrc_T_20150218-20150218.nc SalishSea_1d_20150216_20150220_ptrc_T_20150219-20150219.nc SalishSea_1d_20150216_20150220_ptrc_T_20150220-20150220.nc SalishSea_1d_20150221_20150225_ptrc_T_20150221-20150221.nc SalishSea_1d_20150221_20150225_ptrc_T_20150222-20150222.nc SalishSea_1d_20150221_20150225_ptrc_T_20150223-20150223.nc SalishSea_1d_20150221_20150225_ptrc_T_20150224-20150224.nc SalishSea_1d_20150221_20150225_ptrc_T_20150225-20150225.nc SalishSea_1d_20150226_20150228_ptrc_T_20150226-20150226.nc SalishSea_1d_20150226_20150228_ptrc_T_20150227-20150227.nc SalishSea_1d_20150226_20150228_ptrc_T_20150228-20150228.nc SalishSea_1d_20150301_20150305_ptrc_T_20150301-20150301.nc SalishSea_1d_20150301_20150305_ptrc_T_20150302-20150302.nc SalishSea_1d_20150301_20150305_ptrc_T_20150303-20150303.nc SalishSea_1d_20150301_20150305_ptrc_T_20150304-20150304.nc SalishSea_1d_20150301_20150305_ptrc_T_20150305-20150305.nc SalishSea_1d_20150306_20150310_ptrc_T_20150306-20150306.nc SalishSea_1d_20150306_20150310_ptrc_T_20150307-20150307.nc SalishSea_1d_20150306_20150310_ptrc_T_20150308-20150308.nc SalishSea_1d_20150306_20150310_ptrc_T_20150309-20150309.nc SalishSea_1d_20150306_20150310_ptrc_T_20150310-20150310.nc SalishSea_1d_20150311_20150315_ptrc_T_20150311-20150311.nc SalishSea_1d_20150311_20150315_ptrc_T_20150312-20150312.nc SalishSea_1d_20150311_20150315_ptrc_T_20150313-20150313.nc SalishSea_1d_20150311_20150315_ptrc_T_20150314-20150314.nc SalishSea_1d_20150311_20150315_ptrc_T_20150315-20150315.nc SalishSea_1d_20150316_20150320_ptrc_T_20150316-20150316.nc SalishSea_1d_20150316_20150320_ptrc_T_20150317-20150317.nc SalishSea_1d_20150316_20150320_ptrc_T_20150318-20150318.nc SalishSea_1d_20150316_20150320_ptrc_T_20150319-20150319.nc SalishSea_1d_20150316_20150320_ptrc_T_20150320-20150320.nc SalishSea_1d_20150321_20150325_ptrc_T_20150321-20150321.nc SalishSea_1d_20150321_20150325_ptrc_T_20150322-20150322.nc SalishSea_1d_20150321_20150325_ptrc_T_20150323-20150323.nc SalishSea_1d_20150321_20150325_ptrc_T_20150324-20150324.nc SalishSea_1d_20150321_20150325_ptrc_T_20150325-20150325.nc SalishSea_1d_20150326_20150331_ptrc_T_20150326-20150326.nc SalishSea_1d_20150326_20150331_ptrc_T_20150327-20150327.nc SalishSea_1d_20150326_20150331_ptrc_T_20150328-20150328.nc SalishSea_1d_20150326_20150331_ptrc_T_20150329-20150329.nc SalishSea_1d_20150326_20150331_ptrc_T_20150330-20150330.nc SalishSea_1d_20150326_20150331_ptrc_T_20150331-20150331.nc SalishSea_1d_20150401_20150405_ptrc_T_20150401-20150401.nc SalishSea_1d_20150401_20150405_ptrc_T_20150402-20150402.nc SalishSea_1d_20150401_20150405_ptrc_T_20150403-20150403.nc SalishSea_1d_20150401_20150405_ptrc_T_20150404-20150404.nc SalishSea_1d_20150401_20150405_ptrc_T_20150405-20150405.nc SalishSea_1d_20150406_20150410_ptrc_T_20150406-20150406.nc SalishSea_1d_20150406_20150410_ptrc_T_20150407-20150407.nc SalishSea_1d_20150406_20150410_ptrc_T_20150408-20150408.nc SalishSea_1d_20150406_20150410_ptrc_T_20150409-20150409.nc SalishSea_1d_20150406_20150410_ptrc_T_20150410-20150410.nc SalishSea_1d_20150411_20150415_ptrc_T_20150411-20150411.nc SalishSea_1d_20150411_20150415_ptrc_T_20150412-20150412.nc SalishSea_1d_20150411_20150415_ptrc_T_20150413-20150413.nc SalishSea_1d_20150411_20150415_ptrc_T_20150414-20150414.nc SalishSea_1d_20150411_20150415_ptrc_T_20150415-20150415.nc SalishSea_1d_20150416_20150420_ptrc_T_20150416-20150416.nc SalishSea_1d_20150416_20150420_ptrc_T_20150417-20150417.nc SalishSea_1d_20150416_20150420_ptrc_T_20150418-20150418.nc SalishSea_1d_20150416_20150420_ptrc_T_20150419-20150419.nc SalishSea_1d_20150416_20150420_ptrc_T_20150420-20150420.nc SalishSea_1d_20150421_20150425_ptrc_T_20150421-20150421.nc SalishSea_1d_20150421_20150425_ptrc_T_20150422-20150422.nc SalishSea_1d_20150421_20150425_ptrc_T_20150423-20150423.nc SalishSea_1d_20150421_20150425_ptrc_T_20150424-20150424.nc SalishSea_1d_20150421_20150425_ptrc_T_20150425-20150425.nc SalishSea_1d_20150426_20150430_ptrc_T_20150426-20150426.nc SalishSea_1d_20150426_20150430_ptrc_T_20150427-20150427.nc SalishSea_1d_20150426_20150430_ptrc_T_20150428-20150428.nc SalishSea_1d_20150426_20150430_ptrc_T_20150429-20150429.nc SalishSea_1d_20150426_20150430_ptrc_T_20150430-20150430.nc SalishSea_1d_20150501_20150505_grid_T_20150501-20150501.nc SalishSea_1d_20150501_20150505_grid_T_20150502-20150502.nc SalishSea_1d_20150501_20150505_grid_T_20150503-20150503.nc SalishSea_1d_20150501_20150505_grid_T_20150504-20150504.nc SalishSea_1d_20150501_20150505_grid_T_20150505-20150505.nc SalishSea_1d_20150501_20150505_ptrc_T_20150501-20150501.nc SalishSea_1d_20150501_20150505_ptrc_T_20150502-20150502.nc SalishSea_1d_20150501_20150505_ptrc_T_20150503-20150503.nc SalishSea_1d_20150501_20150505_ptrc_T_20150504-20150504.nc SalishSea_1d_20150501_20150505_ptrc_T_20150505-20150505.nc SalishSea_1d_20150506_20150510_grid_T_20150506-20150506.nc SalishSea_1d_20150506_20150510_grid_T_20150507-20150507.nc SalishSea_1d_20150506_20150510_grid_T_20150508-20150508.nc SalishSea_1d_20150506_20150510_grid_T_20150509-20150509.nc SalishSea_1d_20150506_20150510_grid_T_20150510-20150510.nc SalishSea_1d_20150506_20150510_ptrc_T_20150506-20150506.nc SalishSea_1d_20150506_20150510_ptrc_T_20150507-20150507.nc SalishSea_1d_20150506_20150510_ptrc_T_20150508-20150508.nc SalishSea_1d_20150506_20150510_ptrc_T_20150509-20150509.nc SalishSea_1d_20150506_20150510_ptrc_T_20150510-20150510.nc SalishSea_1d_20150511_20150515_grid_T_20150511-20150511.nc SalishSea_1d_20150511_20150515_grid_T_20150512-20150512.nc SalishSea_1d_20150511_20150515_grid_T_20150513-20150513.nc SalishSea_1d_20150511_20150515_grid_T_20150514-20150514.nc SalishSea_1d_20150511_20150515_grid_T_20150515-20150515.nc SalishSea_1d_20150511_20150515_ptrc_T_20150511-20150511.nc SalishSea_1d_20150511_20150515_ptrc_T_20150512-20150512.nc SalishSea_1d_20150511_20150515_ptrc_T_20150513-20150513.nc SalishSea_1d_20150511_20150515_ptrc_T_20150514-20150514.nc SalishSea_1d_20150511_20150515_ptrc_T_20150515-20150515.nc SalishSea_1d_20150516_20150520_grid_T_20150516-20150516.nc SalishSea_1d_20150516_20150520_grid_T_20150517-20150517.nc SalishSea_1d_20150516_20150520_grid_T_20150518-20150518.nc SalishSea_1d_20150516_20150520_grid_T_20150519-20150519.nc SalishSea_1d_20150516_20150520_grid_T_20150520-20150520.nc SalishSea_1d_20150516_20150520_ptrc_T_20150516-20150516.nc SalishSea_1d_20150516_20150520_ptrc_T_20150517-20150517.nc SalishSea_1d_20150516_20150520_ptrc_T_20150518-20150518.nc SalishSea_1d_20150516_20150520_ptrc_T_20150519-20150519.nc SalishSea_1d_20150516_20150520_ptrc_T_20150520-20150520.nc SalishSea_1d_20150521_20150525_grid_T_20150521-20150521.nc SalishSea_1d_20150521_20150525_grid_T_20150522-20150522.nc SalishSea_1d_20150521_20150525_grid_T_20150523-20150523.nc SalishSea_1d_20150521_20150525_grid_T_20150524-20150524.nc SalishSea_1d_20150521_20150525_grid_T_20150525-20150525.nc SalishSea_1d_20150521_20150525_ptrc_T_20150521-20150521.nc SalishSea_1d_20150521_20150525_ptrc_T_20150522-20150522.nc SalishSea_1d_20150521_20150525_ptrc_T_20150523-20150523.nc SalishSea_1d_20150521_20150525_ptrc_T_20150524-20150524.nc SalishSea_1d_20150521_20150525_ptrc_T_20150525-20150525.nc SalishSea_1d_20150526_20150531_grid_T_20150526-20150526.nc SalishSea_1d_20150526_20150531_grid_T_20150527-20150527.nc SalishSea_1d_20150526_20150531_grid_T_20150528-20150528.nc SalishSea_1d_20150526_20150531_grid_T_20150529-20150529.nc SalishSea_1d_20150526_20150531_grid_T_20150530-20150530.nc SalishSea_1d_20150526_20150531_grid_T_20150531-20150531.nc SalishSea_1d_20150526_20150531_ptrc_T_20150526-20150526.nc SalishSea_1d_20150526_20150531_ptrc_T_20150527-20150527.nc SalishSea_1d_20150526_20150531_ptrc_T_20150528-20150528.nc SalishSea_1d_20150526_20150531_ptrc_T_20150529-20150529.nc SalishSea_1d_20150526_20150531_ptrc_T_20150530-20150530.nc SalishSea_1d_20150526_20150531_ptrc_T_20150531-20150531.nc SalishSea_1d_20150601_20150605_ptrc_T_20150601-20150601.nc SalishSea_1d_20150601_20150605_ptrc_T_20150602-20150602.nc SalishSea_1d_20150601_20150605_ptrc_T_20150603-20150603.nc SalishSea_1d_20150601_20150605_ptrc_T_20150604-20150604.nc SalishSea_1d_20150601_20150605_ptrc_T_20150605-20150605.nc SalishSea_1d_20150606_20150610_ptrc_T_20150606-20150606.nc SalishSea_1d_20150606_20150610_ptrc_T_20150607-20150607.nc SalishSea_1d_20150606_20150610_ptrc_T_20150608-20150608.nc SalishSea_1d_20150606_20150610_ptrc_T_20150609-20150609.nc SalishSea_1d_20150606_20150610_ptrc_T_20150610-20150610.nc SalishSea_1d_20150611_20150615_ptrc_T_20150611-20150611.nc SalishSea_1d_20150611_20150615_ptrc_T_20150612-20150612.nc SalishSea_1d_20150611_20150615_ptrc_T_20150613-20150613.nc SalishSea_1d_20150611_20150615_ptrc_T_20150614-20150614.nc SalishSea_1d_20150611_20150615_ptrc_T_20150615-20150615.nc SalishSea_1d_20150616_20150620_ptrc_T_20150616-20150616.nc SalishSea_1d_20150616_20150620_ptrc_T_20150617-20150617.nc SalishSea_1d_20150616_20150620_ptrc_T_20150618-20150618.nc SalishSea_1d_20150616_20150620_ptrc_T_20150619-20150619.nc SalishSea_1d_20150616_20150620_ptrc_T_20150620-20150620.nc SalishSea_1d_20150621_20150625_ptrc_T_20150621-20150621.nc SalishSea_1d_20150621_20150625_ptrc_T_20150622-20150622.nc SalishSea_1d_20150621_20150625_ptrc_T_20150623-20150623.nc SalishSea_1d_20150621_20150625_ptrc_T_20150624-20150624.nc SalishSea_1d_20150621_20150625_ptrc_T_20150625-20150625.nc SalishSea_1d_20150626_20150630_ptrc_T_20150626-20150626.nc SalishSea_1d_20150626_20150630_ptrc_T_20150627-20150627.nc SalishSea_1d_20150626_20150630_ptrc_T_20150628-20150628.nc SalishSea_1d_20150626_20150630_ptrc_T_20150629-20150629.nc SalishSea_1d_20150626_20150630_ptrc_T_20150630-20150630.nc SalishSea_1m_201501_201501_grid_T.nc SalishSea_1m_201501_201501_ptrc_T.nc SalishSea_1m_201502_201502_ptrc_T.nc SalishSea_1m_201503_201503_ptrc_T.nc SalishSea_1m_201504_201504_ptrc_T.nc SalishSea_1m_201505_201505_grid_T.nc SalishSea_1m_201505_201505_ptrc_T.nc SalishSea_1m_201506_201506_ptrc_T.nc
f0=nc.Dataset('/data/sallen/results/MEOPAR/202007/202007D-nociliates/SalishSea_1d_20150101_20150105_ptrc_T_20150101-20150101.nc')
f0.variables['ciliates']
<class 'netCDF4._netCDF4.Variable'> float32 ciliates(time_counter, deptht, y, x) standard_name: mole_concentration_of_mesodinium_rubrum_expressed_as_nitrogen_in_sea_water long_name: Mesodinium rubrum Concentration units: mmol m-3 online_operation: average interval_operation: 40 s interval_write: 1 d cell_methods: time: mean (interval: 40 s) cell_measures: area: area _FillValue: 1e+20 missing_value: 1e+20 coordinates: time_centered deptht nav_lat nav_lon unlimited dimensions: time_counter current shape = (1, 40, 898, 398) filling on
np.max(np.ma.masked_where(tmask==0,f0.variables['ciliates']))
4.162322e-07
fig,ax=plt.subplots(1,1,figsize=(5,10))
m=ax.pcolormesh(np.sum(np.ma.masked_where(f0.variables['ciliates'][0,:,:,:]==0,
f0.variables['ciliates'][0,:,:,:]),0))
plt.colorbar(m)
<matplotlib.colorbar.Colorbar at 0x7fed69d17700>
fig,ax=plt.subplots(1,1,figsize=(5,10))
m=ax.pcolormesh(np.sum(np.ma.masked_where(tmask[0,:,:,:]==0,
f0.variables['ciliates'][0,:,:,:]),0))
plt.colorbar(m)
<matplotlib.colorbar.Colorbar at 0x7fed69bc3b80>
friv=nc.Dataset('/results/forcing/rivers/R201702DFraCElse_y2015m01d01.nc')
friv.variables['rorunoff']
<class 'netCDF4._netCDF4.Variable'> float32 rorunoff(time_counter, y, x) _Fillvalue: 0.0 _missing_value: 0.0 _units: kg m-2 s-1 unlimited dimensions: time_counter current shape = (1, 898, 398) filling on, default _FillValue of 9.969209968386869e+36 used
fig,ax=plt.subplots(1,2,figsize=(10,10))
m=ax[0].pcolormesh(np.sum(np.ma.masked_where(tmask[0,:,:100,100:200]==0,
f0.variables['ciliates'][0,:,:100,100:200]),0))
plt.colorbar(m,ax=ax[0])
m=ax[1].pcolormesh(np.ma.masked_where(friv.variables['rorunoff'][0,:100,100:200]==0,
friv.variables['rorunoff'][0,:100,100:200]))
plt.colorbar(m,ax=ax[1])
<matplotlib.colorbar.Colorbar at 0x7fed698d7190>
f2=nc.Dataset('/data/sallen/results/MEOPAR/202007/202007D-nociliates/SalishSea_1d_20150516_20150520_ptrc_T_20150518-20150518.nc')
fig,ax=plt.subplots(1,1,figsize=(5,10))
m=ax.pcolormesh(np.sum(np.ma.masked_where(f2.variables['ciliates'][0,:,:,:]==0,
f2.variables['ciliates'][0,:,:,:]),0))
plt.colorbar(m)
<matplotlib.colorbar.Colorbar at 0x7fed69cb90d0>