In [1]:
# Reload when code changed:
%load_ext autoreload
%autoreload 2
%pwd


Out[1]:
'D:\\Utveckling\\GitHub\\ekostat_calculator'

In [2]:
import os 
import core
import importlib
importlib.reload(core) 
import pandas as pd
pd.__version__


Out[2]:
'0.19.2'

Load directories


In [3]:
root_directory = os.getcwd()
workspace_directory = root_directory + '/workspaces' 
resource_directory = root_directory + '/resources'

LOAD WORKSPACES

Load default workspace


In [4]:
default_workspace = core.WorkSpace(name='default', 
                                   parent_directory=workspace_directory, 
                                   resource_directory=resource_directory)


====================================================================================================
Initiating WorkSpace: D:/Utveckling/GitHub/ekostat_calculator/workspaces/default
----------------------------------------------------------------------------------------------------
Initiating Subset: D:/Utveckling/GitHub/ekostat_calculator/workspaces/default/subsets/A
step_list ['step_1']
Initiating WorkStep: D:/Utveckling/GitHub/ekostat_calculator/workspaces/default/subsets/A/step_1
Initiating WorkStep: D:/Utveckling/GitHub/ekostat_calculator/workspaces/default/step_0

Add new workspace


In [5]:
lv_workspace = core.WorkSpace(name='lv', 
                              parent_directory=workspace_directory, 
                              resource_directory=resource_directory)


====================================================================================================
Initiating WorkSpace: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv
----------------------------------------------------------------------------------------------------
Initiating Subset: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/subsets/A
step_list []
Initiating WorkStep: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/step_0

Copy files from default workspace to make a clone


In [6]:
lv_workspace.add_files_from_workspace(default_workspace, overwrite=True)


Initiating WorkStep: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/step_0
Given subset is already present!
step: step_1
Initiating WorkStep: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/subsets/A/step_1

Load all data in lv_workspace


In [7]:
lv_workspace.load_all_data()


C:\Continuum\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2881: DtypeWarning: Columns (8,34,35,37,42,44,45,49,51,52,54,55,56) have mixed types. Specify dtype option on import or set low_memory=False.
  exec(code_obj, self.user_global_ns, self.user_ns)
Sorting..
Reseting and Droping INDEX
Saving data to: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/input_data/exports/Column_format_PhysicalChemical_data.txt
C:\Continuum\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2881: DtypeWarning: Columns (13,37,41,43,50,53,59,79,81,82,83) have mixed types. Specify dtype option on import or set low_memory=False.
  exec(code_obj, self.user_global_ns, self.user_ns)
Saving data to: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/input_data/exports/Column_format_Zoobenthos_data.txt
Saving data to: D:/Utveckling/GitHub/ekostat_calculator/workspaces/lv/input_data/exports/all_data.txt

Set first filter and load filtered data

Set first data filter


In [8]:
# show available waterbodies
workspace_data = lv_workspace.data_handler.get_all_column_data_df()
lst = workspace_data.WATER_TYPE_AREA.unique()
print('Type Areas in dataset:\n{}'.format('\n'.join(lst)))


Type Areas in dataset:
04 - Västkustens yttre kustvatten. Kattegatt
01s - Västkustens inre kustvatten
03 - Västkustens yttre kustvatten. Skagerrak
01n - Västkustens inre kustvatten
02 - Västkustens fjordar
25 - Göta älvs- och Nordre älvs estuarie

21 - Norra Kvarkens yttre kustvatten
20 - Norra Kvarkens inre kustvatten
23 - Norra Bottenviken. Yttre kustvatten
22 - Norra Bottenviken. Inre kustvatten
05 - Södra Hallands och norra Öresunds kustvatten
12n - Östergötlands och Stockholms skärgård. Mellankustvatten
06 - Öresunds kustvatten
18 - Norra Bottenhavet. Höga kusten. Inre kustvatten
17 - Södra Bottenhavet. Yttre kustvatten
15 - Stockholms skärgård. Yttre kustvatten
16 - Södra Bottenhavet. Inre kustvatten
14 - Östergötlands yttre kustvatten
19 - Norra Bottenhavet. Höga kusten. Yttre kustvatten
10 - Ölands och Gotlands kustvatten
07 - Skånes kustvatten
11 - Gotlands nordvästra kustvatten

In [9]:
lst = workspace_data.SEA_AREA_NAME.unique()
print('Waterbodies in dataset:\n{}'.format('\n'.join(lst)))


