diff --git a/@tsg_nc/tsg_ncvar.csv b/@tsg_nc/tsg_ncvar.csv index 9327bff3ee25cd55bd87683b080cb4700c2e9f59..102a29b56a194b362c6900aa1dbd6db9461f3d10 100644 --- a/@tsg_nc/tsg_ncvar.csv +++ b/@tsg_nc/tsg_ncvar.csv @@ -1,69 +1,69 @@ % tsg_ncvar.csv: definition ( id + 14 members + endl & 16 separators ; actually) % $Id$ % -id;code;dimension;nctype;long_name;standard_name;units;conventions;valid_min;valid_max;format;FillValue_;epic_code;axis;resolution;comment;endl -char;char;cell;char;char;char;char;char;integer;integer;char;double;integer;char;double;char;char -#;REFERENCE_DATE_TIME;'STRING14';char;;;;yyyymmddhhmmss;;;;;;;;Reference date for julian days origin;# -#;DATE;'DAYD','STRING14';char;DATE OF MAIN INSTRUMENT MEASUREMENT;;;yyyymmddhhmmss;;;;;;;;This is the original data describing the date, it must not be lost;# -#;DATE_WS;'DAYD_WS','STRING14';char;DATE OF WATER SAMPLE;;;yyyymmddhhmmss;;;;;;;;This is the original data describing the date, it must not be lost;# -#;DATE_EXT;'DAYD_EXT','STRING14';char;DATE OF EACH EXTERNAL DATA MEASUREMENT;;;yyyymmddhhmmss;;;;;;;;This is the original data describing the date, it must not be lost;# -#;DAYD;'DAYD';float;DECIMAL JULIAN DAY (UTC) OF EACH MEASUREMENT;time;days since 1950/01/01 00:00:00;Relative julian days with decimal part (as parts of the day);0.0;36600.0;%9.5lf;999999;601;t;;Julian day of the measurement;# -#;DAYD_WS;'DAYD_WS';float;DECIMAL JULIAN DAY (UTC) OF EACH WATER SAMPLE;time;days since 1950/01/01 00:00:00;Relative julian days with decimal part (as parts of the day);0.0;36600.0;%9.5lf;999999;601;t;;Julian day of the measurement;# -#;DAYD_EXT;'DAYD_EXT';float;DECIMAL JULIAN DAY (UTC) OF EXTERNAL DATA MEASUREMENT;time;Days since 1950/01/01 00:00:00;Relative julian days with decimal part (as parts of the day);0.0;36600.0;%9.5lf;999999;601;t;;Julian day of the measurement;# -#;LATX;'DAYD';float;LATITUDE OF EACH MEASUREMENT;latitude;degree_north (decimal);;-90;90;%+8.4lf;99999;500;;;Latitude of the measurement;# -#;LATX_WS;'DAYD_WS';float;LATITUDE OF WATER SAMPLE;latitude;degree_north (decimal);;-90;90;%+8.4lf;99999;500;;;Latitude of the measurement;# -#;LATX_EXT;'DAYD_EXT';float;LATITUDE OF EACH EXTERNAL DATA MEASUREMENT;latitude;degree_north (decimal);;-90;90;%+8.4lf;99999;500;;;Latitude of the measurement;# -#;LONX;'DAYD';float;LONGITUDE OF EACH MEASUREMENT;longitude;degree_east (decimal);;-180;180;%+9.4lf;99999;501;;;Longitude of the measurement;# -#;LONX_WS;'DAYD_WS';float;LONGITUDE OF WATER SAMPLE;longitude;degree_east (decimal);;-180;180;%+9.4lf;99999;501;;;Longitude of the measurement;# -#;LONX_EXT;'DAYD_EXT';float;LONGITUDE OF EACH EXTERNAL DATA MEASUREMENT;longitude;degree_east (decimal);;-180;180;%+9.4lf;99999;501;;;Longitude of the measurement;# -#;SPDC;'DAYD';float;SHIP SPEED COMPUTED FROM NAVIGATION;speed;knots;;0;50;%6.3lf;99999;;;0.1;Ship speed from GPS (SOG). If SOG not available, derived from last position;# -#;PRES;'DAYD';float;SEA PRESSURE IN TSG;pressure;decibar=10000 pascals;;0;10;%6.1lf;99999;;;0.1;Pressure inside TSG, this is an indication that pump is working properly;# -#;CNDC;'DAYD';float;ELECTRICAL CONDUCTIVITY;conductivity;S/meter;;0;7;%5.3lf;99999;;;0.001;Conductivity measured by TSG. This data may have been reduced with a media (recommended) or a mean;# -#;CNDC_STD;'DAYD';float;CONDUCTIVITY STANDARD DEVIATION;conductivity;S/meter;;0;7;%5.3lf;99999;;;0.0001;Standard deviation of conductivity measured by TSG (CNDC);# -#;CNDC_CAL;'DAYD';float;CONDUCTIVITY CALIBRATED;conductivity calibrated;S/meter;;0;7;%5.3lf;99999;;;0.0001;Conductivity calibrated using linearization coefficient;# -#;CNDC_FREQ;'DAYD';float;SENSOR CONDUCTIVITY FREQUENCY;frequency;Hz;;0;20000;%9.3lf;99999;;;0.0001;Sensor conductivity frequency measured by TSG;# -#;CNDC_CALCOEF;'NCOEF_CAL';double;CONDUCTIVITY CALIBRATION COEFFICIENTS;;;a,b,c,d,m;;;;99999;;;;;# -#;CNDC_LINCOEF;'NCOEF_LIN';double;CONDUCTIVITY LINEAR DRIFT CORRECTION COEFFICIENTS;;;slope,offset;;;;99999;;;;;# -#;SSJT;'DAYD';float;WATER JACKET TEMPERATURE;Temperature within TSG;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Temperature within TSG or (Water Jacket Temperature). Warning, this is not ocean SST temperature. Is is used for salinity computation. The reduction applied is the same as for conductivity. Temperature scale must be specified (T64 or T90);# -#;SSJT_STD;'DAYD';float;WATER JACKET TEMPERATURE STANDARD DEVIATION;temperature std;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;SSJT, Temperature within TSG standard deviation for data wich have been reduced (with a mean or median);# -#;SSJT_CAL;'DAYD';float;WATER JACKET TEMPERATURE CALIBRATED;temperature cal;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Water jacket temperature within TSG calibrated using linearization coefficients;# -#;SSJT_FREQ;'DAYD';float;WATER JACKET SENSOR TEMPERATURE FREQUENCY;sensor temperature frequency in TSG;Hz;;0;20000;%9.3lf;99999;;;0.001;Frequency of temperature sensor inside TSG (Water Jacket Temperature);# -#;SSJT_CALCOEF;'NCOEF_CAL';double;TEMPERATURE CALIBRATION COEFFICIENTS;;;a,b,c,d,f0;;;;99999;;;;;# -#;SSJT_LINCOEF;'NCOEF_LIN';double;TEMPERATURE LINEAR DRIFT CORRECTION COEFFICIENTS;;;slope,offset;;;;99999;;;;;# -#;SSJT_ADJUSTED;'DAYD';float;WATER JACKET TEMPERATURE ADJUSTED;temperature in TSG adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Adjusted SSJT with external data (CTD,ARGO,XBT,...);# -#;SSJT_ADJUSTED_ERROR;'DAYD';float;ERROR ON ADJUSTED WATER JACKET TEMPERATURE;error temperature in TSG adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;;# -#;SSJT_ADJUSTED_QC;'DAYD';byte;WATER JACKET TEMPERATURE QUALITY FLAG;quality flag applied on temperature in TSG adjusted;;;0;9;%1d;0;;;;Quality flag applied on adjusted SSJT;# -#;SSJT_ADJUSTED_HIST;'STRING256';char;ADJUSTED WATER JACKET TEMPERATURE PROCESSING HISTORY;temperature in TSG adjusted processing history;;;;;;;;;;;# -#;SSPS;'DAYD';float;SEA SURFACE PRACTICAL SALINITY;surface salinity;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Ocean salinity deduced fron conductivity and water jacket temperature;# -#;SSPS_QC;'DAYD';byte;SEA SURFACE SALINITY QUALITY FLAG;surface salinity quality;;;0;9;%1d;0;;;;Quality flag applied on salinity values;# -#;SSPS_CAL;'DAYD';float;SEA SURFACE SALINITY CALIBRATED;surface salinity calibrated;P.S.U.;;0;40;%6.3lf;99999;;;;Calibrated Ocean salinity deduced fron conductivity and jacket tsg temperature;# -#;SSPS_ADJUSTED;'DAYD';float;SEA SURFACE SALINITY ADJUSTED;surface salinity adjusted;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Adjusted Ocean salinity deduced fron conductivity and jacket tsg temperature;# -#;SSPS_ADJUSTED_ERROR;'DAYD';float;ERROR ON SEA SURFACE SALINITY ADJUSTED;error surface salinity adjusted;P.S.U.;;0;40;%6.3lf;99999;;;;Error on adjusted Ocean salinity deduced fron conductivity and jacket tsg temperature;# -#;SSPS_ADJUSTED_QC;'DAYD';byte;ERROR ON SEA SURFACE SALINITY ADJUSTED QUALITY FLAG;error surface salinity adjusted quality;;;0;9;%1d;0;;;;Quality flag applied on adjusted Ocean salinity deduced fron conductivity and jacket tsg temperature;# -#;SSPS_ADJUSTED_HIST;'STRING256';char;ADJUSTED SEA SURFACE SALINITY PROCESSING HISTORY;surface salinity adjusted processing history;;;;;;;;;;;# -#;SSPS_DEPH;'N1';float;NOMINAL DEPTH OF WATER INTAKE FOR SALINITY MEASUREMENT;depth surface salinity;meter;;0;100;%6.3lf;99999;;;;;# -#;SSPS_DEPH_MIN;'N1';float;MINIMUM DEPTH OF WATER INTAKE FOR SALINITY MEASUREMENT;min depth surface salinity;meter;;0;100;%6.3lf;99999;;;;;# -#;SSPS_DEPH_MAX;'N1';float;MAXIMUM DEPTH OF WATER INTAKE FOR SALINITY MEASUREMENT;max depth surface salinity;meter;;0;100;%6.3lf;99999;;;;;# -#;SSPS_WS;'DAYD_WS';float;SEA SURFACE PRACTICAL SALINIT FROM WATER SAMPLE;surface salinity;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Sea surface salinity from water sample;# -#;SSPS_WS_QC;'DAYD_WS';byte;SEA SURFACE SALINITY QUALITY FLAG;surface salinity quality;;;0;9;%1d;0;;;;Quality flag applied on salinity values from water sample;# -#;SSPS_WS_ANALDATE;'DAYD_WS','STRING14';char;DATE OF WATER SAMPLE SURFACE SALINITY ANALYSIS;;;yyyymmddhhmmss;;;;;;;;Date of sea surface salinity water sample analysis;# -#;SSPS_WS_BOTTLE;'DAYD_WS','STRING4';char;SEA SURFACE SALINITY BOTTLE NUMBER;;;;;;;;;;;Number of sea surface salinity water sample;# -#;SSTP;'DAYD';float;SEA SURFACE TEMPERATURE;surface temperature;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Sea Surface Temperature (SST) measure at intake with external instrument. This is ocean Temperature;# -#;SSTP_QC;'DAYD';byte;SEA SURFACE TEMPERATURE QUALITY FLAG;surface temperature quality;;;0;9;%1d;0;;;;Quality flag applied on SSTP temperature values;# -#;SSTP_CAL;'DAYD';float;SEA SURFACE TEMPERATURE CALIBRATED;surface temperature calibrated;degrees Celsius;;-1.5;38;%6.3lf;99999;;;;Sea Surface Temperature Calibrated;# -#;SSTP_FREQ;'DAYD';float;SEA SURFACE TEMPERATURE FREQUENCY;temperature frequency in TSG;Hz;;0;20000;%9.3lf;99999;;;0.001;Frequency of external temperature sensor, used for SST measurement;# -#;SSTP_ADJUSTED;'DAYD';float;SEA SURFACE TEMPERATURE ADJUSTED;surface temperature adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;;Adjusted Ocean temperature;# -#;SSTP_ADJUSTED_ERROR;'DAYD';float;ERROR ON SEA SURFACE TEMPERATURE ADJUSTED;error surface temperature adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;;Error on adjusted Ocean temperature;# -#;SSTP_ADJUSTED_QC;'DAYD';byte;SEA SURFACE TEMPERATURE ADJUSTED QUALITY FLAG;quality flag on surface temperature adjusted;;;0;9;%1d;0;;;;Quality flag applied on adjusted Ocean temperature;# -#;SSTP_ADJUSTED_HIST;'STRING256';char;ADJUSTED SEA SURFACE TEMPERATURE PROCESSING HISTORY;surface temperature adjusted processing history;;;;;;;;;;;# -#;SSTP_DEPH;'N1';float;NOMINAL DEPTH OF WATER INTAKE FOR TEMPERATURE MEASUREMENT;depth surface temperature;meter;;0;100;%6.3lf;99999;;;;;# -#;SSTP_DEPH_MIN;'N1';float;MINIMUM DEPTH OF WATER INTAKE FOR TEMPERATURE MEASUREMENT;min depth surface temperature;meter;;0;100;%6.3lf;99999;;;;;# -#;SSTP_DEPH_MAX;'N1';float;MAXIMUM DEPTH OF WATER INTAKE FOR TEMPERATURE MEASUREMENT;max depth surface temperature;meter;;0;100;%6.3lf;99999;;;;;# -#;SSTP_CALCOEF;'NCOEF_CAL';double;TEMPERATURE CALIBRATION COEFFICIENTS;;;a,b,c,d,f0;;;;99999;;;;Temperature calibrated using linearization coefficient;# -#;SSTP_LINCOEF;'NCOEF_LIN';double;TEMPERATURE LINEAR DRIFT CORRECTION COEFFICIENTS;;;slope,offset;;;;99999;;;;Temperature linear drift correction coefficient;# -#;SSTP_EXT;'DAYD_EXT';float;SEA SURFACE TEMPERATURE FROM EXTERNAL DATA;surface temperature;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Sea Surface Temperature (SST) from external data instrument;# -#;SSTP_EXT_QC;'DAYD_EXT';byte;SEA SURFACE TEMPERATURE QUALITY FLAG;surface temperature quality;;;0;9;%1d;0;;;;Quality flag applied on external temperature data values;# -#;SSTP_EXT_TYPE;'STRING4';char;SEA SURFACE TEMPERATURE EXTERNAL INSTRUMENT TYPE;surface temperature type instrument;;;;;;;;;;CTD,ARGO,XBT,...;# -#;SSPS_EXT;'DAYD_EXT';float;SEA SURFACE SALINITY FROM EXTERNAL INSTRUMENT;surface salinity;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Sea surface salinity from external instrument;# -#;SSPS_EXT_QC;'DAYD_EXT';byte;SEA SURFACE SALINITY QUALITY FLAG;surface salinity quality;;;0;9;%1d;0;;;;Quality flag applied on salinity values from external instrument;# -#;SSPS_EXT_TYPE;'STRING4';char;TYPE OF EXTERNAL DATA ORIGIN;Type of external data origin;;;;;;;;;;CTD,ARGO,XBT,...;# +id;code;dimension;nctype;long_name;standard_name;units;conventions;valid_min;valid_max;format;FillValue_;epic_code;axis;resolution;comment;missing_value;endl +char;char;cell;char;char;char;char;char;integer;integer;char;double;integer;char;double;char;char;char +#;REFERENCE_DATE_TIME;'STRING14';char;;;;yyyymmddhhmmss;;;;;;;;Reference date for julian days origin;;# +#;DATE;'DAYD','STRING14';char;DATE OF MAIN INSTRUMENT MEASUREMENT;;;yyyymmddhhmmss;;;;;;;;This is the original data describing the date, it must not be lost;;# +#;DATE_WS;'DAYD_WS','STRING14';char;DATE OF WATER SAMPLE;;;yyyymmddhhmmss;;;;;;;;This is the original data describing the date, it must not be lost;;# +#;DATE_EXT;'DAYD_EXT','STRING14';char;DATE OF EACH EXTERNAL DATA MEASUREMENT;;;yyyymmddhhmmss;;;;;;;;This is the original data describing the date, it must not be lost;;# +#;DAYD;'DAYD';float;DECIMAL JULIAN DAY (UTC) OF EACH MEASUREMENT;time;days since 1950/01/01 00:00:00;Relative julian days with decimal part (as parts of the day);0.0;36600.0;%9.5lf;999999;601;t;;Julian day of the measurement;;# +#;DAYD_WS;'DAYD_WS';float;DECIMAL JULIAN DAY (UTC) OF EACH WATER SAMPLE;time;days since 1950/01/01 00:00:00;Relative julian days with decimal part (as parts of the day);0.0;36600.0;%9.5lf;999999;601;t;;Julian day of the measurement;;# +#;DAYD_EXT;'DAYD_EXT';float;DECIMAL JULIAN DAY (UTC) OF EXTERNAL DATA MEASUREMENT;time;Days since 1950/01/01 00:00:00;Relative julian days with decimal part (as parts of the day);0.0;36600.0;%9.5lf;999999;601;t;;Julian day of the measurement;;# +#;LATX;'DAYD';float;LATITUDE OF EACH MEASUREMENT;latitude;degree_north (decimal);;-90;90;%+8.4lf;99999;500;;;Latitude of the measurement;;# +#;LATX_WS;'DAYD_WS';float;LATITUDE OF WATER SAMPLE;latitude;degree_north (decimal);;-90;90;%+8.4lf;99999;500;;;Latitude of the measurement;;# +#;LATX_EXT;'DAYD_EXT';float;LATITUDE OF EACH EXTERNAL DATA MEASUREMENT;latitude;degree_north (decimal);;-90;90;%+8.4lf;99999;500;;;Latitude of the measurement;;# +#;LONX;'DAYD';float;LONGITUDE OF EACH MEASUREMENT;longitude;degree_east (decimal);;-180;180;%+9.4lf;99999;501;;;Longitude of the measurement;;# +#;LONX_WS;'DAYD_WS';float;LONGITUDE OF WATER SAMPLE;longitude;degree_east (decimal);;-180;180;%+9.4lf;99999;501;;;Longitude of the measurement;;# +#;LONX_EXT;'DAYD_EXT';float;LONGITUDE OF EACH EXTERNAL DATA MEASUREMENT;longitude;degree_east (decimal);;-180;180;%+9.4lf;99999;501;;;Longitude of the measurement;;# +#;SPDC;'DAYD';float;SHIP SPEED COMPUTED FROM NAVIGATION;speed;knots;;0;50;%6.3lf;99999;;;0.1;Ship speed from GPS (SOG). If SOG not available, derived from last position;;# +#;PRES;'DAYD';float;SEA PRESSURE IN TSG;pressure;decibar=10000 pascals;;0;10;%6.1lf;99999;;;0.1;Pressure inside TSG, this is an indication that pump is working properly;;# +#;CNDC;'DAYD';float;ELECTRICAL CONDUCTIVITY;conductivity;S/meter;;0;7;%5.3lf;99999;;;0.001;Conductivity measured by TSG. This data may have been reduced with a media (recommended) or a mean;;# +#;CNDC_STD;'DAYD';float;CONDUCTIVITY STANDARD DEVIATION;conductivity;S/meter;;0;7;%5.3lf;99999;;;0.0001;Standard deviation of conductivity measured by TSG (CNDC);;# +#;CNDC_CAL;'DAYD';float;CONDUCTIVITY CALIBRATED;conductivity calibrated;S/meter;;0;7;%5.3lf;99999;;;0.0001;Conductivity calibrated using linearization coefficient;;# +#;CNDC_FREQ;'DAYD';float;SENSOR CONDUCTIVITY FREQUENCY;frequency;Hz;;0;20000;%9.3lf;99999;;;0.0001;Sensor conductivity frequency measured by TSG;;# +#;CNDC_CALCOEF;'NCOEF_CAL';double;CONDUCTIVITY CALIBRATION COEFFICIENTS;;;a,b,c,d,m;;;;99999;;;;;;# +#;CNDC_LINCOEF;'NCOEF_LIN';double;CONDUCTIVITY LINEAR DRIFT CORRECTION COEFFICIENTS;;;slope,offset;;;;99999;;;;;;# +#;SSJT;'DAYD';float;WATER JACKET TEMPERATURE;Temperature within TSG;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Temperature within TSG or (Water Jacket Temperature). Warning, this is not ocean SST temperature. Is is used for salinity computation. The reduction applied is the same as for conductivity. Temperature scale must be specified (T64 or T90);;# +#;SSJT_STD;'DAYD';float;WATER JACKET TEMPERATURE STANDARD DEVIATION;temperature std;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;SSJT, Temperature within TSG standard deviation for data wich have been reduced (with a mean or median);;# +#;SSJT_CAL;'DAYD';float;WATER JACKET TEMPERATURE CALIBRATED;temperature cal;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Water jacket temperature within TSG calibrated using linearization coefficients;;# +#;SSJT_FREQ;'DAYD';float;WATER JACKET SENSOR TEMPERATURE FREQUENCY;sensor temperature frequency in TSG;Hz;;0;20000;%9.3lf;99999;;;0.001;Frequency of temperature sensor inside TSG (Water Jacket Temperature);;# +#;SSJT_CALCOEF;'NCOEF_CAL';double;TEMPERATURE CALIBRATION COEFFICIENTS;;;a,b,c,d,f0;;;;99999;;;;;;# +#;SSJT_LINCOEF;'NCOEF_LIN';double;TEMPERATURE LINEAR DRIFT CORRECTION COEFFICIENTS;;;slope,offset;;;;99999;;;;;;# +#;SSJT_ADJUSTED;'DAYD';float;WATER JACKET TEMPERATURE ADJUSTED;temperature in TSG adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Adjusted SSJT with external data (CTD,ARGO,XBT,...);;# +#;SSJT_ADJUSTED_ERROR;'DAYD';float;ERROR ON ADJUSTED WATER JACKET TEMPERATURE;error temperature in TSG adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;;;# +#;SSJT_ADJUSTED_QC;'DAYD';byte;WATER JACKET TEMPERATURE QUALITY FLAG;quality flag applied on temperature in TSG adjusted;;;0;9;%1d;;;;;Quality flag applied on adjusted SSJT;0;# +#;SSJT_ADJUSTED_HIST;'STRING256';char;ADJUSTED WATER JACKET TEMPERATURE PROCESSING HISTORY;temperature in TSG adjusted processing history;;;;;;;;;;;;# +#;SSPS;'DAYD';float;SEA SURFACE PRACTICAL SALINITY;surface salinity;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Ocean salinity deduced fron conductivity and water jacket temperature;;# +#;SSPS_QC;'DAYD';byte;SEA SURFACE SALINITY QUALITY FLAG;surface salinity quality;;;;9;%1d;;;;;Quality flag applied on salinity values;0;# +#;SSPS_CAL;'DAYD';float;SEA SURFACE SALINITY CALIBRATED;surface salinity calibrated;P.S.U.;;0;40;%6.3lf;99999;;;;Calibrated Ocean salinity deduced fron conductivity and jacket tsg temperature;;# +#;SSPS_ADJUSTED;'DAYD';float;SEA SURFACE SALINITY ADJUSTED;surface salinity adjusted;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Adjusted Ocean salinity deduced fron conductivity and jacket tsg temperature;;# +#;SSPS_ADJUSTED_ERROR;'DAYD';float;ERROR ON SEA SURFACE SALINITY ADJUSTED;error surface salinity adjusted;P.S.U.;;0;40;%6.3lf;99999;;;;Error on adjusted Ocean salinity deduced fron conductivity and jacket tsg temperature;;# +#;SSPS_ADJUSTED_QC;'DAYD';byte;ERROR ON SEA SURFACE SALINITY ADJUSTED QUALITY FLAG;error surface salinity adjusted quality;;;0;9;%1d;;;;;Quality flag applied on adjusted Ocean salinity deduced fron conductivity and jacket tsg temperature;0;# +#;SSPS_ADJUSTED_HIST;'STRING256';char;ADJUSTED SEA SURFACE SALINITY PROCESSING HISTORY;surface salinity adjusted processing history;;;;;;;;;;;;# +#;SSPS_DEPH;'N1';float;NOMINAL DEPTH OF WATER INTAKE FOR SALINITY MEASUREMENT;depth surface salinity;meter;;0;100;%6.3lf;99999;;;;;;# +#;SSPS_DEPH_MIN;'N1';float;MINIMUM DEPTH OF WATER INTAKE FOR SALINITY MEASUREMENT;min depth surface salinity;meter;;0;100;%6.3lf;99999;;;;;;# +#;SSPS_DEPH_MAX;'N1';float;MAXIMUM DEPTH OF WATER INTAKE FOR SALINITY MEASUREMENT;max depth surface salinity;meter;;0;100;%6.3lf;99999;;;;;;# +#;SSPS_WS;'DAYD_WS';float;SEA SURFACE PRACTICAL SALINIT FROM WATER SAMPLE;surface salinity;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Sea surface salinity from water sample;;# +#;SSPS_WS_QC;'DAYD_WS';byte;SEA SURFACE SALINITY QUALITY FLAG;surface salinity quality;;;0;9;%1d;;;;;Quality flag applied on salinity values from water sample;0;# +#;SSPS_WS_ANALDATE;'DAYD_WS','STRING14';char;DATE OF WATER SAMPLE SURFACE SALINITY ANALYSIS;;;yyyymmddhhmmss;;;;;;;;Date of sea surface salinity water sample analysis;;# +#;SSPS_WS_BOTTLE;'DAYD_WS','STRING4';char;SEA SURFACE SALINITY BOTTLE NUMBER;;;;;;;;;;;Number of sea surface salinity water sample;;# +#;SSTP;'DAYD';float;SEA SURFACE TEMPERATURE;surface temperature;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Sea Surface Temperature (SST) measure at intake with external instrument. This is ocean Temperature;;# +#;SSTP_QC;'DAYD';byte;SEA SURFACE TEMPERATURE QUALITY FLAG;surface temperature quality;;;0;9;%1d;;;;;Quality flag applied on SSTP temperature values;0;# +#;SSTP_CAL;'DAYD';float;SEA SURFACE TEMPERATURE CALIBRATED;surface temperature calibrated;degrees Celsius;;-1.5;38;%6.3lf;99999;;;;Sea Surface Temperature Calibrated;;# +#;SSTP_FREQ;'DAYD';float;SEA SURFACE TEMPERATURE FREQUENCY;temperature frequency in TSG;Hz;;0;20000;%9.3lf;99999;;;0.001;Frequency of external temperature sensor, used for SST measurement;;# +#;SSTP_ADJUSTED;'DAYD';float;SEA SURFACE TEMPERATURE ADJUSTED;surface temperature adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;;Adjusted Ocean temperature;;# +#;SSTP_ADJUSTED_ERROR;'DAYD';float;ERROR ON SEA SURFACE TEMPERATURE ADJUSTED;error surface temperature adjusted;degrees Celsius;;-1.5;38;%6.3lf;99999;;;;Error on adjusted Ocean temperature;;# +#;SSTP_ADJUSTED_QC;'DAYD';byte;SEA SURFACE TEMPERATURE ADJUSTED QUALITY FLAG;quality flag on surface temperature adjusted;;;;9;%1d;0;;;;Quality flag applied on adjusted Ocean temperature;0;# +#;SSTP_ADJUSTED_HIST;'STRING256';char;ADJUSTED SEA SURFACE TEMPERATURE PROCESSING HISTORY;surface temperature adjusted processing history;;;;;;;;;;;;# +#;SSTP_DEPH;'N1';float;NOMINAL DEPTH OF WATER INTAKE FOR TEMPERATURE MEASUREMENT;depth surface temperature;meter;;0;100;%6.3lf;99999;;;;;;# +#;SSTP_DEPH_MIN;'N1';float;MINIMUM DEPTH OF WATER INTAKE FOR TEMPERATURE MEASUREMENT;min depth surface temperature;meter;;0;100;%6.3lf;99999;;;;;;# +#;SSTP_DEPH_MAX;'N1';float;MAXIMUM DEPTH OF WATER INTAKE FOR TEMPERATURE MEASUREMENT;max depth surface temperature;meter;;0;100;%6.3lf;99999;;;;;;# +#;SSTP_CALCOEF;'NCOEF_CAL';double;TEMPERATURE CALIBRATION COEFFICIENTS;;;a,b,c,d,f0;;;;99999;;;;Temperature calibrated using linearization coefficient;;# +#;SSTP_LINCOEF;'NCOEF_LIN';double;TEMPERATURE LINEAR DRIFT CORRECTION COEFFICIENTS;;;slope,offset;;;;99999;;;;Temperature linear drift correction coefficient;;# +#;SSTP_EXT;'DAYD_EXT';float;SEA SURFACE TEMPERATURE FROM EXTERNAL DATA;surface temperature;degrees Celsius;;-1.5;38;%6.3lf;99999;;;0.001;Sea Surface Temperature (SST) from external data instrument;;# +#;SSTP_EXT_QC;'DAYD_EXT';byte;SEA SURFACE TEMPERATURE QUALITY FLAG;surface temperature quality;;;0;9;%1d;;;;;Quality flag applied on external temperature data values;0;# +#;SSTP_EXT_TYPE;'STRING4';char;SEA SURFACE TEMPERATURE EXTERNAL INSTRUMENT TYPE;surface temperature type instrument;;;;;;;;;;CTD,ARGO,XBT,...;;# +#;SSPS_EXT;'DAYD_EXT';float;SEA SURFACE SALINITY FROM EXTERNAL INSTRUMENT;surface salinity;P.S.U.;;0;40;%6.3lf;99999;;;0.001;Sea surface salinity from external instrument;;# +#;SSPS_EXT_QC;'DAYD_EXT';byte;SEA SURFACE SALINITY QUALITY FLAG;surface salinity quality;;;0;9;%1d;;;;;Quality flag applied on salinity values from external instrument;0;# +#;SSPS_EXT_TYPE;'STRING4';char;TYPE OF EXTERNAL DATA ORIGIN;Type of external data origin;;;;;;;;;;CTD,ARGO,XBT,...;;# diff --git a/tsg_data/past0601.nc b/tsg_data/past0601.nc index 45291f770ce78331f406af309b924b61d15d68b1..85431de6f32ef5e158464737d8c10cb940c9a3f6 100644 Binary files a/tsg_data/past0601.nc and b/tsg_data/past0601.nc differ diff --git a/tsg_io/private/decodeficlabview.m b/tsg_io/private/decodeficlabview.m index b4b16129576e8cf7f85f66e0a122ce8462a32289..93e6d23fde03f93bc23207151f5cf102e29790d0 100644 --- a/tsg_io/private/decodeficlabview.m +++ b/tsg_io/private/decodeficlabview.m @@ -37,12 +37,9 @@ function [date, time, lat, lon, sst, sss, cond, condRaw, sog, cog] =... % Le nombre d'elements de l'entete determine le nombre de chaine a lire. % Je cree ici la chaine de caractere decrivant le format utilise par - % textscan + % textscan. Modifie par jg avec repmat % -------------------------------------------------------------- - format = []; - for i = 1:nPara - format = [format ' %s']; - end + format = repmat(' %s', 1, nPara); % textscan permet de lire a peu pres tout, memes les lignes % incompletes, plus courtes. @@ -102,7 +99,7 @@ function [date, time, lat, lon, sst, sss, cond, condRaw, sog, cog] =... if ColNo.Lat ~=0 % Test si latitude en degre decimal ou degre minute % -------------------------------------------------- - lat = str2num( char(data{ColNo.Lat}{ient}) ); + lat = str2double( char(data{ColNo.Lat}{ient}) ); % lat est vide si les latitudes sont en degres minutes. % Conversion en degre decimal @@ -114,7 +111,7 @@ function [date, time, lat, lon, sst, sss, cond, condRaw, sog, cog] =... end if ColNo.Lon ~= 0 - lon = str2num( char(data{ColNo.Lon}{ient}) ); + lon = str2double( char(data{ColNo.Lon}{ient}) ); % lon est vide si les latitudes sont en degres minutes. % Conversion en degre decimal @@ -125,20 +122,20 @@ function [date, time, lat, lon, sst, sss, cond, condRaw, sog, cog] =... end if ColNo.Temp ~= 0 - sst = str2num( char(data{ColNo.Temp}{ient}) ); + sst = str2double( char(data{ColNo.Temp}{ient}) ); end if ColNo.Sal ~= 0 - sss = str2num( char(data{ColNo.Sal}{ient}) ); + sss = str2double( char(data{ColNo.Sal}{ient}) ); end if ColNo.Cond ~= 0 - cond = str2num( char(data{ColNo.Cond}{ient}) ); + cond = str2double( char(data{ColNo.Cond}{ient}) ); end if ColNo.Raw ~= 0 condRaw = char( data{ColNo.Raw}{ient} ); end if ColNo.Sog ~= 0 - sog = str2num( char(data{ColNo.Sog}{ient}) ); + sog = str2double( char(data{ColNo.Sog}{ient}) ); end if ColNo.Cog ~= 0 - cog = str2num( char(data{ColNo.Cog}{ient}) ); + cog = str2double( char(data{ColNo.Cog}{ient}) ); end \ No newline at end of file diff --git a/tsg_io/readTsgDataLabview.m b/tsg_io/readTsgDataLabview.m index e07bce86bb8a6ff9f4c974c277ca76671bb9917d..e3c5c302605d9ceac892f268fa6a5b6af2025e86 100644 --- a/tsg_io/readTsgDataLabview.m +++ b/tsg_io/readTsgDataLabview.m @@ -49,6 +49,10 @@ fid = fopen( filename, 'r'); % -------------------------- if fid ~= -1 + % Display more info about read file on console + % -------------------------------------------- + fprintf('...reading %s : ', filename); + % Choix des parametres qui seront utilises par TSG-QC % ColNo : structure des numeros de colonnes a conserver % --------------------------------------------------- @@ -132,7 +136,7 @@ if fid ~= -1 % end - % save original date + % Save original date % ------------------ tsg.DATE = datestr( tsg.DAYD, 'yyyymmddHHMMSS' ); tsg.LATX = lat; @@ -164,8 +168,8 @@ if fid ~= -1 end % fin de boucle if strcmp(choix,'yes') - % Fermeture du fichier - % -------------------- + % Close the file + % -------------- fclose( fid ); % Display time to read file on console diff --git a/tsg_io/writeTSGDataNetCDF.m b/tsg_io/writeTSGDataNetCDF.m index 11d6ffb2c813f5ebcd4eb8ebe391d6a1dda2af20..df1ab417bed9ddd3686dc376e2ee43e0201ab9f3 100644 --- a/tsg_io/writeTSGDataNetCDF.m +++ b/tsg_io/writeTSGDataNetCDF.m @@ -184,8 +184,8 @@ for i=1:numel(d) tsg.(ncv_keys{d(i)}) = datenumToJulian(tsg.(ncv_keys{d(i)})); end -% Write measurements (variables) -% ------------------------------- +% Write measurements (tsg.variables) +% ---------------------------------- for i=1:numel(ncv_keys) % get netcdf variable name @@ -196,31 +196,43 @@ for i=1:numel(ncv_keys) % --------------- waitbar( i/numel(ncv_keys), wb, ['writing ' variable ' variable']); - % don't write value if empty data, netcdf use FillValue_ attribute - % in case of unlimited dimension, for example only, use: - % nc{variable}(1:length(tsg.(variable))) = tsg.(variable); - % ---------------------------------------------------------------- - if ~isempty(tsg.(variable)) + % get ncvar type object nv + % ------------------------ + nv = nc{variable}; + + % be careful, if dimensions DAYD_WS or DAYD_EXT not defined + % (no sample data), nv is empty + % --------------------------------------------------------- + if ~isempty(nv) - nv = nc{variable}; + % set autonan mode (FillValue_) + % ----------------------------- nv = autonan(nv,1); - - % finally replace NaN by fillvalue - % -------------------------------- -% if ~isempty(fillval(nc{variable})) -% tsg.(variable)(tsg.(variable) == NaN ) = fillval(nc{variable}); -% end - - % fill netcdf variables with corresponding tsg structure - % ------------------------------------------------------ - nv(:) = tsg.(variable); - - % use autonan mode, remplace fillValue with NaN - % --------------------------------------------- - %nv = nc{variable}; - %nv = autonan(nv, true); + + % tsg variable is not empty, fill nv with it + % ------------------------------------------ + if ~isempty(tsg.(variable)) + + % fill netcdf variables nv with corresponding tsg variable + % -------------------------------------------------------- + nv(:) = tsg.(variable); + + % In case of unlimited dimension, for example only, use: + % nc{variable}(1:length(tsg.(variable))) = tsg.(variable) + % ------------------------------------------------------- + + else + + % if missing_value defined, fill nv with it + % ----------------------------------------- + if ~isempty(nv.missing_value(:)) + nv(:) = nv.missing_value(:); + end + + end end + end % Close waitbar diff --git a/tsg_util/plot_EXT.m b/tsg_util/plot_EXT.m index 0b182ce6da36bf176aacc7817421d80cc332be21..8d5f9cc8cb80c684cbead9526ca7ba1f5dd8dda5 100644 --- a/tsg_util/plot_EXT.m +++ b/tsg_util/plot_EXT.m @@ -20,7 +20,8 @@ tsg = getappdata( hGUI, 'tsg_data'); axes( hAxes(1)); hold on; - +%set(hAxes(1), 'nextplot', 'add'); + % Plot external salinity on TSG plot % -------------------------------- if ~isempty(tsg.SSPS_EXT) @@ -32,8 +33,10 @@ hold off; axes( hAxes(2)); hold on; +%set(hAxes(2), 'nextplot', 'add'); + % Plot external temperature on TSG plot % ------------------------------------- if ~isempty(tsg.SSTP_EXT) - plot(hAxes(1), tsg.DAYD_EXT, tsg.SSTP_EXT, 'b*'); + plot(hAxes(2), tsg.DAYD_EXT, tsg.SSTP_EXT, 'b*'); end \ No newline at end of file diff --git a/tsg_util/plot_SalTempVel.m b/tsg_util/plot_SalTempVel.m index 9e1c5090def34b8e824ceb6a2ab41604c0e98007..54b07e6dbce957080c1cb06813134a6f1a293a3a 100644 --- a/tsg_util/plot_SalTempVel.m +++ b/tsg_util/plot_SalTempVel.m @@ -27,6 +27,7 @@ axes( hAxes(1)); plot(hAxes(1), tsg.DAYD, tsg.SSPS, '.w'); hold on; +%set(hAxes(1), 'nextplot', 'add'); % get list of keys from hashtable tsg.qc.hash, defined inside % tsg_initialisation.m @@ -45,7 +46,7 @@ for i=1:numel(qc_list) color = get(tsg.qc.hash, key, 'color'); % plot only for valid context menu (set to 'on') - % -------------------------------_______------- + % ---------------------------------------------- if strcmp( state, 'on') % plot tsg salinity sample with right code/color diff --git a/tsg_util/plot_SalTsgSample.m b/tsg_util/plot_SalTsgSample.m index da1c51efeb99c2509ad64837f5f95b18d7d2028b..8620a48c90ab161c9e249471e53ef22da5e9a153 100644 --- a/tsg_util/plot_SalTsgSample.m +++ b/tsg_util/plot_SalTsgSample.m @@ -24,6 +24,7 @@ plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... strcat('.',tsg.qc.Color.NO_CONTROL)); hold on; +%set(hAxes(1), 'nextplot', 'add'); ind = find(tsg.SSPS_QC == tsg.qc.Code.GOOD ); plot(hAxes(1), tsg.DAYD(ind), tsg.SSPS(ind), ... diff --git a/tsg_util/plot_TsgAdjusted.m b/tsg_util/plot_TsgAdjusted.m index 74f0841fe6829f1f56fa90d3fe394797302616c9..b68c3ccf9d7e03766f527c93c3970650b6bbdb4f 100644 --- a/tsg_util/plot_TsgAdjusted.m +++ b/tsg_util/plot_TsgAdjusted.m @@ -26,7 +26,9 @@ ind = find(tsg.SSPS_ADJUSTED < FILLVALUE-1); % ---------------------------------- axes(hPlotAxes(3)) plot(tsg.DAYD, tsg.SSPS, 'k' ); -hold on + +hold on; +%set(hAxes(1), 'nextplot', 'add'); % Plot tsg.SSPS_ADJUSTED (corrected data) on axes 3 % ------------------------------------------------- @@ -38,7 +40,9 @@ hold off % Plot the difference tsg.SSPS_ADJUSTED-tsg.SSPS on axe 2 % ------------------------------------------------------- axes(hPlotAxes(2)); -hold on +hold on; +%set(hAxes(1), 'nextplot', 'add'); + if ~isempty( ind ) plot(tsg.DAYD(ind), tsg.SSPS_ADJUSTED(ind)-tsg.SSPS(ind), 'b' ); end @@ -49,5 +53,3 @@ hold off set(hPlotAxes(3), 'Xlim', [tsg.DAYD(1)-1 tsg.DAYD(end)+1]); set(hPlotAxes(3),'XTickMode','auto') datetick(hPlotAxes(3),'x','keeplimits') - -hold off \ No newline at end of file diff --git a/tsg_util/plot_WS.m b/tsg_util/plot_WS.m index 7f34e84829032d486d23e114b6b661a3c84f7d27..3ef93066175a45dddfc6948646c2191f5616fe01 100644 --- a/tsg_util/plot_WS.m +++ b/tsg_util/plot_WS.m @@ -21,7 +21,7 @@ axes( hAxes(1)); hold on; - +%set(hAxes(1), 'nextplot', 'add'); % Plot salinity sample on TSG plot % -------------------------------- diff --git a/tsg_util/tsg_initialisation.m b/tsg_util/tsg_initialisation.m index ea2062cba44a43984f739b95d0d16a7a4ddc8ca9..c067b5362ee5a92426783ec79b686897051f3744 100644 --- a/tsg_util/tsg_initialisation.m +++ b/tsg_util/tsg_initialisation.m @@ -1,25 +1,28 @@ -function tsg_initialisation(hTsgGUI) +function tsg = tsg_initialisation() +%function tsg_initialisation(hTsgGUI) % % Input % ----- -% hTsgGUI ............ Handel to the main user interface -% hQcCmenu ........... Handel to the QC code context menu +% none % % Output % ------ +% tsg ............ tsg structure that contain data +% % $Id$ % % ------------------------------------------------------------------------- %% Constants for NetCDF DATA FORMAT TSG % ------------------------------------------------------------------------- + % netcdf file version % ------------------- -FORMAT_VERSION = '1.4'; +NETCDF_FORMAT_VERSION = '1.4'; % date of reference for julian days, is 1st january 1950 % ------------------------------------------------------ -REFERENCE_DATE_TIME = '19500101000000'; +REFERENCE_DATE_TIME = '19500101000000'; % get actual date % --------------- @@ -129,15 +132,15 @@ tsg.DAYD_EXT = []; % initialise tsg structure from tsg_nc objects % -------------------------------------------- -% variables -% --------- +% assign empty matrix to all variables +% ------------------------------------ for i=1:numel(ncv_keys) - variable = ncv_keys{i}; - tsg.(variable) = []; + variable = ncv_keys{i}; + tsg.(variable) = []; end -% globals attributes -% ------------------ +% assign empty string to all globals attributes +% --------------------------------------------- for i=1:numel(nca_keys) global_att = nca_keys{i}; tsg.(global_att) = ''; @@ -145,13 +148,8 @@ end % set some fields % --------------- -tsg.FORMAT_VERSION = FORMAT_VERSION; +tsg.FORMAT_VERSION = NETCDF_FORMAT_VERSION; tsg.DATE_CREATION = [date(1:8) date(10:15)]; tsg.DATE_UPDATE = tsg.DATE_CREATION; tsg.REFERENCE_DATE_TIME = REFERENCE_DATE_TIME; -% Save structure tsg -% ------------------ -setappdata( hTsgGUI, 'tsg_data', tsg); - -end diff --git a/tsg_util/tsg_preferences.m b/tsg_util/tsg_preferences.m new file mode 100644 index 0000000000000000000000000000000000000000..82ced8e905ce8a496d94e38654a620d728b47dbc --- /dev/null +++ b/tsg_util/tsg_preferences.m @@ -0,0 +1,105 @@ +function tsg_preferences(hTsgGUI, app_name) +% tsg_preferences(S1,S2) returns structure tsg saved in S1.mat file +% and with S2 internal version number. +% If S1.mat dosn't exist, call tsg_initialisation to create it in +% prefdir directory +% +% Input +% ----- +% hTsgGUI ............ Handle to the main user interface +% app_name ............ application name +% +% Output +% ------ +% none +% +% $Id$ +% + +global VERSION + +% init empty tsg structure +% ------------------------ +tsg = []; + +% Construct config file path +% -------------------------- +config_file = [prefdir, filesep, app_name, '.mat']; + +% Open config file +% ---------------- +config = fopen( config_file, 'r' ); + +% test fopen return value +% ----------------------- +if config == -1 + + % config file dosn't exist, call default tsg_initialisation + % --------------------------------------------------------- + tsg = tsg_initialisation; + + % ccall new config private function + % --------------------------------- + new_config; + +else + + % file exist, load in workspace + % ----------------------------- + try + load( config_file, 'root', 'tsg' ); + + % set current preference autoload in submenu option/preference + % ------------------------------------------------------------ + set(findobj('tag', 'TAG_UIMENU_OPTION_PREFERENCES', ... + 'checked', root.preference.autoload)); + + catch + warning('tsgqc_GUI:tsg_preferences', ['Can''t load' config_file]); + %datagui_closereq_callback; + end + + % If there no field version or wrong version, initialize + % ------------------------------------------------------- + if ~isfield( root, 'version') || ~strcmp(root.version, VERSION) + + % call new config private function + % -------------------------------- + new_config; + + end + +end + +% Save structure tsg +% ------------------ +setappdata( hTsgGUI, 'tsg_data', tsg); + +% cas d'erreur si l'utilisation change de disque (cle USB -> disque dur +% par ex, self.path ne sera pas a jour et la lecture fichier genere une +% erreur +% if ~exist( root.path, 'dir' ) +% root.path = [pwd filesep]; +% end + +% ---------------------------------------------------------------------- +% private function new_config +% ---------------------------------------------------------------------- + function new_config + + % init root structure to default values + % ------------------------------------- + root.preference.autoload = 'off'; + root.version = VERSION; + + % save root and tsg to prefdir mat file + % ------------------------------------- + save(config_file, 'root', 'tsg'); + + % save root in root object for next use + % ------------------------------------- + set(0, 'userdata', root); + + end + +end diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m index 9dec098b24936b9c494abf4e04917f9043e7be74..63a2d59edb9e64df6e9aeb8c42fdba29b0721de3 100644 --- a/tsgqc_GUI.m +++ b/tsgqc_GUI.m @@ -33,6 +33,12 @@ function tsgqc_GUI % --------------------------------------------------------- clc; +% Define global variable VERSION number +% ------------------------------------- +global VERSION + +VERSION = '0.2a'; + % Find program directory. % functions (icons) should be store at a lower level % add directories to Matlab search path, works on UNIX @@ -69,6 +75,7 @@ guiLimits(2) = guiLimits(2) + 0.05; guiLimits(3) = guiLimits(3) - 0.02; guiLimits(4) = guiLimits(4) - 0.15; + %% Main GUI % Create and then hide the GUI as it is being constructed. % -------------------------------------------------------- @@ -90,7 +97,15 @@ hMainFig = figure(... % Initialize tsg structure % ------------------------ -tsg_initialisation(hMainFig) +%tsg_initialisation(hMainFig) + +%% Initialize tsg structure with tsg_preference function +% ----------------------------------------------------- +tsg_preferences(hMainFig, tsgqcname); + +% get root struct from root object +% -------------------------------- +root = get(0,'Userdata'); % Retrieve named application data % ------------------------------- @@ -200,9 +215,9 @@ end % -------------------------------------------------------- hOptionMenu = uimenu(hMainFig,'Label','Option'); uimenu(hOptionMenu,'Label','Preferences',... - 'Checked','off',... + 'Checked', root.preference.autoload,... 'Tag','TAG_UIMENU_OPTION_PREFERENCES',... - 'Enable', 'off',... + 'Enable', 'on',... 'Callback', {@PreferencesMenuCallback}); %% Toolbar @@ -215,7 +230,7 @@ hOpenPushtool = uipushtool(... % Opendoc toolbar button 'TooltipString','Open file',... 'CData', iconRead(fullfile(matlabroot, ... '/toolbox/matlab/icons/opendoc.mat')),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_OPEN',... 'UserData', 'off',... 'Enable', 'on',... @@ -225,7 +240,7 @@ hSavePushtool = uipushtool(... % Open Save toolbar button 'TooltipString','Save NetCDF file',... 'CData',iconRead( ... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'savedoc.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_SAVE',... 'Enable', 'off',... 'ClickedCallback', @SaveMenuCallback); @@ -235,7 +250,7 @@ hZoomToggletool = uitoggletool(... % Open Zoom toolbar button 'TooltipString','Zoom',... 'CData', iconRead(fullfile(matlabroot, ... '/toolbox/matlab/icons/zoom.mat')),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_ZOOM',... 'Enable', 'off',... 'OffCallback', @Zoom_OffMenuCallback,... @@ -268,7 +283,7 @@ hMapToggletool = uitoggletool(... % Open Map toolbar button 'Separator', 'on', ... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'mapicon.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_MAP',... 'UserData', 'off', ... 'Enable', 'off',... @@ -280,7 +295,7 @@ hClimToggletool = uitoggletool(... % Open Climatology toolbar button 'Separator', 'on', ... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'climicon.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_CLIM',... 'UserData', 'off',... 'Enable', 'off',... @@ -292,7 +307,7 @@ hBottleToggletool = uitoggletool(... % Correction module toolbar button 'Separator', 'on', ... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'bottleicon.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_BOTTLE',... 'UserData', 'off',... 'Enable', 'off',... @@ -303,7 +318,7 @@ hStartlimitToggletool = uitoggletool(... % Select beginning of time series to 'TooltipString','Select start time',... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'startlimit.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag', 'CORRECT_STARTTIME', ... 'UserData', 'off',... 'Enable', 'off',... @@ -314,7 +329,7 @@ hEndlimitToggletool = uitoggletool(... % Select end of time series 'TooltipString','Select end time',... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'endlimit.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag', 'CORRECT_ENDTIME', ... 'UserData', 'off',... 'Enable', 'off',... @@ -327,7 +342,7 @@ hHeaderPushtool = uipushtool(... % Open headerForm button 'Separator', 'on', ... 'CData',iconRead(... [DEFAULT_PATH_FILE 'tsg_icon' filesep 'hdricon.mat']),... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Tag','PUSHTOOL_HEADER',... 'Enable', 'off',... 'ClickedCallback', @HeaderMenuCallback); @@ -504,19 +519,22 @@ hPlotAxes(1) = axes(... % the axes for plotting Salinity 'Parent', hPlotsPanel, ... 'Units', 'normalized', ... 'Visible', 'off', ... + 'Tag', 'TAG_AXES_1', ... 'HandleVisibility','on', ... % set to callback after first plot 'Position',[.05, .64, .93, .35]); hPlotAxes(2) = axes(... % the axes for plotting temperature 'Parent', hPlotsPanel, ... 'Units', 'normalized', ... 'Visible', 'off', ... - 'HandleVisibility','callback', ... + 'Tag', 'TAG_AXES_2', ... + 'HandleVisibility','on', ... 'Position',[.05, .33, .93, .27]); hPlotAxes(3) = axes(... % the axes for plotting ship velocity 'Parent', hPlotsPanel, ... 'Units', 'normalized', ... 'Visible', 'off', ... - 'HandleVisibility','callback', ... + 'Tag', 'TAG_AXES_3', ... + 'HandleVisibility','on', ... 'Position',[.05, .02, .93, .27]); % The map will be plot in a uipanel @@ -529,6 +547,7 @@ hPlotAxes(4) = axes(... % the axes for plotting ship track map 'Parent', hMapPanel, ... 'Units', 'normalized', ... 'Visible', 'off', ... + 'Tag', 'TAG_AXES_MAP', ... 'Color', 'none', ... 'UserData', 'off', ... 'HandleVisibility','on', ... @@ -718,6 +737,67 @@ hetDateMax = uicontrol( ... 'Enable', 'off', ... 'Position',[.01 .15 .95 .17]); + + +%% test if user preference autoload field is checked (on) +% ------------------------------------------------------- +if strcmp(root.preference.autoload, 'on') + + % this code need to be fatorized file/open menu + % --------------------------------------------- + + % A TSG file has been open and read + % --------------------------------- + set( hOpenMenu, 'UserData', 'on' ); + + % Show handles marked as hidden with HandleVisibility property set to + % callback or off + % ------------------------------------------------------------------- + set(0, 'ShowHiddenHandles', 'on'); + + % enable toolbar menu pushtool + % ---------------------------- + hdl_pushtool = findobj('-regexp','Tag', 'PUSHTOOL_'); + set(hdl_pushtool, 'Enable', 'on'); + + % enable Save menu + % ---------------- + set(hSaveMenu, 'Enable', 'on'); + + % update the filename display + % --------------------------- + set( hInfoFileText, 'String', tsg.file.name); + + % update some fields in tsg structure + % ----------------------------------- + updateTsgStruct(hMainFig); + + % Running average of TSG time series + % ---------------------------------- + tsg_moveaverage(hMainFig); + + % The callback to detect the mouse motion can be set to on + % -------------------------------------------------------- + set( hMainFig, 'UserData', 'ButtonMotionOn'); + + % yes, plot the Salinity, temperature and velocity + % ------------------------------------------------ + plot_SalTempVel( hMainFig, hPlotAxes ); + plotmap( hMainFig, hPlotAxes); + plot_WS( hMainFig, hPlotAxes ); + plot_EXT( hMainFig, hPlotAxes ); + + % Hide handles marked as hidden with HandleVisibility property set to + % callback or off + % ------------------------------------------------------------------- + set(0, 'ShowHiddenHandles', 'off'); + +end + +% wait for user input (callback) +% ------------------------------ + + %% *************************** CALLBACKS ********************************** %% OpenMenuCallback @@ -1056,11 +1136,18 @@ hetDateMax = uicontrol( ... % put last SSPS_QC in queue (Undo/Redo) % ------------------------------------- tsg.queue = push( tsg.queue, tsg.SSPS_QC); + + % Save the modifications before call display_QC + % --------------------------------------------- + setappdata( hMainFig, 'tsg_data', tsg); % set current axes and plot % ------------------------- axes(hPlotAxes(1)); - hold on + + hold on; + %set(hPlotAxes(1), 'nextplot', 'add'); + color = ['.' tsg.qc.active.Color]; % plot selected data with selected code @@ -1599,6 +1686,38 @@ end end +%% PreferencesMenuCallback + % ------------------------------------------------------------------- + % Callback function run when Option/Preference is selected + % ------------------------------------------------------------------- + function PreferencesMenuCallback(hObject, eventdata) + + % Test if the preference menu is allready checked + % ----------------------------------------------- + if strcmp( get(hObject, 'checked'), 'on' ) + + % set preference autoload off (unchecked) + % --------------------------------------- + root.preference.autoload = 'off'; + + else + + % set preference autoload on (checked) + % ------------------------------------ + root.preference.autoload = 'on'; + + end + + % set current option/preference submenu state + % ------------------------------------------- + set(hObject, 'checked', root.preference.autoload); + + % store root struct to root UserData + % ---------------------------------- + set(0, 'userdata', root); + + end + %% HeaderMenuCallback % ------------------------------------------------------------------- @@ -1653,6 +1772,15 @@ end % write netcdf file % ----------------- error = writeTSGDataNetCDF( hMainFig, [pathName fileName] ); + + % get root struct from root object + % -------------------------------- + root = get(0,'Userdata'); + + % save config mat file in prefdir + % ------------------------------- + config_file = [prefdir, filesep, tsgqcname, '.mat']; + save( config_file, 'root', 'tsg'); % Pointer reset to arrow % ---------------------- @@ -1662,7 +1790,8 @@ end % must to be rewriting % -------------------------------- if error == -1 - warning('NetCDF writing error: %s %s', pathName, fileName); + warning('tsgqc_GUI:SaveMenuCallback', ... + 'NetCDF writing error: %s %s', pathName, fileName); return; end @@ -1692,11 +1821,19 @@ end questdlg('The file has been modified. Do you want to save it ?',... 'Save before Quit?',... 'Yes', 'No', 'Yes'); + if strcmp(selection, 'Yes') - return; - else - QuitProgram; + + % call File/Save Menu Callback before before quit + % ----------------------------------------------- + SaveMenuCallback; + end + + % quit program + % ------------ + QuitProgram; + else selection = ... questdlg(['Quit ' get(hMainFig, 'Name') '?'],...