Giter Club home page Giter Club logo

idl-coyote / coyote Goto Github PK

View Code? Open in Web Editor NEW
63.0 13.0 37.0 6.15 MB

The Coyote Library evolved from work David Fanning was doing teaching IDL courses and answering IDL questions on the IDL newsgroup. It is meant to be a well-documented library that demonstrates how to write solid (dare we say eloquent) IDL programs that are easy to maintain and extend. You can learn more about these programs and about IDL programming in general at David's web page, Coyote's Guide to IDL Programming.

IDL 94.04% HTML 5.96%

coyote's Introduction

The Coyote Library is an Open Source programming project, hosted at
https://github.com/idl-coyote/coyote.

Programs in the Coyote Library are updated frequently and new
programs are added continuously. It is extremely important that
you keep up with recent changes if you expect to work with the
Coyote Library and all of the other IDL programs in the world that
use the Coyote Library. Please update your library every time
you think of it!

You can find the latest version of the Coyote Library at this location:

   http://wwww.idlcoyote.com/programs/coyoteprograms.zip

Or, in the Download section here:

   https://github.com/idl-coyote/coyote/archive/master.zip

The Coyote Library evolved from work David Fanning was doing
teaching IDL courses and answering IDL questions on the IDL
newsgroup. It is meant to be a well-documented library that
demonstrates how to write solid (dare we say eloquent) IDL
programs that are easy to maintain and extend. You can learn
more about these programs and about IDL programming in general
at David's web page, Coyote's Guide to IDL Programming.

   http://www.idlcoyote.com/

PROGRAMS RENAMED:

Note that in February 2011 a great many Coyote Library programs
were renamed to start with the letter "cg" for Coyote Graphics.
The old programs didn't go away, they simply moved to the "retired"
sub-directory in the Coyote Library. If you want to use them, all
you need to is add the Coyote Library and all its sub-directories to
your IDL path. (Normally this is done by putting a check mark in
front of the directory if you set your path with the IDL workbench,
or by adding a + sign to the name of the directory in an IDL start-up
file.)

Further development, however, had stopped for "retired" programs
and will only go forward on the renamed Coyote Library programs.
This means you will *probably* want to start using the new names
in your programs. Most of the names are self-explanatory. A few
are not. Here are some common programs with their name changes on
the right:

   CTLoad -> cgLoadCT
   FSC_Color -> cgColor
   LoadData -> cgDemoData
   TVInfo -> cgImageInfo
   TVImage -> cgImage
   TVRead -> cgSnapshot

AUTHOR:

  David W. Fanning
  FANNING SOFTWARE CONSULTING
  1645 Sheely Drive
  Fort Collins
  CO 80526 USA
  Phone: 970-221-0438
  E-mail: [email protected]

If you have a question about the software or how to use
it, please contact David Fanning via e-mail.

All Coyote Library routines use the following BSD Open Source License:

;******************************************************************************************;
;                                                                                          ;
;  Copyright (c) 2012, by Fanning Software Consulting, Inc. All rights reserved.           ;
;                                                                                          ;
;  Redistribution and use in source and binary forms, with or without                      ;
;  modification, are permitted provided that the following conditions are met:             ;
;                                                                                          ;
;      * Redistributions of source code must retain the above copyright                    ;
;        notice, this list of conditions and the following disclaimer.                     ;
;      * Redistributions in binary form must reproduce the above copyright                 ;
;        notice, this list of conditions and the following disclaimer in the               ;
;        documentation and/or other materials provided with the distribution.              ;
;      * Neither the name of Fanning Software Consulting, Inc. nor the names of its        ;
;        contributors may be used to endorse or promote products derived from this         ;
;        software without specific prior written permission.                               ;
;                                                                                          ;
;  THIS SOFTWARE IS PROVIDED BY FANNING SOFTWARE CONSULTING, INC. ''AS IS'' AND ANY        ;
;  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES    ;
;  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT     ;
;  SHALL FANNING SOFTWARE CONSULTING, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,             ;
;  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED    ;
;  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;         ;
;  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND             ;
;  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT              ;
;  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS           ;
;  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                            ;
;******************************************************************************************;