Waterbodies in dataset:
Onsala kustvatten
Dana fjord
Marstrandsfjorden
Älgöfjorden
Yttre Brofjorden
Kungshamn s skärgård
S Kosterfjorden
Gullmarn centralbassäng
Koljö fjord
Havstensfjorden
Byfjorden
Halsefjorden
Rivö fjord

Del av n Kattegatts utsjövatten
Del av Skagerraks utsjövatten
N m Hallands kustvatten
Del av s Kattegatts utsjövatten
Färlevfjorden
Kalvöfjorden
Stigfjorden
Askeröfjorden
Ellösefjorden
Snäckedjupet
Brofjorden
Fjällbacka inre skärgård
Hunnebostrand skärgård
Bottnefjorden
Trälebergskile
Åbyfjorden
Göteborgs n n skärgårds kustvatten
S n Kvarkens kustvatten
N n Kvarkens kustvatten
Saltkällefjorden
Yttre Täftefjärden
Täftefjärden
Skelleftebukten
Simpan
Singlefjorden
Lindöfjorden sek namn
Norrbottens skärgårds kustvatten
Kinnbäcksfjärden
Strömstadsfjorden
Sörbrändöfjärden
Laholmsbukten
Skälderviken
Gussöfjärden
Rånefjärden
Bodöfjärden
Dragviksfjärden
Seskaröfjärden
Kråkfjärden
Helsingborgsområdet
Gaviksfjärden
Öregrunds kustvatten
Björkskärsfjärden
Laholmsbuktens kustvatten
Balgöarkipelagen
Klosterfjorden
S m Hallands kustvatten
Kasfjärden sek namn
Ängsfjärden sek namn
Inre Kungsbackafjorden
Yttre Kungsbackafjorden
Långvindsfjärden
Varren
Vändelsöarkipelagen
Skärsåfjärden sek namn
Krabbfjärden
N Höga kustens kustvatten
Kräklingeområdet
Kyrkefjälls sund
Risö-Säröarkipelagen
Öckerösund
Mysingen
M Bohusläns skärgårds kustvatten
Ö Gotlands n kustvatten
V Hanöbuktens kustvatten
M n Bohusläns skärgårds kustvatten
Örefjärden
n Långebyområdet
Ö Gotlands s kustvatten
Sotefjorden
Fjällbacka yttre skärgård
Hake fjord
Göteborgs n skärgårds kustvatten
Göteborgs s skärgårds kustvatten
V Gotlands m kustvatten
Askims fjord
Klintehamnsviken sek namn
Bråvikens kustvatten

In [10]:
include_WB = ['Gullmarn centralbassäng', 'Rivö fjord', 'Byfjorden', 'Havstensfjorden']
include_stations = [] 
exclude_stations = []
include_years = ['2015', '2017'] 

lv_workspace.set_data_filter(step=0, filter_type='include_list', filter_name='SEA_AREA_NAME', data=include_WB)
lv_workspace.set_data_filter(step=0, filter_type='include_list', filter_name='STATN', data=include_stations) 
lv_workspace.set_data_filter(step=0, filter_type='exclude_list', filter_name='STATN', data=exclude_stations) 
lv_workspace.set_data_filter(step=0, filter_type='include_list', filter_name='MYEAR', data=include_years)


sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_myear.fil"
2015
2016
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_sea_area_name.fil"
Byfjorden
Gullmarn centralbassäng
Havstensfjorden
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_statn.fil"
SK36
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_water_type_area.fil"
sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_myear.fil"
2015
2016
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_sea_area_name.fil"
Byfjorden
Gullmarn centralbassäng
Havstensfjorden
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_water_type_area.fil"
sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_myear.fil"
2015
2016
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_sea_area_name.fil"
Byfjorden
Gullmarn centralbassäng
Havstensfjorden
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_water_type_area.fil"
sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_myear.fil"
2015
2017
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_sea_area_name.fil"
Byfjorden
Gullmarn centralbassäng
Havstensfjorden
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/step_0/data_filters/list_include_water_type_area.fil"

Apply first data filter


In [11]:
lv_workspace.apply_first_filter() # This sets the first level of data filter in the IndexHandler


Out[11]:
True

Extract filtered data


In [12]:
data_after_first_filter = lv_workspace.get_filtered_data(level=0) # level=0 means first filter 
print('{} rows mathing the filter criteria'.format(len(data_after_first_filter)))
data_after_first_filter.head()


