Introduction

The McIdasArea files format is available at Space Science and Engineering Center. Basically each McIdas Area file is a binary file containing several header blocks followed by a data block. The values in the datablock are for MinoSil 4-byte big endian integers.

Julian day conversion for MinoSil

The data files for Minosil differ slightly from the 2006 specifications. Instead they use the function below for calculating the day. The first header block is the directory block, which contains 64 integers. The following snippet illustrates how the datestamp is calculated from a pair of integers starting at the specified offset.

    final static int[] CUMULATIVE_DAYS = {31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365,
            31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366};

    private long getDate(int offset) {
        int julianYYYDDD = (int) getVariable(offset);
        int years = (julianYYYDDD / 1000) % 10000;
        if (years < 1000) {
                years += (years < 70) ? 2000 : 1900; 
        }
        int days = julianYYYDDD % 1000;
        int monthIndex = ((years % 4) == 0) ? 12 : 0;
        while (days > CUMULATIVE_DAYS[monthIndex]) monthIndex++;
        int month = (monthIndex + 1) % 12;
        if (month == 0) month = 12;
        
        int dayOfMonth = days;
        if (month > 1) {
            dayOfMonth -= CUMULATIVE_DAYS[monthIndex - 1];
        }
        String timeString = "" + getIntVariable(offset + 1);
        int length = 6 - timeString.length();
        for (int i = 0; i < length; i++) {
            timeString = "0" + timeString;
        }
        int hours = Integer.parseInt(timeString.substring(0, 2));
        int minutes = Integer.parseInt(timeString.substring(2, 4));
        int seconds = Integer.parseInt(timeString.substring(4, 6));
        return DateUtils.getTime(years, month, dayOfMonth, hours, minutes, seconds);
    }
Sample import configuration
<?xml version="1.0" encoding="UTF-8"?>
<idMap  version="1.1" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/idMap.xsd">
<map internalParameter="P.radar.actual" internalLocation="Radar2000" externalParameter="none" externalLocation="none"/>
</idMap>
Sample import run configuration
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
<import>
<general>
<importType>McIDASArea</importType>
<folder>$IMPORT_FOLDER$/Radar</folder>

<idMapId>ImportRadar</idMapId>
<unitConversionsId>ImportUnitConversions</unitConversionsId>
</general>
<timeSeriesSet>
<moduleInstanceId>ImportRadar</moduleInstanceId>
<valueType>grid</valueType>
<parameterId>P.radar.actual</parameterId>
<locationId>Radar2000</locationId>
<timeSeriesType>external historical</timeSeriesType>
<timeStep unit="minute" multiplier="60"/>
<readWriteMode>add originals</readWriteMode>
<synchLevel>6</synchLevel>
</timeSeriesSet>
<externUnit unit="0.001 mm" parameterId="P.radar.actual"/>
</import>
</timeSeriesImportRun>
Sample grids configuration
<grids xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/grids.xsd">
<regular locationId="Radar2000">
<rows>760</rows>
<columns>760</columns>
<lambertConformalConic>
<originLatitude>0</originLatitude>
<originLongitude>0</originLongitude>
<firstStandardParallelLatitude>33.5</firstStandardParallelLatitude>
<secondStandardParallelLatitude>46.5</secondStandardParallelLatitude>
</lambertConformalConic>
<firstCellCenter>
<x>-1012857.84</x>
<y>5541058.269</y>
</firstCellCenter>
<xCellSize>2000</xCellSize>
<yCellSize>2000</yCellSize>
</regular>
...
  • No labels