DOCUMENTATION:

   Documentation for Coyote Graphics Routines (any program starting with "cg" as
   a prefex as well as other intimately tied to Coyote Graphics routines) is
   available on line:

        http://www.idlcoyote.com/idldoc/cg/index.html

   Documentation for other routines is available as an HTML file in the Coyote
   directory:

         http://www.idlcoyote.com/programs/program.documentation.html

coyote's People

Contributors

ct6502 avatar davidwfanning avatar flamingbear avatar mandrakos avatar met-pub avatar sappjw-noaa avatar wlandsman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coyote's Issues

Graphics saved upside-down

Hi all,
since commit "Small changes in a number of files." (af66b7c), graphics are saved upside down when using this code:

data = cgDemoData(2)
LoadCT, 33, NCOLORS=12, BOTTOM=1
cgContour, data, NLEVELS=12, C_COLORS=Indgen(12)+1, /FILL, /WINDOW
cgControl, CREATE_PNG='some file'

I had come across a similar problem earlier in a different context. There, the issue was related to the !ORDER system variable. In this case, changing it, doesn't seem to make a difference.

Thanks for the support!
Cheers, Achim

Ambiguous keyword in cgMap_Grid

9fc0811 introduced a bug that breaks some existing code. IDL can't distinguish between LABEL and LABEL_WITH_DEGREE because the former may be a shortened version of the latter. Since there already exists a LABEL keyword there's now a conflict. The new keyword needs a different start to the name (maybe DEGREE_LABEL?).

Reproduce with:

IDL> cgmap_set, label=1, /grid

Traceback Report from CGMAP_SET:

     % Ambiguous keyword abbreviation: LABEL.
     % Execution halted at:  CGMAP_SET         617

cgps_setup__define error

Each time, we launch the cgPS_open, we rise an error message (line 227)
% Program caused arithmetic error: Floating illegal operand
the concerned line is
IF N_Elements(struct) EQ 0 THEN ps_struct = {cgPS_SETUP}

I tried with ISA but it doesn't work...
IF ISA(struct,'CGPS_SETUP') EQ 0 THEN ps_struct = {cgPS_SETUP}

In my code, I call at least 20 times this routine, it is a bit tiresome to get the same error messages 20 times but it doesn't have a impact on the results.

Thanks very much if somebody could improve this line or suggest a code modification or a missing (perhaps?) module in my directory to avoid it.
Best regards
A.B.

NCDF_data__define: duplicate tag names

NetCDF attribute names are case-sensitive, IDL tag names are case-insensitive and this may lead to duplicate name errors. In NCDF_data__define.pro, the check at line 1947 should be repeated at line 1974.

Mistaken arguments in cgimgscl.pro: 340 - 344

In cgimgscl.pro, lines 340 - 344:

          4: BEGIN ; Log scale stretch.
             tempImage =  cgLogScl(tempImage, Max=maxvalue, Min=minvalue, $
                       Mean=mean, Exponent=exponent, Negative=negative, $
                       OMIN=bottom, OMAX=top)
             END

should be

          4: BEGIN ; Log scale stretch.
             tempImage =  cgLogScl(tempImage, CONSTANT=constant, NEGATIVE=negative, $
                        MAX=maxValue, MIN=minValue, OMAX=top, OMIN=bottom)
             END

cgfixps.pro broken

With the last merge, the file cgfixps.pro is broken due to an unresolved merge conflict:

<<<<<<< HEAD
  Get_Lun, in_lun
  OpenR, in_lun, in_filename
=======
>>>>>>> 8ba3a7b34691137b0d0b3d3f508b434ded51fa12
  IF (FStat(in_lun)).size EQ 0 THEN BEGIN
    Free_lun, in_lun
    Free_lun, out_lun
    File_Delete, out_filename
    ;Print, 'Zero Length File Encountered...'
    RETURN
  ENDIF
  