1055 rows mathing the filter criteria
Out[12]:
AMON CPHL DEPH DOXY_BTL DOXY_CTD LATIT_DD LONGI_DD MNDEP MXDEP MYEAR ... SERNO SHARKID_MD5 SHIPC STATN STIME TEMP_BTL TEMP_CTD WATER_DISTRICT WATER_TYPE_AREA WLTYP
55 1.14 0.8 0.5 7.0 58.39333 11.62667 NaN NaN 2015 ... 8.0 NaN 7719 BJÖRKHOLMEN 08:45 4.6 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
56 1.21 1.0 2.0 7.3 58.39333 11.62667 NaN NaN 2015 ... 8.0 NaN 7719 BJÖRKHOLMEN 08:45 4.6 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
57 1.07 0.75 5.0 7.6 58.39333 11.62667 NaN NaN 2015 ... 8.0 NaN 7719 BJÖRKHOLMEN 08:45 4.9 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
58 0.93 0.91 10.0 6.7 58.39333 11.62667 NaN NaN 2015 ... 8.0 NaN 7719 BJÖRKHOLMEN 08:45 5.5 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
59 0.47 0.27 15.0 6.4 58.39333 11.62667 NaN NaN 2015 ... 8.0 NaN 7719 BJÖRKHOLMEN 08:45 7.0 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM

5 rows × 44 columns

Set subset filter and load subset data

Set subset filter


In [13]:
include_WB = ['Gullmarn centralbassäng', 'Rivö fjord']
include_stations = ['BJÖRKHOLMEN'] 
# Lägg till något som kan plocka in stationer öven ifrån närliggande WB?
exclude_stations = ['SLÄGGÖ'] # Example that both include and exclude are possible 
include_years = ['2016', '2017']  

lv_workspace.set_data_filter(step=1, subset='A', filter_type='include_list', filter_name='SEA_AREA_NAME', data=include_WB)
lv_workspace.set_data_filter(step=1, subset='A', filter_type='include_list', filter_name='STATN', data=include_stations)
lv_workspace.set_data_filter(step=1, subset='A', filter_type='exclude_list', filter_name='STATN', data=exclude_stations)
lv_workspace.set_data_filter(step=1, subset='A', filter_type='include_list', filter_name='MYEAR', data=include_years)


sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_myear.fil"
2015
2016
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_sea_area_name.fil"
Gullmarn centralbassäng
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_statn.fil"
BJÖRKHOLMEN
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_water_type_area.fil"
sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_myear.fil"
2015
2016
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_sea_area_name.fil"
Gullmarn centralbassäng
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_statn.fil"
BJÖRKHOLMEN
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_water_type_area.fil"
sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_myear.fil"
2015
2016
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_sea_area_name.fil"
Gullmarn centralbassäng
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_statn.fil"
BJÖRKHOLMEN
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_water_type_area.fil"
sdfs
dict_keys(['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_sea_area_name.fil"
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_statn.fil"
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_exclude_water_type_area.fil"
dict_keys(['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'])
Save: "MYEAR" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_myear.fil"
2016
2017
Save: "SEA_AREA_NAME" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_sea_area_name.fil"
Gullmarn centralbassäng
Rivö fjord
Save: "STATN" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_statn.fil"
BJÖRKHOLMEN
Save: "WATER_TYPE_AREA" to file: "D:/github/ekostat_calculator/workspaces/lv/subsets/A/step_1/data_filters/list_include_water_type_area.fil"

In [ ]:

Apply subset filter


In [15]:
lv_workspace.apply_subset_filter(subset='A') # Not handled properly by the IndexHandler


Out[15]:
True

Extract filtered data


In [16]:
data_after_subset_filter = lv_workspace.get_filtered_data(level=1, subset='A') # level=0 means first filter 
print('{} rows mathing the filter criteria'.format(len(data_after_subset_filter)))
data_after_subset_filter.head()


198 rows mathing the filter criteria
Out[16]:
AMON CPHL DEPH DOXY_BTL DOXY_CTD LATIT_DD LONGI_DD MNDEP MXDEP MYEAR ... SERNO SHARKID_MD5 SHIPC STATN STIME TEMP_BTL TEMP_CTD WATER_DISTRICT WATER_TYPE_AREA WLTYP
2629 0.76 0.6 0.0 7.05 58.38767 11.62667 NaN NaN 2017 ... 8.0 NaN 77SN BJÖRKHOLMEN 17:30 4.96 4.84 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
2630 0.72 0.5 2.0 7.12 58.38767 11.62667 NaN NaN 2017 ... 8.0 NaN 77SN BJÖRKHOLMEN 17:30 4.93 4.84 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
2631 0.74 0.6 5.0 7.16 58.38767 11.62667 NaN NaN 2017 ... 8.0 NaN 77SN BJÖRKHOLMEN 17:30 4.88 4.84 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
2632 0.65 0.5 10.0 7.11 58.38767 11.62667 NaN NaN 2017 ... 8.0 NaN 77SN BJÖRKHOLMEN 17:30 5.12 4.86 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM
2633 0.46 0.3 15.0 6.86 58.38767 11.62667 NaN NaN 2017 ... 8.0 NaN 77SN BJÖRKHOLMEN 17:30 5.52 5.1 Västerhavets vattendistrikt 02 - Västkustens fjordar 2 - Havsområde innanför 1 NM

5 rows × 44 columns


In [ ]:


In [17]:
import numpy as np
np.where(lv_workspace.index_handler.subset_filter)


Out[17]:
(array([1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388,
        1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488,
        1707, 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717,
        1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825,
        1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905,
        1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
        2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116,
        2214, 2215, 2216, 2217, 2218, 2219, 2220, 2221, 2222, 2223, 2224,
        2311, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319, 2320, 2321,
        2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429,
        2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2536, 2537,
        2629, 2630, 2631, 2632, 2633, 2634, 2635, 2636, 2637, 2638, 2639,
        2754, 2755, 2756, 2757, 2758, 2759, 2760, 2761, 2762, 2763, 2764,
        2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880,
        2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962,
        3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087,
        3185, 3186, 3187, 3188, 3189, 3190, 3191, 3192, 3193, 3194, 3195,
        3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292,
        3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419,
        3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503,
        3624, 3625, 3626, 3627, 3628, 3629, 3630, 3631, 3632, 3633, 3634,
        3717, 3718, 3719, 3720, 3721, 3722, 3723, 3724, 3725, 3726, 3727,
        3859, 3860, 3861, 3862, 3863, 3864, 3865, 3866, 3867, 3868, 3869,
        3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 3988, 3989,
        4110, 4111, 4112, 4113, 4114, 4115, 4116, 4117, 4118, 4119, 4120,
        4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 4274, 4275,
        4354, 4355, 4356, 4357, 4358, 4359, 4360, 4361, 4362, 4363, 4364,
        4502, 4503, 4504, 4505, 4506, 4507, 4508, 4509, 4510, 4511, 4512,
        4806, 4807, 4808, 4809, 4810, 4811, 4812, 4813, 4814, 4815, 4816,
        4933, 4934, 4935, 4936, 4937, 4938, 4939, 4940, 4941, 4942, 4943,
        5073, 5074, 5075, 5076, 5077, 5078, 5079, 5080, 5081, 5082, 5083,
        5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224,
        5343, 5344, 5345, 5346, 5347, 5348, 5349, 5350, 5351, 5352, 5353,
        5599, 5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609,
        5780, 5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789, 5790,
        5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966, 5967, 5968,
        6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086,
        6216, 6217, 6218, 6219, 6220, 6221, 6222, 6223, 6224, 6225, 6226,
        6530, 6531, 6532, 6533, 6534, 6535, 6536, 6537, 6538, 6539, 6540,
        6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6789, 6790, 6791], dtype=int64),)

In [18]:
f = lv_workspace.get_data_filter_object(step=1, subset='A')

In [19]:
f.all_filters


Out[19]:
{'exclude_list': ['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'],
 'include_list': ['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA']}

In [20]:
f.exclude_list_filter


Out[20]:
{'SEA_AREA_NAME': [], 'STATN': ['SLÄGGÖ'], 'WATER_TYPE_AREA': []}

In [21]:
f.include_list_filter


Out[21]:
{'MYEAR': ['2016', '2017'],
 'SEA_AREA_NAME': ['Gullmarn centralbassäng', 'Rivö fjord'],
 'STATN': ['BJÖRKHOLMEN'],
 'WATER_TYPE_AREA': []}

In [22]:
s = lv_workspace.get_step_1_object('A')

In [23]:
s.data_filter.all_filters


Out[23]:
{'exclude_list': ['SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA'],
 'include_list': ['MYEAR', 'SEA_AREA_NAME', 'STATN', 'WATER_TYPE_AREA']}

In [24]:
f0 = lv_workspace.get_data_filter_object(step=0)

In [25]:
f0.exclude_list_filter


Out[25]:
{'SEA_AREA_NAME': [], 'STATN': [], 'WATER_TYPE_AREA': []}

In [26]:
f0.include_list_filter


Out[26]:
{'MYEAR': ['2015', '2017'],
 'SEA_AREA_NAME': ['Byfjorden',
  'Gullmarn centralbassäng',
  'Havstensfjorden',
  'Rivö fjord'],
 'STATN': [],
 'WATER_TYPE_AREA': []}

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: