Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app-chart/values.yaml.tcram
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ webapp:
fqdnAPI: api.tcram.k8s.ucar.edu
secretName: incommon-cert-tcram-gdex-webserver
container:
image: hub.k8s.ucar.edu/tcram-gdex/gdex-web-portal:v29534790082
image: hub.k8s.ucar.edu/tcram-gdex/gdex-web-portal:v29606121846
port: 8080
requests:
memory: 4Gi
Expand Down
120 changes: 113 additions & 7 deletions datasets/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ def __init__(self, *args, **kwargs):
)

# ------------------------------------------------------------------
# Station IDs (comma-separated list of 5-digit WMO numbers)
# Station IDs (comma-separated list of 5 or 6 digit WMO numbers)
# ------------------------------------------------------------------
station0 = forms.CharField(
required=False,
max_length=5,
label='Station 1',
stationIDs = forms.CharField(
required=False,
min_length=5,
label='Station IDs (comma-separated)',
widget=forms.Textarea(attrs={
'class': 'form-control stns',
'rows': '4', 'tabindex': '1'
}),
'rows': '4',
'tabindex': '1',
'id': 'stationIDs',
}),
)

# ------------------------------------------------------------------
Expand Down Expand Up @@ -169,6 +171,110 @@ def clean(self):
raise forms.ValidationError('Start date must not be later than end date.')
return cleaned

class ISPDSubsetForm(forms.Form):
""" ISPD subset form for dataset d132002 """

SPATIAL_CHOICES = [
('-1', 'Choose a spatial subset preference'),
('0', 'Select latitude/longitude region via map'),
('1', 'Select location by station ID'),
('2', 'Select location by location name'),
]
OBSERVATION_TYPE_CHOICES = [
('RADIOSONDE', 'Radiosonde observations'),
('DROPSONDE', 'Dropsonde observations'),
('MARINE', 'Marine observations'),
('SFC_STATION', 'Surface station observations'),
('TC_BEST_TRACK', 'Tropical Cyclone Best Track observations'),
]
COMPRESSION_CHOICES = [
('gz', '.gz (Gzip)'),
('None', 'No compression'),
]

def __init__(self, *args, **kwargs):
self.dsid = kwargs.pop('dsid', None)
super(ISPDSubsetForm, self).__init__(*args, **kwargs)

start_date = forms.DateField(
required=False,
label='Start Date',
input_formats=['%Y-%m-%d'],
widget=forms.TextInput(attrs={
'placeholder': 'YYYY-MM-DD',
'size': '10',
'maxlength': '10'
}
),
)
end_date = forms.DateField(
required=False,
label='End Date',
input_formats=['%Y-%m-%d'],
widget=forms.TextInput(attrs={
'placeholder': 'YYYY-MM-DD',
'size': '10',
'maxlength': '10'
}
),
)
grid_selection = forms.ChoiceField(
required=True,
choices=SPATIAL_CHOICES,
label='Spatial Subset Preference',
widget=forms.Select(attrs={
'class': 'custom-select',
'id': 'gridSelectionMenu',
'onchange': 'displayGridSelection(document.form.grid_selection.value)'
}
),
)
station_ids = forms.CharField(
required=False,
min_length=5,
label='Station IDs (comma-separated)',
widget=forms.Textarea(attrs={
'class': 'form-control stns',
'rows': '4',
'tabindex': '1',
'id': 'stationIDs'
}
),
)
location_names = forms.CharField(
required=False,
label='Location Names (comma-separated)',
widget=forms.Textarea(attrs={
'class': 'form-control locs',
'rows': '4',
'tabindex': '1',
'id': 'locationNames'
}
),
)
observation_types = forms.MultipleChoiceField(
required=False,
choices=OBSERVATION_TYPE_CHOICES,
label='Observation Types',
widget=forms.CheckboxSelectMultiple(attrs={'class': 'form-check-input'}),
)

dsid = forms.CharField(widget=forms.HiddenInput, required=False)
gindex = forms.IntegerField(widget=forms.HiddenInput, required=False, initial=1)
rtype = forms.CharField(widget=forms.HiddenInput, required=False, initial='T')
tlat = forms.CharField(widget=forms.HiddenInput, required=False)
blat = forms.CharField(widget=forms.HiddenInput, required=False)
llon = forms.CharField(widget=forms.HiddenInput, required=False)
rlon = forms.CharField(widget=forms.HiddenInput, required=False)

def clean(self):
cleaned = super().clean()
start = cleaned.get('startDate')
end = cleaned.get('endDate')
if start and end and start > end:
raise forms.ValidationError('Start date must not be later than end date.')
return cleaned

def validate_dsid(value):
if not re.match(r'^[a-z]{1}[0-9]{6}$', value):
raise forms.ValidationError("Dataset ID format must be 'd123456'.")
Expand Down
17 changes: 2 additions & 15 deletions datasets/static/datasets/js/BUFR_subset.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function checkStations()
// check stations
countValid = 0; // Count the valid entries

stationInput = document.getElementById("station0").value;
stationInput = document.getElementById("stationIDs").value;
if (stationInput == "" || stationInput == null) {
alert("Please enter at least one station ID or select a different spatial range option.");
return false;
Expand Down Expand Up @@ -514,19 +514,6 @@ function checkParameters()
return true;
}

/**
* function to show/hide google map
*/
function displayGoogleMap(act)
{
if(act == 1) {
$("#mapselect").show();
} else {
setSpaceValues();
$("#mapselect").hide();
}
}

/**
* function to show appropriate spatial subsetting selection
*/
Expand All @@ -540,7 +527,7 @@ function displayGridSelection(value)

// Google map lat/lon selection
if (value == 0) {
displayGoogleMap(1);
$("#mapselect").show();
$("#stationSelect").hide();
}

Expand Down
Loading