<<<<<<< HEAD
  ; Move along in the file until the end of the Prolog.
  line = ""
  count = 0
  target = "void"
  buffer = StrArr(100)
  
=======
>>>>>>> 8ba3a7b34691137b0d0b3d3f508b434ded51fa12

blob_analyzer->getStats() returns negative values for center coordinates in large image

What steps will reproduce the problem?

  1. detects = obj_new('blob_analyzer', large_image, /all_neighbors)
  2. stats = detects->getStats(index_of_blob)
  3. stats.center[0 or 1] < 0

What is the expected output? What do you see instead?
The index of the blob center is negative if a large image is used (pixels/columns > 32K) and the blob is resides in a region where one of the indices is > 32k.

What version of the product are you using? On what operating system?

Please provide any additional information below.
Problem is due to indgen() use in find_boundary().

xcm = Total( Total(mask, 2) * Indgen(xsize) ) / totalMass
ycm = Total( Total(mask, 1) * Indgen(ysize) ) / totalMass

suggest using Lindgen() instead.

Horizontal 'blob' (single row) breaks fit_ellipse

What steps will reproduce the problem?

  1. Obtain an image with a horizontal 'blob' (i.e., single row)
  2. Run fit_ellipse on said image
  3. Fail

Can be reproduced with the following code:
IDL> x = bytarr(64, 64)
IDL> x[10:24, 32] = 1
IDL> res = fit_ellipse(x)
% Compiled module: FIT_ELLIPSE.
% Compiled module: ARRAY_INDICES.
% TOTAL: For input argument ARRAY, Dimension must be 1.
% Execution halted at: FIT_ELLIPSE 157
....\coyote\fit_ellipse.pro
% $MAIN$

NCDF_variable GetInfo() breaks when _FillValue and missing_value occur together

Hi all,
I have a netCDF file with a variable which has both attributes _FillValue and missing_value.
In the GetInfo() function for ncdf_variables, lines 622-634, the info is constructed in such a way, that the _FillValue tag is added to the info structure whenever _FillValue or missing_value is found as a variable attribute. This is what the code looks like:
attrNames = self -> GetAttrNames()
attrIndex = Where(attrNames EQ 'scale_factor', count)
IF count GT 0 THEN info = Create_Struct(info, 'scale_factor', $
self -> GetAttrValue('scale_factor'))
attrIndex = Where(attrNames EQ 'add_offset', count)
IF count GT 0 THEN info = Create_Struct(info, 'add_offset', $
self -> GetAttrValue('add_offset'))
attrIndex = Where(attrNames EQ 'missing_value', count)
IF count GT 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('missing_value'))
attrIndex = Where(attrNames EQ '_FillValue', count)
IF count GT 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('_FillValue'))

However, that will create a "Conflicting or duplicate structure tag definition" error if both attributes are there.
I think, one could either put both attributes into the info structure, or avoid the error by filling the _FillValue tag in the info structure with the _FillValue attribute value as the priority, doing something like this:
attrNames = self -> GetAttrNames()
attrIndex = Where(attrNames EQ 'scale_factor', count)
IF count GT 0 THEN info = Create_Struct(info, 'scale_factor', $
self -> GetAttrValue('scale_factor'))
attrIndex = Where(attrNames EQ 'add_offset', count)
IF count GT 0 THEN info = Create_Struct(info, 'add_offset', $
self -> GetAttrValue('add_offset'))

attrIndex = Where(attrNames EQ 'missing_value', count_fill)
attrIndex = Where(attrNames EQ '_FillValue', count_miss)
IF count_fill GT 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('_FillValue'))
IF count_miss GT 0 AND count_fill EQ 0 THEN info = Create_Struct(info, '_FillValue', $
self -> GetAttrValue('missing_value'))

Thanks for the support, cheers
Achim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.