Created At: 2026-06-14T13:53:05Z
Completed At: 2026-06-14T13:53:05Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4581
Total Bytes: 193572
Showing lines 4280 to 4420
The following code has been modified to include a line number before every line, in the format: <line_number>: <original_line>. Please note that any changes targeting the original code should remove the line number, colon, and leading space.
4280:           }
4281:           parsedRows.push(row);
4282:         }
4283:         return parsedRows;
4284:       }
4285: 
4286:       // Check if this is the stacked format with columns: year, scenario, variable, areal_averaged_ensmean...
4287:       const headers = firstLine.split(separator).map(h => h.trim().replace(/^["']|["']$/g, '').toLowerCase());
4288:       const yearIdx = headers.findIndex(h => h.includes('year') || h.includes('tahun') || h === 't' || h === 'yr' || h === 'y');
4289:       
4290:       if (yearIdx === -1) {
4291:         return [];
4292:       }
4293: 
4294:       const scenarioIdx = headers.findIndex(h => h === 'scenario' || h === 'skenario');
4295:       const meanIdx = headers.findIndex(h => h.includes('ensmean') || h.includes('mean'));
4296:       
4297:       if (scenarioIdx !== -1 && meanIdx !== -1) {
4298:         // Format B: Stacked CSV rows by scenario/variable
4299:         const medianIdx = headers.findIndex(h => h.includes('ensmedian') || h.includes('median'));
4300:         const minIdx = headers.findIndex(h => h.includes('ensmin') || h.includes('min') || h.includes('bawah'));
4301:         const maxIdx = headers.findIndex(h => h.includes('ensmax') || h.includes('max') || h.includes('atas'));
4302:         const variableIdx = headers.findIndex(h => h === 'variable' || h === 'variabel');
4303: 
4304:         const activeVarEl = document.getElementById('futureSetVariableGraph') || document.getElementById('futureVariableTS');
4305:         const activeVar = activeVarEl ? activeVarEl.value.trim().toLowerCase() : '';
4306:    
<truncated 6068 bytes>
400:         
4401:         // SSP1
4402:         if (ssp1Idx !== -1 && cols[ssp1Idx] !== undefined) row.ssp1 = cols[ssp1Idx] !== '' ? parseFloat(cols[ssp1Idx]) : null;
4403:         if (ssp1MinIdx !== -1 && cols[ssp1MinIdx] !== undefined) row.ssp1_min = cols[ssp1MinIdx] !== '' ? parseFloat(cols[ssp1MinIdx]) : null;
4404:         if (ssp1MaxIdx !== -1 && cols[ssp1MaxIdx] !== undefined) row.ssp1_max = cols[ssp1MaxIdx] !== '' ? parseFloat(cols[ssp1MaxIdx]) : null;
4405: 
4406:         // SSP2
4407:         if (ssp2Idx !== -1 && cols[ssp2Idx] !== undefined) row.ssp2 = cols[ssp2Idx] !== '' ? parseFloat(cols[ssp2Idx]) : null;
4408:         if (ssp2MinIdx !== -1 && cols[ssp2MinIdx] !== undefined) row.ssp2_min = cols[ssp2MinIdx] !== '' ? parseFloat(cols[ssp2MinIdx]) : null;
4409:         if (ssp2MaxIdx !== -1 && cols[ssp2MaxIdx] !== undefined) row.ssp2_max = cols[ssp2MaxIdx] !== '' ? parseFloat(cols[ssp2MaxIdx]) : null;
4410: 
4411:         // SSP3
4412:         if (ssp3Idx !== -1 && cols[ssp3Idx] !== undefined) row.ssp3 = cols[ssp3Idx] !== '' ? parseFloat(cols[ssp3Idx]) : null;
4413:         if (ssp3MinIdx !== -1 && cols[ssp3MinIdx] !== undefined) row.ssp3_min = cols[ssp3MinIdx] !== '' ? parseFloat(cols[ssp3MinIdx]) : null;
4414:         if (ssp3MaxIdx !== -1 && cols[ssp3MaxIdx] !== undefined) row.ssp3_max = cols[ssp3MaxIdx] !== '' ? parseFloat(cols[ssp3MaxIdx]) : null;
4415: 
4416:         // SSP5
4417:         if (ssp5Idx !== -1 && cols[ssp5Idx] !== undefined) row.ssp5 = cols[ssp5Idx] !== '' ? parseFloat(cols[ssp5Idx]) : null;
4418:         if (ssp5MinIdx !== -1 && cols[ssp5MinIdx] !== undefined) row.ssp5_min = cols[ssp5MinIdx] !== '' ? parseFloat(cols[ssp5MinIdx]) : null;
4419:         if (ssp5MaxIdx !== -1 && cols[ssp5MaxIdx] !== undefined) row.ssp5_max = cols[ssp5MaxIdx] !== '' ? parseFloat(cols[ssp5MaxIdx]) : null;
4420:         
The above content does NOT show the entire file contents. If you need to view any lines of the file which were not shown to complete your task, call this tool again to view those lines.
