mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
add SC radar data support
This commit is contained in:
parent
04ac485574
commit
221fca14f2
@ -67,7 +67,7 @@ import java.util.zip.ZipInputStream;
|
||||
public static String getVersion(){
|
||||
String version = GlobalUtil.class.getPackage().getImplementationVersion();
|
||||
if (version == null || version.equals("")) {
|
||||
version = "3.8.8";
|
||||
version = "3.8.9";
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class CCRadarDataInfo extends BaseRadarDataInfo implements IRadarDataInfo
|
||||
|
||||
@Override
|
||||
public RadarDataType getRadarDataType() {
|
||||
return RadarDataType.SAB;
|
||||
return RadarDataType.CC;
|
||||
}
|
||||
|
||||
static class RadialHeader {
|
||||
|
||||
@ -117,9 +117,9 @@ public class RadarDataUtil {
|
||||
case SAB:
|
||||
return new SABRadarDataInfo();
|
||||
/*case CC:
|
||||
return new CCRadarDataInfo();
|
||||
return new CCRadarDataInfo();*/
|
||||
case SC:
|
||||
return new SCRadarDataInfo();*/
|
||||
return new SCRadarDataInfo();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,34 +1,428 @@
|
||||
package org.meteoinfo.data.meteodata.radar;
|
||||
|
||||
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
|
||||
import org.meteoinfo.data.dimarray.Dimension;
|
||||
import org.meteoinfo.data.meteodata.Attribute;
|
||||
import org.meteoinfo.data.meteodata.DataInfo;
|
||||
import org.meteoinfo.ndarray.Array;
|
||||
import org.meteoinfo.ndarray.DataType;
|
||||
import org.meteoinfo.ndarray.math.ArrayUtil;
|
||||
|
||||
import java.io.RandomAccessFile;
|
||||
import java.io.*;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SCRadarDataInfo extends DataInfo implements IRadarDataInfo {
|
||||
public class SCRadarDataInfo extends BaseRadarDataInfo implements IRadarDataInfo {
|
||||
|
||||
@Override
|
||||
public boolean isValidFile(RandomAccessFile raf) {
|
||||
public boolean isValidFile(java.io.RandomAccessFile raf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void setScaleOffset(RadialRecord record, float maxV) {
|
||||
switch (record.product) {
|
||||
case "dBZ":
|
||||
case "dBT":
|
||||
record.scale = 0.5f;
|
||||
record.offset = -32.f;
|
||||
break;
|
||||
case "V":
|
||||
record.scale = maxV / 127.5f;
|
||||
record.offset = -128 * maxV / 127.5f;
|
||||
break;
|
||||
case "W":
|
||||
record.scale = maxV / 256.f;
|
||||
record.offset = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDataInfo(String fileName) {
|
||||
|
||||
this.fileName = fileName;
|
||||
if (fileName.endsWith(".bz2")) {
|
||||
try {
|
||||
BZip2CompressorInputStream inputStream = new BZip2CompressorInputStream(Files.newInputStream(Paths.get(fileName)));
|
||||
readDataInfo(inputStream);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
BufferedInputStream inputStream = new BufferedInputStream(Files.newInputStream(Paths.get(fileName)));
|
||||
readDataInfo(inputStream);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Array read(String varName) {
|
||||
return null;
|
||||
}
|
||||
void readDataInfo(InputStream is) {
|
||||
try {
|
||||
byte[] bytes = new byte[SCRadarDataInfo.RadarHeader.length];
|
||||
is.read(bytes);
|
||||
RadarHeader radarHeader = new RadarHeader(bytes);
|
||||
List<String> products = new ArrayList<>(Arrays.asList("dBZ", "V", "dBT", "W"));
|
||||
float maxV = radarHeader.layerParams.get(0).getMaxV();
|
||||
for (String product : products) {
|
||||
RadialRecord record = new RadialRecord(product);
|
||||
record.setBinLength(1);
|
||||
setScaleOffset(record, maxV);
|
||||
this.recordMap.put(product, record);
|
||||
}
|
||||
int gateNum = 998;
|
||||
byte[] rhBytes = new byte[RadialHeader.length];
|
||||
for (int iSweep = 0; iSweep < radarHeader.nSweeps; iSweep++) {
|
||||
LayerParam layerParam = radarHeader.layerParams.get(iSweep);
|
||||
maxV = layerParam.maxV / 100.f;
|
||||
for (int iRadial = 0; iRadial < layerParam.recordNumber; iRadial++) {
|
||||
is.read(rhBytes);
|
||||
RadialHeader radialHeader = new RadialHeader(rhBytes);
|
||||
bytes = new byte[gateNum * 4];
|
||||
is.read(bytes);
|
||||
int i = 0;
|
||||
for (String product : products) {
|
||||
RadialRecord record = this.recordMap.get(product);
|
||||
if (iRadial == 0) {
|
||||
record.fixedElevation.add(layerParam.getSweepAngle());
|
||||
record.elevation.add(new ArrayList<>());
|
||||
record.azimuth.add(new ArrayList<>());
|
||||
record.azimuthMinIndex.add(0);
|
||||
record.disResolution.add(layerParam.binWidth / 10);
|
||||
record.distance.add(ArrayUtil.arrayRange1(0,
|
||||
gateNum, layerParam.binWidth / 10));
|
||||
record.newScanData();
|
||||
}
|
||||
record.elevation.get(record.elevation.size() - 1).add(radialHeader.getElevation());
|
||||
record.addAzimuth(radialHeader.getAzimuth());
|
||||
byte[] data = new byte[gateNum];
|
||||
for (int j = 0; j < 998; j++) {
|
||||
data[j] = bytes[4 * j + i];
|
||||
}
|
||||
record.addDataBytes(data);
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Array read(String varName, int[] origin, int[] size, int[] stride) {
|
||||
return null;
|
||||
is.close();
|
||||
|
||||
this.addAttribute(new Attribute("Country", radarHeader.country));
|
||||
this.addAttribute(new Attribute("Province", radarHeader.province));
|
||||
this.addAttribute(new Attribute("StationName", radarHeader.station));
|
||||
this.addAttribute(new Attribute("StationLongitude", radarHeader.getLongitude()));
|
||||
this.addAttribute(new Attribute("StationLatitude", radarHeader.getLatitude()));
|
||||
this.addAttribute(new Attribute("AntennaHeight", radarHeader.getHeight()));
|
||||
this.addAttribute(new Attribute("featureType", "RADIAL"));
|
||||
this.addAttribute(new Attribute("DataType", "Radial"));
|
||||
|
||||
//Add dimensions and variables
|
||||
RadialRecord refRadialRecord = this.recordMap.get("dBZ");
|
||||
radialDim = new Dimension();
|
||||
radialDim.setName("radial");
|
||||
radialDim.setLength(refRadialRecord.getMaxRadials());
|
||||
this.addDimension(radialDim);
|
||||
scanDim = new Dimension();
|
||||
scanDim.setName("scan");
|
||||
scanDim.setLength(refRadialRecord.getScanNumber());
|
||||
this.addDimension(scanDim);
|
||||
gateRDim = new Dimension();
|
||||
gateRDim.setName("gateR");
|
||||
gateRDim.setLength(refRadialRecord.getGateNumber(0));
|
||||
this.addDimension(gateRDim);
|
||||
makeRefVariables(refRadialRecord);
|
||||
|
||||
RadialRecord velRadialRecord = this.recordMap.get("V");
|
||||
gateVDim = new Dimension();
|
||||
gateVDim.setName("gateV");
|
||||
gateVDim.setLength(velRadialRecord.getGateNumber(0));
|
||||
this.addDimension(gateVDim);
|
||||
makeVelVariables(velRadialRecord);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadarDataType getRadarDataType() {
|
||||
return RadarDataType.SAB;
|
||||
return RadarDataType.SC;
|
||||
}
|
||||
|
||||
static class LayerParam {
|
||||
public byte ambiguousP;
|
||||
public short aRotate;
|
||||
public short prf1;
|
||||
public short prf2;
|
||||
public short sPulseW;
|
||||
public short maxV;
|
||||
public short maxL;
|
||||
public short binWidth;
|
||||
public short binNumber;
|
||||
public short recordNumber;
|
||||
public short swAngles;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param byteBuffer Byte buffer
|
||||
*/
|
||||
public LayerParam(ByteBuffer byteBuffer) {
|
||||
ambiguousP = byteBuffer.get();
|
||||
aRotate = byteBuffer.getShort();
|
||||
prf1 = byteBuffer.getShort();
|
||||
prf2 = byteBuffer.getShort();
|
||||
sPulseW = byteBuffer.getShort();
|
||||
maxV = byteBuffer.getShort();
|
||||
maxL = byteBuffer.getShort();
|
||||
binWidth = byteBuffer.getShort();
|
||||
binNumber = byteBuffer.getShort();
|
||||
recordNumber = byteBuffer.getShort();
|
||||
swAngles = byteBuffer.getShort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get max value
|
||||
* @return Max value
|
||||
*/
|
||||
public float getMaxV() {
|
||||
return this.maxV / 100.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bin width
|
||||
* @return Bin width
|
||||
*/
|
||||
public int getBinWidth() {
|
||||
return (int) binWidth / 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sweep angle
|
||||
* @return Sweep angle
|
||||
*/
|
||||
public float getSweepAngle() {
|
||||
return swAngles / 100.f;
|
||||
}
|
||||
}
|
||||
|
||||
static class RadarHeader {
|
||||
public static int length = 1024;
|
||||
public String country;
|
||||
public String province;
|
||||
public String station;
|
||||
public String stationID;
|
||||
public String radarType;
|
||||
public String longitudeStr;
|
||||
public String latitudeStr;
|
||||
public int longitude;
|
||||
public int latitude;
|
||||
public int height;
|
||||
public short maxAngle;
|
||||
public short opAngle;
|
||||
public short mangFreq;
|
||||
|
||||
public int antennaG;
|
||||
public short beamH;
|
||||
public short beamL;
|
||||
public byte polarizations;
|
||||
public byte sideLobe;
|
||||
public int power;
|
||||
public int waveLength;
|
||||
public short logA;
|
||||
public short lineA;
|
||||
public short AGCP;
|
||||
public byte clutterT;
|
||||
public byte velocityP;
|
||||
public byte filderP;
|
||||
public byte noiseT;
|
||||
public byte SQIT;
|
||||
public byte intensityC;
|
||||
public byte intensityR;
|
||||
|
||||
public byte sType;
|
||||
public short sYear;
|
||||
public byte sMonth;
|
||||
public byte sDay;
|
||||
public byte sHour;
|
||||
public byte sMinute;
|
||||
public byte sSecond;
|
||||
public byte timeP;
|
||||
public int sMillisecond;
|
||||
public byte calibration;
|
||||
public byte intensityI;
|
||||
public byte velocityP1;
|
||||
|
||||
public List<LayerParam> layerParams;
|
||||
|
||||
public short RHIA;
|
||||
public short RHIL;
|
||||
public short RHIH;
|
||||
public short eYear;
|
||||
public byte eMonth;
|
||||
public byte eDay;
|
||||
public byte eHour;
|
||||
public byte eMinute;
|
||||
public byte eSecond;
|
||||
public byte eTenth;
|
||||
|
||||
public int nSweeps;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param inBytes Input bytes
|
||||
*/
|
||||
public RadarHeader(byte[] inBytes) throws UnsupportedEncodingException {
|
||||
ByteBuffer byteBuffer = ByteBuffer.wrap(inBytes);
|
||||
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
byte[] bytes = new byte[30];
|
||||
byteBuffer.get(bytes);
|
||||
String charsetName = "GB2312";
|
||||
|
||||
//Site information
|
||||
country = new String(bytes, charsetName);
|
||||
bytes = new byte[20];
|
||||
byteBuffer.get(bytes);
|
||||
province = new String(bytes, charsetName);
|
||||
bytes = new byte[40];
|
||||
byteBuffer.get(bytes);
|
||||
station = new String(bytes, charsetName);
|
||||
bytes = new byte[10];
|
||||
byteBuffer.get(bytes);
|
||||
stationID = new String(bytes, charsetName);
|
||||
bytes = new byte[20];
|
||||
byteBuffer.get(bytes);
|
||||
radarType = new String(bytes, charsetName);
|
||||
bytes = new byte[16];
|
||||
byteBuffer.get(bytes);
|
||||
longitudeStr = new String(bytes, charsetName);
|
||||
bytes = new byte[16];
|
||||
byteBuffer.get(bytes);
|
||||
latitudeStr = new String(bytes, charsetName);
|
||||
longitude = byteBuffer.getInt();
|
||||
latitude = byteBuffer.getInt();
|
||||
height = byteBuffer.getInt();
|
||||
maxAngle = byteBuffer.getShort();
|
||||
opAngle = byteBuffer.getShort();
|
||||
mangFreq = byteBuffer.getShort();
|
||||
|
||||
//Radar performance parameters
|
||||
antennaG = byteBuffer.getInt();
|
||||
beamH = byteBuffer.getShort();
|
||||
beamL = byteBuffer.getShort();
|
||||
polarizations = byteBuffer.get();
|
||||
sideLobe = byteBuffer.get();
|
||||
power = byteBuffer.getInt();
|
||||
waveLength = byteBuffer.getInt();
|
||||
logA = byteBuffer.getShort();
|
||||
lineA = byteBuffer.getShort();
|
||||
AGCP = byteBuffer.getShort();
|
||||
clutterT = byteBuffer.get();
|
||||
velocityP = byteBuffer.get();
|
||||
filderP = byteBuffer.get();
|
||||
noiseT = byteBuffer.get();
|
||||
SQIT = byteBuffer.get();
|
||||
intensityC = byteBuffer.get();
|
||||
intensityR = byteBuffer.get();
|
||||
|
||||
//Radar observation parameters 1
|
||||
sType = byteBuffer.get();
|
||||
nSweeps = sType - 100;
|
||||
sYear = byteBuffer.getShort();
|
||||
sMonth = byteBuffer.get();
|
||||
sDay = byteBuffer.get();
|
||||
sHour = byteBuffer.get();
|
||||
sMinute = byteBuffer.get();
|
||||
sSecond = byteBuffer.get();
|
||||
timeP = byteBuffer.get();
|
||||
sMillisecond = byteBuffer.getInt();
|
||||
calibration = byteBuffer.get();
|
||||
intensityI = byteBuffer.get();
|
||||
velocityP1 = byteBuffer.get();
|
||||
|
||||
//Layer parameters
|
||||
this.layerParams = new ArrayList<>();
|
||||
for (int i = 0; i < nSweeps; i++) {
|
||||
layerParams.add(new LayerParam(byteBuffer));
|
||||
}
|
||||
|
||||
//Radar observation parameters 2
|
||||
RHIA = byteBuffer.getShort();
|
||||
RHIL = byteBuffer.getShort();
|
||||
RHIH = byteBuffer.getShort();
|
||||
eYear = byteBuffer.getShort();
|
||||
eMonth = byteBuffer.get();
|
||||
eDay = byteBuffer.get();
|
||||
eHour = byteBuffer.get();
|
||||
eMinute = byteBuffer.get();
|
||||
eSecond = byteBuffer.get();
|
||||
eTenth = byteBuffer.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get longitude
|
||||
* @return Longitude
|
||||
*/
|
||||
public float getLongitude() {
|
||||
return this.longitude / 100.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get latitude
|
||||
* @return Latitude
|
||||
*/
|
||||
public float getLatitude() {
|
||||
return this.latitude / 100.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get height
|
||||
* @return Height
|
||||
*/
|
||||
public float getHeight() {
|
||||
return this.height / 1000.f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class RadialHeader {
|
||||
public static int length = 8;
|
||||
public short startAzimuth;
|
||||
public short startElevation;
|
||||
public short endAzimuth;
|
||||
public short endElevation;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param is InputStream
|
||||
*/
|
||||
public RadialHeader(byte[] inBytes) throws IOException {
|
||||
ByteBuffer byteBuffer = ByteBuffer.wrap(inBytes);
|
||||
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
startAzimuth = byteBuffer.getShort();
|
||||
startElevation = byteBuffer.getShort();
|
||||
endAzimuth = byteBuffer.getShort();
|
||||
endElevation = byteBuffer.getShort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get azimuth
|
||||
* @return Azimuth
|
||||
*/
|
||||
public float getAzimuth() {
|
||||
return startAzimuth * 360.f / 65536;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get elevation
|
||||
* @return Elevation
|
||||
*/
|
||||
public float getElevation() {
|
||||
return startElevation * 120.f / 65536;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,208 +0,0 @@
|
||||
package org.meteoinfo.data.meteodata.radar.cinrad;
|
||||
|
||||
public class Cinrad2Record {
|
||||
|
||||
/** Reflectivity moment identifier */
|
||||
public static final int REFLECTIVITY = 1;
|
||||
|
||||
/** Radial Velocity moment identifier */
|
||||
public static final int VELOCITY_HI = 2;
|
||||
|
||||
/** Radial Velocity moment identifier */
|
||||
public static final int VELOCITY_LOW = 4;
|
||||
|
||||
/** Spectrum Width moment identifier */
|
||||
public static final int SPECTRUM_WIDTH = 3;
|
||||
|
||||
/** Low doppler resolution code */
|
||||
public static final int DOPPLER_RESOLUTION_LOW_CODE = 4;
|
||||
|
||||
/** High doppler resolution code */
|
||||
public static final int DOPPLER_RESOLUTION_HIGH_CODE = 2;
|
||||
|
||||
/** Horizontal beam width */
|
||||
public static final float HORIZONTAL_BEAM_WIDTH = (float) 1.5; // LOOK
|
||||
|
||||
public static byte MISSING_DATA = (byte) 1;
|
||||
public static final byte BELOW_THRESHOLD = (byte) 0;
|
||||
|
||||
/** Size of the file header, aka title */
|
||||
static int FILE_HEADER_SIZE = 0;
|
||||
|
||||
/** Size of the CTM record header */
|
||||
private static int CTM_HEADER_SIZE = 14;
|
||||
|
||||
/** Size of the message header, to start of the data message */
|
||||
private static final int MESSAGE_HEADER_SIZE = 28;
|
||||
|
||||
/** Size of the entire message, if its a radar data message */
|
||||
private static int RADAR_DATA_SIZE = 2432;
|
||||
|
||||
public static String getDatatypeName(int datatype) {
|
||||
switch (datatype) {
|
||||
case REFLECTIVITY:
|
||||
return "Reflectivity";
|
||||
case VELOCITY_HI:
|
||||
case VELOCITY_LOW:
|
||||
return "RadialVelocity";
|
||||
case SPECTRUM_WIDTH:
|
||||
return "SpectrumWidth";
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDatatypeUnits(int datatype) {
|
||||
switch (datatype) {
|
||||
case REFLECTIVITY:
|
||||
return "dBz";
|
||||
|
||||
case VELOCITY_HI:
|
||||
case VELOCITY_LOW:
|
||||
case SPECTRUM_WIDTH:
|
||||
return "m/s";
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public static float getDatatypeScaleFactor(int datatype) {
|
||||
switch (datatype) {
|
||||
case REFLECTIVITY:
|
||||
if (CinradDataInfo.isCC)
|
||||
return 0.1f;
|
||||
if (CinradDataInfo.isCC20)
|
||||
return 0.5f;
|
||||
else
|
||||
return 0.5f;
|
||||
case VELOCITY_LOW:
|
||||
if (CinradDataInfo.isSC)
|
||||
return 0.3673f;
|
||||
else if (CinradDataInfo.isCC)
|
||||
return 0.1f;
|
||||
else
|
||||
return 1.0f;
|
||||
case VELOCITY_HI:
|
||||
case SPECTRUM_WIDTH:
|
||||
if (CinradDataInfo.isSC)
|
||||
return 0.1822f;
|
||||
else if (CinradDataInfo.isCC)
|
||||
return 0.1f;
|
||||
else if (CinradDataInfo.isCC20)
|
||||
return 1.0f;
|
||||
else
|
||||
return 0.5f;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static float getDatatypeAddOffset(int datatype) {
|
||||
switch (datatype) {
|
||||
case REFLECTIVITY:
|
||||
if (CinradDataInfo.isSC)
|
||||
return -32.0f;
|
||||
else if (CinradDataInfo.isCC)
|
||||
return 0.0f;
|
||||
else if (CinradDataInfo.isCC20)
|
||||
return -32.0f;
|
||||
else
|
||||
return -33.0f;
|
||||
case VELOCITY_LOW:
|
||||
if (CinradDataInfo.isSC)
|
||||
return 0.0f;
|
||||
else if (CinradDataInfo.isCC)
|
||||
return 0.0f;
|
||||
else if (CinradDataInfo.isCC20)
|
||||
return 0.0f;
|
||||
else
|
||||
return -129.0f;
|
||||
case VELOCITY_HI:
|
||||
case SPECTRUM_WIDTH:
|
||||
if (CinradDataInfo.isSC)
|
||||
return 0.0f;
|
||||
else if (CinradDataInfo.isCC)
|
||||
return 0.0f;
|
||||
else if (CinradDataInfo.isCC20)
|
||||
return 0.0f;
|
||||
else
|
||||
return -64.5f;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getMessageTypeName(int code) {
|
||||
switch (code) {
|
||||
case 1:
|
||||
return "digital radar data";
|
||||
case 2:
|
||||
return "RDA status data";
|
||||
case 3:
|
||||
return "performance/maintainence data";
|
||||
case 4:
|
||||
return "console message - RDA to RPG";
|
||||
case 5:
|
||||
return "maintainence log data";
|
||||
case 6:
|
||||
return "RDA control ocmmands";
|
||||
case 7:
|
||||
return "volume coverage pattern";
|
||||
case 8:
|
||||
return "clutter censor zones";
|
||||
case 9:
|
||||
return "request for data";
|
||||
case 10:
|
||||
return "console message - RPG to RDA";
|
||||
case 11:
|
||||
return "loop back test - RDA to RPG";
|
||||
case 12:
|
||||
return "loop back test - RPG to RDA";
|
||||
case 13:
|
||||
return "clutter filter bypass map - RDA to RPG";
|
||||
case 14:
|
||||
return "edited clutter filter bypass map - RDA to RPG";
|
||||
case 15:
|
||||
return "Notchwidth Map";
|
||||
case 18:
|
||||
return "RDA Adaptation data";
|
||||
default:
|
||||
return "unknown " + code;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getRadialStatusName(int code) {
|
||||
switch (code) {
|
||||
case 0:
|
||||
return "start of new elevation";
|
||||
case 1:
|
||||
return "intermediate radial";
|
||||
case 2:
|
||||
return "end of elevation";
|
||||
case 3:
|
||||
return "begin volume scan";
|
||||
case 4:
|
||||
return "end volume scan";
|
||||
default:
|
||||
return "unknown " + code;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getVolumeCoveragePatternName(int code) {
|
||||
switch (code) {
|
||||
case 11:
|
||||
return "16 elevation scans every 5 mins";
|
||||
case 12:
|
||||
return "14 elevation scan every 4.1 mins";
|
||||
case 21:
|
||||
return "11 elevation scans every 6 mins";
|
||||
case 31:
|
||||
return "8 elevation scans every 10 mins";
|
||||
case 32:
|
||||
return "7 elevation scans every 10 mins";
|
||||
case 121:
|
||||
return "9 elevations, 20 scans every 5 minutes";
|
||||
default:
|
||||
return "unknown " + code;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
package org.meteoinfo.data.meteodata.radar.cinrad;
|
||||
|
||||
import org.meteoinfo.data.GridArray;
|
||||
import org.meteoinfo.data.GridData;
|
||||
import org.meteoinfo.data.meteodata.DataInfo;
|
||||
import org.meteoinfo.data.meteodata.IGridDataInfo;
|
||||
import org.meteoinfo.ndarray.Array;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
|
||||
public class CinradDataInfo extends DataInfo {
|
||||
|
||||
private static final int MISSING_INT = -9999;
|
||||
private static final float MISSING_FLOAT = Float.NaN;
|
||||
public static boolean isSC = false;
|
||||
public static boolean isCC = false;
|
||||
public static boolean isCC20 = false;
|
||||
|
||||
@Override
|
||||
public boolean isValidFile(RandomAccessFile raf) {
|
||||
return isCINRAD(raf);
|
||||
}
|
||||
|
||||
public boolean isCINRAD(RandomAccessFile raf) {
|
||||
try {
|
||||
raf.seek(0);
|
||||
|
||||
byte[] b128 = new byte[136];
|
||||
raf.read(b128);
|
||||
String radarT = new String(b128);
|
||||
|
||||
if (radarT.contains("CINRAD/SC") || radarT.contains("CINRAD/CD")) {
|
||||
isSC = true;
|
||||
isCC = false;
|
||||
isCC20 = false;
|
||||
return true;
|
||||
} else if (radarT.contains("CINRADC")) {
|
||||
isCC = true;
|
||||
isSC = false;
|
||||
isCC20 = false;
|
||||
return true;
|
||||
} else if (!radarT.contains("CINRADC") && radarT.contains("CINRAD/CC")) {
|
||||
isCC20 = true;
|
||||
isSC = false;
|
||||
isCC = false;
|
||||
return true;
|
||||
} else {
|
||||
isSC = false;
|
||||
isCC = false;
|
||||
isCC20 = false;
|
||||
return false;
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readDataInfo(String fileName) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Array read(String varName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Array read(String varName, int[] origin, int[] size, int[] stride) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,32 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\io\radar\cinrad">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\scatter"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\text"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite\FY"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\funny"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\bar"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\netcdf"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataframe\series"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataframe"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\calc"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\radar"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\radar\cinrad"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\test_read_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\radar_cma_base_cappi.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\radar_sc_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\test_read_SC.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\test_read_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\radar_cma_base_cappi.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\radar_sc_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\io\radar\cinrad\test_read_SC.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
|
||||
Binary file not shown.
@ -2887,10 +2887,10 @@ def smooth9(x):
|
||||
|
||||
def cdiff(a, dimidx):
|
||||
"""
|
||||
Performs a centered difference operation on a array in a specific direction
|
||||
Performs a centered difference operation on an array in a specific direction
|
||||
|
||||
:param a: (*array*) The input array.
|
||||
:param dimidx: (*int*) Demension index of the specific direction.
|
||||
:param dimidx: (*int*) Dimension index of the specific direction.
|
||||
|
||||
:returns: Result array.
|
||||
"""
|
||||
|
||||
Binary file not shown.
@ -1236,9 +1236,9 @@ def supylabel(label, **kwargs):
|
||||
return r
|
||||
|
||||
|
||||
def left_title(label, fontname=None, fontsize=14, bold=False, color='black', **kwargs):
|
||||
def left_title(label, **kwargs):
|
||||
"""
|
||||
Set a left sub title of the current axes.
|
||||
Set a left subtitle of the current axes.
|
||||
|
||||
:param label: (*string*) Title string.
|
||||
:param fontname: (*string*) Font name. Default is ``None``, using ``Arial`` .
|
||||
@ -1246,14 +1246,18 @@ def left_title(label, fontname=None, fontsize=14, bold=False, color='black', **k
|
||||
:param bold: (*boolean*) Is bold font or not. Default is ``False`` .
|
||||
:param color: (*color*) Title string color. Default is ``black`` .
|
||||
"""
|
||||
r = g_axes.set_title(label, 'left', fontname, fontsize, bold, color, **kwargs)
|
||||
if not kwargs.has_key('bold'):
|
||||
kwargs['bold'] = False
|
||||
if not kwargs.has_key('xalign'):
|
||||
kwargs['xalign'] = 'left'
|
||||
r = g_axes.set_title(label, loc='left', **kwargs)
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
|
||||
def right_title(label, fontname=None, fontsize=14, bold=False, color='black', **kwargs):
|
||||
def right_title(label, **kwargs):
|
||||
"""
|
||||
Set a right sub title of the current axes.
|
||||
Set a right subtitle of the current axes.
|
||||
|
||||
:param label: (*string*) Title string.
|
||||
:param fontname: (*string*) Font name. Default is ``None``, using ``Arial`` .
|
||||
@ -1261,7 +1265,11 @@ def right_title(label, fontname=None, fontsize=14, bold=False, color='black', **
|
||||
:param bold: (*boolean*) Is bold font or not. Default is ``False`` .
|
||||
:param color: (*color*) Title string color. Default is ``black`` .
|
||||
"""
|
||||
r = g_axes.set_title(label, 'right', fontname, fontsize, bold, color, **kwargs)
|
||||
if not kwargs.has_key('bold'):
|
||||
kwargs['bold'] = False
|
||||
if not kwargs.has_key('xalign'):
|
||||
kwargs['xalign'] = 'right'
|
||||
r = g_axes.set_title(label, loc='right', **kwargs)
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
|
||||
Binary file not shown.
@ -620,14 +620,13 @@ def getlegendbreak(geometry, **kwargs):
|
||||
return lb, isunique
|
||||
|
||||
|
||||
def getlegendscheme(args, min, max, cmap=None, **kwargs):
|
||||
def getlegendscheme(args, min, max, **kwargs):
|
||||
ls = kwargs.pop('symbolspec', None)
|
||||
if ls is None:
|
||||
extend = kwargs.pop('extend', None)
|
||||
if extend is not None:
|
||||
extend = ExtendType.valueOf(extend.upper())
|
||||
if cmap is None:
|
||||
cmap = getcolormap(**kwargs)
|
||||
cmap = getcolormap(**kwargs)
|
||||
level_arg = kwargs.pop('levels', None)
|
||||
if level_arg is None and len(args) > 0:
|
||||
level_arg = args[0]
|
||||
|
||||
2
pom.xml
2
pom.xml
@ -35,7 +35,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<revision>3.8.8</revision>
|
||||
<revision>3.8.9</revision>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.release>8</maven.compiler.release>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user