# Generated by Django 2.1 on 2018-10-09 18:10

from django.db import migrations

def init_filters(apps, schema_editor):
    DataFilter = apps.get_model('validator', 'DataFilter')
    filters = (
        {'id': 1, 'name': 'FIL_ALL_VALID_RANGE', 'description': 'Variable in valid range (> 0 and < 100%)', 'help_text': 'Compared variable is checked for NaNs and invalid values.'},
        {'id': 2, 'name': 'FIL_ISMN_GOOD', 'description': 'Quality flag is "good" (G)', 'help_text': 'Soil moisture quality flag is "G" for good.'},
        {'id': 3, 'name': 'FIL_C3S_FLAG_0', 'description': 'Data with no inconsistencies detected (flag = 0)', 'help_text': 'Data flag = 0 indicates good data, no inconsistencies detected'},
        {'id': 4, 'name': 'FIL_C3S_NO_FLAG_1', 'description': 'Not freezing and no snow-cover (flag != 1)', 'help_text': 'Data flag != 1 indicates temperature > 0 C and no snow cover'},
        {'id': 5, 'name': 'FIL_C3S_NO_FLAG_2', 'description': 'No dense vegetation (flag != 2)', 'help_text': 'Data flag != 2 indicates no places with dense vegetation'},
        {'id': 6, 'name': 'FIL_C3S_MODE_ASC', 'description': 'Ascending mode only', 'help_text': 'Data captured when satellite was ascending'},
        {'id': 7, 'name': 'FIL_C3S_MODE_DESC', 'description': 'Descending mode only', 'help_text': 'Data captured when satellite was descending'},
        {'id': 8, 'name': 'FIL_C3S_UNCERT', 'description': 'Soil moisture uncertainty < TODO_TRACY', 'help_text': 'Uncertainty value is below recommended threshold'},
        {'id': 9, 'name': 'FIL_GLDAS_UNFROZEN', 'description': 'Soil not frozen and no snow-cover', 'help_text': 'Corresponding depth soil temperature > 1.0 C and Snow depth water equivalent < 0.001'},
        )
    for f in filters:
        fil = DataFilter(**f)
        fil.save()

class Migration(migrations.Migration):

    dependencies = [
        ('validator', '0007_datafilter_name'),
    ]

    operations = [
        migrations.RunPython(init_filters),
    ]
