import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import datetime as dt
from salishsea_tools import evaltools as et
%matplotlib inline
ls '/ocean/ksuchy/MOAD/observe/Data and Code files for KS 2020dec11/2020_05_21 1995-2011 SoG VNH.csv'
/ocean/ksuchy/MOAD/observe/Data and Code files for KS 2020dec11/2020_05_21 1995-2011 SoG VNH.csv
df=pd.read_csv('/ocean/ksuchy/MOAD/observe/Data and Code files for KS 2020dec11/2020_05_21 2012-2015 SoG VNH.csv',
encoding = "ISO-8859-1")
df
Key | region_name | Station | PROJECT | lon | lat | Date | STN_TIME | Twilight | Net_Type | ... | Phylum: | Class: | Order: | Family: | Name | Abundance(#/m3) | Biomass(mg/m3) | NumberOfSpecies | Station Diversity | Station Equitability | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | IOS2012005000901 | Northern Strait of Georgia | 22 | Str. Geo. | -124.272 | 49.670 | 6/14/2012 | 7:32 | Daylight | SCOR VNH | ... | Arthropoda | Branchiopoda | Diplostraca | Podonidae | Podon *sp. s1 | 12.22541 | 0.06113 | 51 | 2.63 | 0.67 |
1 | IOS2012005000901 | Northern Strait of Georgia | 22 | Str. Geo. | -124.272 | 49.670 | 6/14/2012 | 7:32 | Daylight | SCOR VNH | ... | Arthropoda | Cirripedia | Thecostraca | NaN | Cirripedia *sp. nauplii s1 | 30.56351 | 1.22254 | 51 | 2.63 | 0.67 |
2 | IOS2012005000901 | Northern Strait of Georgia | 22 | Str. Geo. | -124.272 | 49.670 | 6/14/2012 | 7:32 | Daylight | SCOR VNH | ... | Arthropoda | Malacostraca | Amphipoda | Hyperiidae | Themisto pacifica juvenile s1 | 6.11270 | 1.44871 | 51 | 2.63 | 0.67 |
3 | IOS2012005000901 | Northern Strait of Georgia | 22 | Str. Geo. | -124.272 | 49.670 | 6/14/2012 | 7:32 | Daylight | SCOR VNH | ... | Arthropoda | Malacostraca | Decapoda | NaN | Caridea *sp. zoea s1 | 3.05635 | 0.07030 | 51 | 2.63 | 0.67 |
4 | IOS2012005000901 | Northern Strait of Georgia | 22 | Str. Geo. | -124.272 | 49.670 | 6/14/2012 | 7:32 | Daylight | SCOR VNH | ... | Arthropoda | Malacostraca | Decapoda | Hippolytidae | Hippolytidae *sp. mysis s2 | 0.09551 | 0.06017 | 51 | 2.63 | 0.67 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
60225 | SOO2015095000801 | Tidal Mixed | MAC41 | Citizen Science | -123.409 | 48.402 | 7/27/2015 | 13:00 | Daylight | SCOR VNH | ... | Ctenophora | Tentaculata | Cydippida | Pleurobrachiidae | Pleurobrachia bachei s2 | 0.25316 | 0.31797 | 44 | 2.56 | 0.67 |
60226 | SOO2015095000801 | Tidal Mixed | MAC41 | Citizen Science | -123.409 | 48.402 | 7/27/2015 | 13:00 | Daylight | SCOR VNH | ... | Ectoprocta | Gymnolaemata | NaN | NaN | Bryozoa *sp. cyphonautes s1 | 48.60759 | 0.06319 | 44 | 2.56 | 0.67 |
60227 | SOO2015095000801 | Tidal Mixed | MAC41 | Citizen Science | -123.409 | 48.402 | 7/27/2015 | 13:00 | Daylight | SCOR VNH | ... | Mollusca | Bivalvia | Pholadomyoida | NaN | Bivalvia *sp. veligers s1 | 21.60338 | 0.01296 | 44 | 2.56 | 0.67 |
60228 | SOO2015095000801 | Tidal Mixed | MAC41 | Citizen Science | -123.409 | 48.402 | 7/27/2015 | 13:00 | Daylight | SCOR VNH | ... | Mollusca | Cephalopoda | Teuthida | Gonatidae | Berryteuthis magister s2 | 0.08439 | 0.46414 | 44 | 2.56 | 0.67 |
60229 | SOO2015095000801 | Tidal Mixed | MAC41 | Citizen Science | -123.409 | 48.402 | 7/27/2015 | 13:00 | Daylight | SCOR VNH | ... | Mollusca | Gastropoda | NaN | NaN | Gastropoda *sp. veligers s1 | 10.80169 | 0.02808 | 44 | 2.56 | 0.67 |
60230 rows × 29 columns
df.keys()
Index(['Key', 'region_name', 'Station', 'PROJECT', 'lon', 'lat', 'Date', 'STN_TIME', 'Twilight', 'Net_Type', 'Mesh_Size(um)', 'Net_Mouth_Dia(m)', 'DEPTH_STRT1', 'DEPTH_END1', 'Bottom Depth(m)', 'Volume Filtered(m3)', 'CTD', 'NOTES', 'PI', 'Phylum:', 'Class:', 'Order:', 'Family:', 'Name', 'Abundance(#/m3)', 'Biomass(mg/m3)', 'NumberOfSpecies', 'Station Diversity', 'Station Equitability'], dtype='object')
df['Biomass(mg/m3)']
0 0.06113 1 1.22254 2 1.44871 3 0.07030 4 0.06017 ... 60225 0.31797 60226 0.06319 60227 0.01296 60228 0.46414 60229 0.02808 Name: Biomass(mg/m3), Length: 60230, dtype: float64
df['Date'][0],df['STN_TIME'][0]
('6/14/2012', '7:32')
df['Date'][1000:1020]
1000 6/15/2012 1001 6/15/2012 1002 6/15/2012 1003 6/15/2012 1004 6/15/2012 1005 6/15/2012 1006 6/15/2012 1007 6/15/2012 1008 6/15/2012 1009 6/15/2012 1010 6/15/2012 1011 6/15/2012 1012 6/15/2012 1013 6/15/2012 1014 6/15/2012 1015 6/15/2012 1016 6/15/2012 1017 6/15/2012 1018 6/15/2012 1019 6/15/2012 Name: Date, dtype: object
df['Date'][0].split('/')
['6', '14', '2012']
dateslist=list()
for el in df['Date']:
dateslist.append(el.split('/'))
timeslist=list()
for el in df['STN_TIME']:
timeslist.append(el.split(':'))
dts=list()
for ii,jj in zip(dateslist,timeslist):
dts.append(dt.datetime(int(ii[2]),int(ii[0]),int(ii[1]),int(jj[0]),int(jj[1])))
df.loc[df.Twilight=='Daylight']['STN_TIME'].unique()
array(['7:32', '7:52', '3:30', '7:42', '7:49', '15:09', '16:30', '22:09', '22:27', '19:36', '19:53', '9:21', '9:35', '13:29', '13:45', '19:25', '19:43', '5:26', '5:43', '5:45', '5:47', '5:56', '5:59', '8:38', '8:39', '8:40', '8:41', '8:57', '11:10', '11:44', '11:45', '11:47', '11:48', '11:49', '12:40', '12:42', '15:14', '15:15', '15:16', '15:17', '15:18', '17:54', '17:55', '17:57', '17:58', '17:59', '5:39', '6:05', '14:47', '15:02', '19:13', '19:30', '14:32', '14:49', '20:04', '20:24', '20:27', '20:47', '9:37', '9:48', '13:57', '14:17', '19:41', '19:59', '7:18', '7:53', '9:25', '12:57', '13:09', '7:30', '7:45', '13:33', '13:36', '13:38', '10:00', '10:30', '11:00', '11:30', '12:30', '13:00', '13:30', '16:00', '17:00', '9:29', '10:26', '11:19', '13:39', '9:16', '10:04', '10:42', '11:03', '9:00', '9:41', '10:17', '10:40', '12:00', '9:33', '10:13', '11:11', '12:02', '12:32', '13:22', '9:57', '10:35', '10:02', '12:08', '13:18', '14:50', '17:45', '18:45', '8:30', '9:30', '11:41', '12:37', '13:03', '14:05', '9:20', '11:56', '13:43', '9:32', '11:22', '11:52', '7:27', '19:08', '9:45', '16:38', '16:57', '16:04', '16:26', '13:31', '13:35', '7:12', '16:12', '16:14', '16:18', '16:20', '16:22', '3:48', '4:04', '15:20', '15:35', '21:28', '21:42', '4:33', '4:45', '11:38', '11:55', '18:18', '18:29', '10:12', '12:55', '10:16', '11:20', '13:08', '11:07', '12:19', '12:58', '14:42', '15:37', '12:10', '12:23', '13:24', '14:33', '10:32', '12:39', '9:49', '10:53', '12:49', '11:36', '14:11', '9:51', '11:24', '13:04', '13:19', '9:24', '10:15', '11:53', '12:51', '12:50', '16:11', '6:15', '17:15', '11:16', '12:17', '13:10', '13:59', '11:21', '12:01', '12:35', '9:58', '10:41', '11:29', '9:05', '9:50', '8:49', '9:55', '11:14', '12:14', '9:10', '10:20', '10:50', '11:25', '11:50', '19:52', '20:32', '6:20', '5:58', '20:29', '5:20', '20:10', '15:52', '6:43', '20:12', '7:22', '21:03', '21:55', '14:56', '10:08', '20:01', '11:33', '15:22', '16:40', '23:15', '8:51', '12:12', '15:12', '10:57', '7:03', '8:03', '14:22', '23:06', '4:05', '6:25', '9:26', '11:28', '13:27', '15:11', '15:53', '15:54', '15:56', '15:59', '18:06', '19:45', '9:40', '20:11', '7:10', '14:34', '11:42', '13:28', '17:12', '9:04', '14:10', '16:17', '8:02', '10:31', '15:27', '17:01', '16:43', '10:46', '13:15', '14:43', '9:44', '13:55', '15:44', '16:59', '18:41', '8:18', '11:13', '8:28', '15:43', '18:08', '7:40', '10:56', '10:33', '12:52', '14:55', '7:43', '12:13', '13:44', '7:41', '16:56', '8:17', '9:13', '11:12', '15:40', '18:27', '10:07', '12:06', '16:07', '16:41', '10:52', '16:33', '17:48', '7:48', '11:09', '15:08', '8:31', '12:22', '14:39', '12:03', '14:30', '17:31', '14:15', '18:16', '7:55', '17:38', '6:36', '18:22', '7:15', '9:17', '12:44', '18:54', '12:43', '18:44', '7:08', '13:02', '7:19', '16:36', '8:25', '8:33', '13:25', '17:20', '17:26', '13:42', '18:37', '18:43', '13:21', '14:53', '17:24', '9:38', '7:06', '9:31', '12:20', '15:28', '11:01', '11:57', '14:12', '15:10', '7:35', '14:38', '16:06', '8:08', '16:05', '16:52', '17:47', '8:21', '9:19', '16:35', '8:10', '8:59', '10:21', '14:41', '16:09', '18:26', '11:23', '8:14', '10:10', '11:27', '13:26', '11:15', '13:11', '9:18', '12:04', '10:45', '12:25', '13:56', '10:22', '13:53', '9:28', '11:06', '11:32', '10:34', '14:08', '11:18', '12:48', '14:01', '12:07', '14:07', '11:08', '14:04', '10:06', '11:43', '13:40', '10:18', '13:34', '16:27', '10:28', '15:26', '9:14', '12:15', '15:23', '8:23', '14:58', '9:08', '10:43', '14:29', '8:44', '9:52', '8:13', '14:27', '14:46', '14:16', '10:11', '14:51', '8:32', '10:37'], dtype=object)
df['dtUTC']=et.pac_to_utc(dts) #convert from Pac time to UTC
df['Order:'].unique()
array(['Diplostraca', 'Thecostraca', 'Amphipoda', 'Decapoda', 'Euphausiacea', 'Calanoida', 'Cyclopoida', 'Poecilostomatoida', 'Halocyprida', 'Aphragmophora', 'Copelata', 'Leptothecate', 'Siphonophorae', 'Trachylina', 'Cydippida', nan, 'Pholadomyoida', 'Neotaenioglossa', 'Thecosomata', 'Aciculata', 'Canalipalpata', 'Osmeriformes', 'Perciformes', 'Beroida', 'Teuthida', 'Gymnosomata', 'Isopoda', 'Siphonostomatoida', 'Anthoathecatae', 'Scorpaeniformes', 'Phragmophora', 'Clupeiformes', 'Ophiurida', 'Gadiformes', 'Semaeostomeae', 'Cumacea', 'Echinoida', 'Harpacticoida', 'Pleuronectiformes', 'Tricladida', 'Myodocopida', 'Phaeogromia', 'Noctilucales', 'Octopoda', 'Actiniaria', 'Foraminiferida', 'Monstrilloida', 'Oligotrichida', 'Mysida', 'Acariformes', 'Lophogastrida', 'Ophidiiformes', 'Thalassocalycida', 'Doliolida', 'Lepadomorpha', 'Cephalaspidea', 'Sygnathiformes'], dtype=object)
colList=('Amphipoda', 'Decapoda','Euphausiacea', 'Calanoida', 'Cyclopoida',
'Poecilostomatoida','Copelata','Harpacticoida',)
df.keys()
Index(['Key', 'region_name', 'Station', 'PROJECT', 'lon', 'lat', 'Date', 'STN_TIME', 'Twilight', 'Net_Type', 'Mesh_Size(um)', 'Net_Mouth_Dia(m)', 'DEPTH_STRT1', 'DEPTH_END1', 'Bottom Depth(m)', 'Volume Filtered(m3)', 'CTD', 'NOTES', 'PI', 'Phylum:', 'Class:', 'Order:', 'Family:', 'Name', 'Abundance(#/m3)', 'Biomass(mg/m3)', 'NumberOfSpecies', 'Station Diversity', 'Station Equitability', 'dtUTC'], dtype='object')
dtsutc=et.pac_to_utc(dts)
df.loc[0]
Key IOS2012005000901 region_name Northern Strait of Georgia Station 22 PROJECT Str. Geo. lon -124.272 lat 49.67 Date 6/14/2012 STN_TIME 7:32 Twilight Daylight Net_Type SCOR VNH Mesh_Size(um) 236 Net_Mouth_Dia(m) 0.56 DEPTH_STRT1 50 DEPTH_END1 0 Bottom Depth(m) 352 Volume Filtered(m3) 10.47 CTD 8 NOTES Flowmeter reading may be incorrect. Value ente... PI Dave Mackas Phylum: Arthropoda Class: Branchiopoda Order: Diplostraca Family: Podonidae Name Podon *sp. s1 Abundance(#/m3) 12.2254 Biomass(mg/m3) 0.06113 NumberOfSpecies 51 Station Diversity 2.63 Station Equitability 0.67 dtUTC 2012-06-14 14:32:00 Name: 0, dtype: object
towIDlist=['Key', 'region_name', 'Station', 'lon', 'lat', 'dtUTC', 'Twilight', 'Net_Type', 'Mesh_Size(um)', 'DEPTH_STRT1', 'DEPTH_END1', 'Bottom Depth(m)']
towIDlist2=['Key', 'region_name', 'Station', 'lon', 'lat', 'dtUTC', 'Twilight', 'Net_Type', 'Mesh_Size(um)', 'DEPTH_STRT1', 'DEPTH_END1', 'Bottom Depth(m)','CTD']
len(df.groupby(towIDlist)),len(df.groupby(towIDlist2)),len(df.groupby(['Key']))
(654, 12694, 654)
# Key is a unique identifier for each tow
# do not group by CTD due to NaN values
biomassDF=df.groupby(towIDlist,as_index=False).first()\
.loc[:,towIDlist].copy(deep=True)
biomassDF
Key | region_name | Station | lon | lat | dtUTC | Twilight | Net_Type | Mesh_Size(um) | DEPTH_STRT1 | DEPTH_END1 | Bottom Depth(m) | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | IOS2012005000901 | Northern Strait of Georgia | 22 | -124.272 | 49.670 | 2012-06-14 14:32:00 | Daylight | SCOR VNH | 236 | 50 | 0 | 352 |
1 | IOS2012005001001 | Northern Strait of Georgia | 22 | -124.272 | 49.670 | 2012-06-14 14:52:00 | Daylight | SCOR VNH | 236 | 345 | 0 | 352 |
2 | IOS2012005002101 | Northern Strait of Georgia | 11 | -124.722 | 49.710 | 2012-06-14 07:00:00 | Night | SCOR VNH | 236 | 50 | 0 | 307 |
3 | IOS2012005002201 | Northern Strait of Georgia | 11 | -124.722 | 49.710 | 2012-06-14 07:05:00 | Night | SCOR VNH | 236 | 300 | 0 | 307 |
4 | IOS2012005002901 | Northern Strait of Georgia | CPF2 | -124.499 | 49.466 | 2012-06-15 10:00:00 | Night | SCOR VNH | 236 | 50 | 0 | 325 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
649 | SOO2015095000101 | Tidal Mixed | CLO-42 | -123.345 | 48.394 | 2015-04-27 17:37:00 | Daylight | SCOR VNH | 236 | 58 | 0 | 72 |
650 | SOO2015095000401 | Tidal Mixed | CB01 | -123.318 | 48.344 | 2015-04-30 19:00:00 | Daylight | SCOR VNH | 236 | 54 | 0 | 64 |
651 | SOO2015095000501 | Tidal Mixed | CLO-41 | -123.345 | 48.395 | 2015-07-09 19:25:00 | Daylight | SCOR VNH | 236 | 42 | 0 | 64 |
652 | SOO2015095000701 | Tidal Mixed | CB01 | -123.318 | 48.344 | 2015-07-27 19:06:00 | Daylight | SCOR VNH | 236 | 28 | 0 | 60 |
653 | SOO2015095000801 | Tidal Mixed | MAC41 | -123.409 | 48.402 | 2015-07-27 20:00:00 | Daylight | SCOR VNH | 236 | 49 | 0 | 62 |
654 rows × 12 columns
def getbiomass(colname,key,origdf):
biomassArray=df.loc[(origdf.Key==key)&(origdf['Order:']==colname),
['Biomass(mg/m3)']]
biomass=np.nansum(biomassArray)
return biomass
for icol in colList:
biomassDF[icol]=[getbiomass(icol,ikey,df) for ikey in biomassDF['Key']]
biomassDF
Key | region_name | Station | lon | lat | dtUTC | Twilight | Net_Type | Mesh_Size(um) | DEPTH_STRT1 | DEPTH_END1 | Bottom Depth(m) | Amphipoda | Decapoda | Euphausiacea | Calanoida | Cyclopoida | Poecilostomatoida | Copelata | Harpacticoida | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | IOS2012005000901 | Northern Strait of Georgia | 22 | -124.272 | 49.670 | 2012-06-14 14:32:00 | Daylight | SCOR VNH | 236 | 50 | 0 | 352 | 1.44871 | 0.13047 | 0.65310 | 14.21881 | 0.35546 | 0.59598 | 0.91691 | 0.0 |
1 | IOS2012005001001 | Northern Strait of Georgia | 22 | -124.272 | 49.670 | 2012-06-14 14:52:00 | Daylight | SCOR VNH | 236 | 345 | 0 | 352 | 2.57318 | 0.23591 | 0.16876 | 17.75443 | 0.37904 | 0.23747 | 1.15807 | 0.0 |
2 | IOS2012005002101 | Northern Strait of Georgia | 11 | -124.722 | 49.710 | 2012-06-14 07:00:00 | Night | SCOR VNH | 236 | 50 | 0 | 307 | 8.45483 | 5.76780 | 0.07720 | 57.97920 | 1.18232 | 0.31802 | 0.01917 | 0.0 |
3 | IOS2012005002201 | Northern Strait of Georgia | 11 | -124.722 | 49.710 | 2012-06-14 07:05:00 | Night | SCOR VNH | 236 | 300 | 0 | 307 | 23.57762 | 3.69101 | 4.27121 | 68.21370 | 1.32736 | 0.58393 | 0.14046 | 0.0 |
4 | IOS2012005002901 | Northern Strait of Georgia | CPF2 | -124.499 | 49.466 | 2012-06-15 10:00:00 | Night | SCOR VNH | 236 | 50 | 0 | 325 | 124.31430 | 24.79259 | 14.47768 | 34.16656 | 0.77657 | 0.14856 | 0.36571 | 0.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
649 | SOO2015095000101 | Tidal Mixed | CLO-42 | -123.345 | 48.394 | 2015-04-27 17:37:00 | Daylight | SCOR VNH | 236 | 58 | 0 | 72 | 1.81260 | 0.93396 | 0.01031 | 6.19344 | 0.00191 | 0.01527 | 0.69466 | 0.0 |
650 | SOO2015095000401 | Tidal Mixed | CB01 | -123.318 | 48.344 | 2015-04-30 19:00:00 | Daylight | SCOR VNH | 236 | 54 | 0 | 64 | 5.31255 | 2.51960 | 0.02307 | 10.53489 | 0.00427 | 0.04784 | 0.47838 | 0.0 |
651 | SOO2015095000501 | Tidal Mixed | CLO-41 | -123.345 | 48.395 | 2015-07-09 19:25:00 | Daylight | SCOR VNH | 236 | 42 | 0 | 64 | 0.00000 | 0.56055 | 0.02636 | 5.75176 | 0.00000 | 0.03222 | 3.30984 | 0.0 |
652 | SOO2015095000701 | Tidal Mixed | CB01 | -123.318 | 48.344 | 2015-07-27 19:06:00 | Daylight | SCOR VNH | 236 | 28 | 0 | 60 | 1.29901 | 1.55372 | 0.06543 | 2.18596 | 0.00539 | 0.02079 | 3.39476 | 0.0 |
653 | SOO2015095000801 | Tidal Mixed | MAC41 | -123.409 | 48.402 | 2015-07-27 20:00:00 | Daylight | SCOR VNH | 236 | 49 | 0 | 62 | 1.28000 | 2.11012 | 0.19443 | 21.37141 | 0.01080 | 0.11882 | 27.27426 | 0.0 |
654 rows × 20 columns
import netCDF4 as nc
ftemp=nc.Dataset('/data/eolson/results/MEOPAR/NEMO-forcing-new/grid/mesh_mask201702.nc')
ftemp.variables.keys()
dict_keys(['nav_lon', 'nav_lat', 'time_counter', 'tmask', 'umask', 'vmask', 'fmask', 'tmaskutil', 'umaskutil', 'vmaskutil', 'fmaskutil', 'glamt', 'glamu', 'glamv', 'glamf', 'gphit', 'gphiu', 'gphiv', 'gphif', 'e1t', 'e1u', 'e1v', 'e1f', 'e2t', 'e2u', 'e2v', 'e2f', 'ff', 'mbathy', 'misf', 'isfdraft', 'e3t_0', 'e3u_0', 'e3v_0', 'e3w_0', 'gdept_0', 'gdepu', 'gdepv', 'gdepw_0', 'gdept_1d', 'gdepw_1d', 'e3t_1d', 'e3w_1d'])
ftemp.variables['e3t_0']
<class 'netCDF4._netCDF4.Variable'> float64 e3t_0(t, z, y, x) _FillValue: nan standard_name: e3t_0 long_name: grid spacing on T-grid in w direction units: m unlimited dimensions: t current shape = (1, 40, 898, 398) filling on
ftemp.variables['e3t_1d'][:]
masked_array(data=[[ 1.00000115, 1.00000501, 1.00001253, 1.00002718, 1.0000557 , 1.00011125, 1.00021946, 1.0004302 , 1.00084067, 1.00164012, 1.0031971 , 1.00622914, 1.01213271, 1.02362358, 1.04597551, 1.08940061, 1.17356428, 1.33592899, 1.64636781, 2.22990285, 3.29248567, 5.11998508, 7.97451506, 11.8252972 , 16.10792044, 19.95870258, 22.81323256, 24.64073198, 25.70331479, 26.28684983, 26.59728865, 26.75965336, 26.84381704, 26.88724213, 26.90959407, 26.92108493, 26.9269885 , 26.93002054, 26.93157752, 26.93237697]], mask=False, fill_value=1e+20)
fdict={'ptrc_T':1,'grid_T':1}
start_date = dt.datetime(2015,6,1)
end_date = dt.datetime(2015,6,30)
flen=1 # number of days per model output file. always 1 for 201905 and 201812 model runs
namfmt='nowcast' # for 201905 and 201812 model runs, this should always be 'nowcast'
# filemap is dictionary of the form variableName: fileType, where variableName is the name
# of the variable you want to extract and fileType designates the type of
# model output file it can be found in (usually ptrc_T for biology, grid_T for temperature and
# salinity)
filemap={'microzooplankton':'ptrc_T','mesozooplankton':'ptrc_T'}
# fdict is a dictionary mappy file type to its time resolution. Here, 1 means hourly output
# (1h file) and 24 means daily output (1d file). In certain runs, multiple time resolutions
# are available
fdict={'ptrc_T':1,'grid_T':1}
PATH= '/results2/SalishSea/nowcast-green.201905/'
biomassDF.rename(columns={'lon':'Lon','lat':'Lat'},inplace=True)
biomassDF.keys()
Index(['Key', 'region_name', 'Station', 'Lon', 'Lat', 'dtUTC', 'Twilight', 'Net_Type', 'Mesh_Size(um)', 'DEPTH_STRT1', 'DEPTH_END1', 'Bottom Depth(m)', 'Amphipoda', 'Decapoda', 'Euphausiacea', 'Calanoida', 'Cyclopoida', 'Poecilostomatoida', 'Copelata', 'Harpacticoida'], dtype='object')
biomassDF.rename(columns={'DEPTH_STRT1':'Z_lower','DEPTH_END1':'Z_upper','Bottom Depth (m)': 'Z'},inplace=True)
data=et.matchData(biomassDF,filemap,fdict,start_date,end_date,'nowcast',PATH,1,quiet=False,method='vertNet');
Warning: lower limit is not an ocean value: i=159, j=646, k_upper=0, k_lower=34, k_seafloor=34 Lon=-124.72399999999999, Lat=49.707, dtUTC=2015-06-28 06:15:00 Warning: lower limit is not an ocean value: i=159, j=646, k_upper=0, k_lower=34, k_seafloor=34 Lon=-124.72399999999999, Lat=49.707, dtUTC=2015-06-28 06:15:00
data
Key | region_name | Station | Lon | Lat | dtUTC | Twilight | Net_Type | Mesh_Size(um) | Z_lower | ... | Cyclopoida | Poecilostomatoida | Copelata | Harpacticoida | j | i | mod_microzooplankton | mod_mesozooplankton | k_upper | k_lower | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | IOS2015020019801 | Northern Strait of Georgia | 14 | -124.997 | 49.884 | 2015-06-06 06:06:00 | Daylight | Bongo VNH | 236 | 302 | ... | 0.72407 | 0.94464 | 0.49944 | 0.00000 | 700 | 141 | 0.074582 | 0.290741 | 0 | 34 |
1 | IOS2015020020001A | Northern Strait of Georgia | 11 | -124.723 | 49.707 | 2015-06-06 08:37:00 | Night | Bongo VNH | 236 | 289 | ... | 0.50000 | 0.43750 | 0.05000 | 0.00000 | 645 | 159 | 0.072160 | 0.309218 | 0 | 33 |
2 | IOS2015020020201 | Northern Strait of Georgia | CPF2 | -124.500 | 49.466 | 2015-06-06 11:05:00 | Daylight | Bongo VNH | 236 | 315 | ... | 0.91324 | 0.41343 | 0.09291 | 0.00000 | 583 | 162 | 0.048654 | 0.186083 | 0 | 34 |
3 | IOS2015020020401 | Central Strait of Georgia | CPF1 | -124.084 | 49.367 | 2015-06-06 13:25:00 | Daylight | Bongo VNH | 236 | 233 | ... | 0.87370 | 0.44702 | 0.23760 | 0.00000 | 534 | 211 | 0.094083 | 0.301332 | 0 | 31 |
4 | IOS2015020020601 | Northern Strait of Georgia | 22 | -124.272 | 49.670 | 2015-06-06 16:26:00 | Daylight | Bongo VNH | 236 | 342 | ... | 0.73786 | 0.43804 | 1.47271 | 0.00000 | 606 | 221 | 0.042945 | 0.192460 | 0 | 35 |
5 | IOS2015020020801 | Northern Strait of Georgia | 24 | -124.098 | 49.504 | 2015-06-06 18:28:00 | Daylight | Bongo VNH | 236 | 411 | ... | 0.77318 | 0.35132 | 0.90786 | 0.00018 | 562 | 226 | 0.047029 | 0.173742 | 0 | 38 |
6 | IOS2015020021001 | Central Strait of Georgia | 28 | -123.755 | 49.402 | 2015-06-06 20:27:00 | Daylight | Bongo VNH | 236 | 122 | ... | 1.87486 | 0.49741 | 1.77711 | 0.00000 | 517 | 263 | 0.148792 | 0.430705 | 0 | 27 |
7 | IOS2015020021201 | Central Strait of Georgia | GEO1 | -123.750 | 49.249 | 2015-06-06 22:11:00 | Daylight | Bongo VNH | 236 | 390 | ... | 0.76200 | 0.38549 | 0.32561 | 0.00000 | 487 | 245 | 0.058598 | 0.176175 | 0 | 37 |
8 | IOS2015020021301 | Central Strait of Georgia | GEO1 | -123.748 | 49.249 | 2015-06-06 22:53:00 | Daylight | MPS VNH | 250 | 390 | ... | 0.03467 | 0.04440 | 0.17067 | 0.00000 | 487 | 245 | 0.003679 | 0.025794 | 34 | 37 |
9 | IOS2015020021302 | Central Strait of Georgia | GEO1 | -123.748 | 49.249 | 2015-06-06 22:54:00 | Daylight | MPS VNH | 250 | 300 | ... | 0.02844 | 0.02329 | 0.07585 | 0.00000 | 487 | 245 | 0.014898 | 0.055481 | 30 | 34 |
10 | IOS2015020021303 | Central Strait of Georgia | GEO1 | -123.748 | 49.249 | 2015-06-06 22:56:00 | Daylight | MPS VNH | 250 | 200 | ... | 0.41095 | 0.08984 | 0.14523 | 0.00000 | 487 | 245 | 0.049306 | 0.136318 | 26 | 30 |
11 | IOS2015020021304 | Central Strait of Georgia | GEO1 | -123.748 | 49.249 | 2015-06-06 22:59:00 | Daylight | MPS VNH | 250 | 100 | ... | 0.36214 | 0.07894 | 0.32747 | 0.00000 | 487 | 245 | 0.092179 | 0.276844 | 23 | 26 |
12 | IOS2015020021305 | Central Strait of Georgia | GEO1 | -123.748 | 49.249 | 2015-06-06 23:00:00 | Daylight | MPS VNH | 250 | 50 | ... | 1.12051 | 0.81724 | 1.01784 | 0.00000 | 487 | 245 | 0.242380 | 0.688722 | 0 | 23 |
13 | IOS2015020021501 | Central Strait of Georgia | 38 | -123.440 | 49.202 | 2015-06-07 01:06:00 | Daylight | Bongo VNH | 236 | 293 | ... | 1.18817 | 0.44428 | 0.48725 | 0.00000 | 456 | 285 | 0.129881 | 0.326925 | 0 | 33 |
14 | IOS2015020021701 | Central Strait of Georgia | 41 | -123.372 | 49.056 | 2015-06-07 02:45:00 | Daylight | Bongo VNH | 236 | 219 | ... | 1.04013 | 0.54064 | 0.18782 | 0.00000 | 423 | 276 | 0.148957 | 0.415778 | 0 | 31 |
15 | PSF2015098003201 | Baynes Sound | BS-7 | -124.767 | 49.484 | 2015-06-08 16:08:00 | Daylight | Ring VNH | 250 | 47 | ... | 0.47805 | 2.34147 | 45.46341 | 0.00000 | 605 | 125 | 0.315842 | 1.034672 | 0 | 23 |
16 | PSF2015098003301 | Baynes Sound | BS-1 | -124.866 | 49.609 | 2015-06-08 17:43:00 | Daylight | Ring VNH | 250 | 24 | ... | 0.06772 | 3.79260 | 135.90124 | 0.00000 | 636 | 126 | 0.465556 | 1.880479 | 0 | 20 |
17 | PSF2015097002501 | Northern Strait of Georgia | IS-4 | -124.155 | 49.575 | 2015-06-09 18:32:00 | Daylight | Ring VNH | 250 | 141 | ... | 0.32217 | 0.40143 | 1.29828 | 0.00000 | 579 | 226 | 0.105121 | 0.394998 | 0 | 28 |
18 | PSF2015097002601 | Northern Strait of Georgia | IS-3 | -124.287 | 49.655 | 2015-06-09 20:44:00 | Daylight | Ring VNH | 250 | 148 | ... | 0.32345 | 0.35797 | 0.28382 | 0.00000 | 604 | 217 | 0.101539 | 0.444235 | 0 | 28 |
19 | PSF2015097002701 | Nearshore-North East | IS-2 | -124.083 | 49.637 | 2015-06-09 22:40:00 | Daylight | Ring VNH | 250 | 25 | ... | 0.71367 | 0.85947 | 9.95299 | 0.00000 | 587 | 245 | 0.336851 | 0.906971 | 0 | 20 |
20 | PSF2015097002801 | Northern Strait of Georgia | IS-4 | -124.157 | 49.575 | 2015-06-15 17:34:00 | Daylight | Ring VNH | 250 | 150 | ... | 1.33018 | 0.22629 | 6.52331 | 0.00000 | 580 | 226 | 0.189448 | 0.438321 | 0 | 28 |
21 | PSF2015097002901 | Northern Strait of Georgia | IS-3 | -124.287 | 49.655 | 2015-06-15 19:08:00 | Daylight | Ring VNH | 250 | 148 | ... | 0.29802 | 0.22109 | 8.11830 | 0.00000 | 604 | 217 | 0.205938 | 0.534066 | 0 | 28 |
22 | PSF2015097003001 | Nearshore-North East | IS-2 | -124.083 | 49.637 | 2015-06-15 21:08:00 | Daylight | Ring VNH | 250 | 36 | ... | 1.90443 | 0.86977 | 94.24747 | 0.00000 | 587 | 245 | 0.804913 | 1.618268 | 0 | 22 |
23 | PSF2015098006001 | Baynes Sound | BS-7 | -124.767 | 49.483 | 2015-06-18 15:32:00 | Daylight | Ring VNH | 250 | 57 | ... | 0.74627 | 0.89228 | 20.63169 | 0.00000 | 605 | 125 | 0.563907 | 0.800657 | 0 | 24 |
24 | PSF2015098003401 | Baynes Sound | BS-1 | -124.867 | 49.608 | 2015-06-18 16:48:00 | Daylight | Ring VNH | 250 | 33 | ... | 0.23051 | 1.43729 | 26.57627 | 0.00000 | 636 | 126 | 0.702900 | 1.055745 | 0 | 22 |
25 | PSF2015098003501 | Northern Strait of Georgia | BS-3 | -124.666 | 49.692 | 2015-06-18 18:49:00 | Daylight | Ring VNH | 250 | 150 | ... | 1.03680 | 0.25693 | 3.19715 | 0.00000 | 639 | 166 | 0.260603 | 0.456427 | 0 | 28 |
26 | PSF2015098003601 | Nearshore North West | BS-6 | -124.605 | 49.491 | 2015-06-18 21:29:00 | Daylight | Ring VNH | 250 | 36 | ... | 0.56746 | 0.72541 | 2.45704 | 0.00000 | 595 | 149 | 0.780453 | 0.950406 | 0 | 22 |
27 | PSF2015098003701 | Baynes Sound | BS-7 | -124.767 | 49.483 | 2015-06-23 15:44:00 | Daylight | Ring VNH | 250 | 47 | ... | 0.05405 | 0.61622 | 73.62163 | 0.10811 | 605 | 125 | 0.416449 | 0.689419 | 0 | 23 |
28 | PSF2015098003801 | Baynes Sound | BS-1 | -124.867 | 49.609 | 2015-06-23 16:52:00 | Daylight | Ring VNH | 250 | 31 | ... | 0.17524 | 1.60000 | 26.66667 | 0.00000 | 637 | 126 | 1.018696 | 1.327305 | 0 | 21 |
29 | PSF2015098003901 | Northern Strait of Georgia | BS-3 | -124.667 | 49.692 | 2015-06-23 19:04:00 | Daylight | Ring VNH | 250 | 130 | ... | 0.91690 | 0.85479 | 3.88494 | 0.29224 | 639 | 166 | 0.257833 | 0.493006 | 0 | 27 |
30 | PSF2015097003101 | Northern Strait of Georgia | IS-4 | -124.155 | 49.575 | 2015-06-24 18:18:00 | Daylight | Ring VNH | 250 | 150 | ... | 1.52572 | 0.12528 | 0.89013 | 0.00000 | 579 | 226 | 0.161277 | 0.365172 | 0 | 28 |
31 | PSF2015097003201 | Northern Strait of Georgia | IS-3 | -124.287 | 49.655 | 2015-06-24 19:48:00 | Daylight | Ring VNH | 250 | 150 | ... | 1.03530 | 0.22246 | 1.39992 | 0.00000 | 604 | 217 | 0.146848 | 0.341614 | 0 | 28 |
32 | PSF2015097003301 | Nearshore-North East | IS-2 | -124.083 | 49.637 | 2015-06-24 21:41:00 | Daylight | Ring VNH | 250 | 32 | ... | 0.57785 | 0.67135 | 5.76987 | 0.00000 | 587 | 245 | 0.449345 | 0.688347 | 0 | 22 |
33 | IOS2015018000301 | Tidal Mixed | 59 | -123.244 | 48.630 | 2015-06-25 04:55:00 | Daylight | SCOR VNH | 236 | 151 | ... | 0.15325 | 1.04130 | 0.73676 | 0.00000 | 331 | 242 | 0.302414 | 0.548781 | 0 | 28 |
34 | IOS2015018001501 | Juan de Fuca | 72 | -124.067 | 48.311 | 2015-06-25 21:56:00 | Daylight | SCOR VNH | 236 | 171 | ... | 0.17342 | 0.02021 | 0.28119 | 0.00000 | 329 | 82 | 0.144993 | 0.381645 | 0 | 29 |
35 | IOS2015018002801 | Tidal Mixed | 63 | -122.976 | 48.244 | 2015-06-26 08:46:00 | Night | SCOR VNH | 236 | 144 | ... | 0.06949 | 0.50700 | 11.33600 | 0.00000 | 238 | 234 | 0.270909 | 0.616372 | 0 | 28 |
36 | IOS2015018003501 | Gulf Islands | 52 | -123.025 | 48.773 | 2015-06-26 17:08:00 | Daylight | SCOR VNH | 236 | 203 | ... | 0.27303 | 0.63049 | 2.91797 | 0.00000 | 344 | 292 | 0.260919 | 0.516593 | 0 | 30 |
37 | IOS2015018004801 | Central Strait of Georgia | 42 | -123.437 | 49.030 | 2015-06-27 03:01:00 | Daylight | SCOR VNH | 236 | 312 | ... | 0.21688 | 0.14958 | 1.43429 | 0.00000 | 422 | 263 | 0.156038 | 0.311815 | 0 | 34 |
38 | IOS2015018005801 | Central Strait of Georgia | GEO1 | -123.748 | 49.250 | 2015-06-27 09:54:00 | Night | SCOR VNH | 236 | 395 | ... | 1.38083 | 0.40716 | 0.41838 | 0.00000 | 487 | 245 | 0.079141 | 0.164747 | 0 | 37 |
39 | IOS2015018006901 | Central Strait of Georgia | CPF1 | -124.086 | 49.366 | 2015-06-27 18:33:00 | Daylight | SCOR VNH | 236 | 231 | ... | 1.15273 | 0.20288 | 0.38883 | 0.00000 | 534 | 210 | 0.104848 | 0.246499 | 0 | 31 |
40 | IOS2015018007401 | Northern Strait of Georgia | CPF2 | -124.500 | 49.467 | 2015-06-27 22:22:00 | Daylight | SCOR VNH | 236 | 325 | ... | 1.27439 | 0.30115 | 2.72906 | 0.00000 | 583 | 162 | 0.088338 | 0.207112 | 0 | 35 |
41 | IOS2015018007501 | Baynes Sound | BS1 | -124.763 | 49.480 | 2015-06-27 23:40:00 | Daylight | SCOR VNH | 236 | 61 | ... | 0.69324 | 0.58465 | 13.15498 | 0.10440 | 604 | 125 | 0.401219 | 0.796621 | 0 | 24 |
42 | IOS2015018008401 | Northern Strait of Georgia | 11 | -124.724 | 49.707 | 2015-06-28 06:15:00 | Daylight | SCOR VNH | 236 | 298 | ... | 1.06781 | 0.23454 | 0.10399 | 0.00000 | 646 | 159 | 0.118683 | 0.252703 | 0 | 34 |
43 | IOS2015018008701 | Northern Strait of Georgia | 14 | -124.994 | 49.884 | 2015-06-28 09:57:00 | Night | SCOR VNH | 236 | 313 | ... | 0.64792 | 0.41158 | 0.15437 | 0.00000 | 699 | 141 | 0.100846 | 0.233627 | 0 | 34 |
44 | IOS2015018010001 | Northern Strait of Georgia | 22 | -124.271 | 49.670 | 2015-06-29 02:59:00 | Daylight | SCOR VNH | 236 | 347 | ... | 1.20016 | 0.33240 | 0.40017 | 0.00000 | 606 | 221 | 0.053246 | 0.155823 | 0 | 35 |
45 rows × 26 columns